home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Development
Submit: Movie Info Grabbers
[French] allocine.fr (2009-01-31)
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="nazgul64" data-source="post: 687408" data-attributes="member: 91990"><p>Voici mes modifications du code afin de corriger les problèmes suivants:</p><p></p><p>_ récupération image du film</p><p>_ récupération du titre</p><p>_ récupération du synopsis</p><p></p><p>Je suis partie du script édité par Dezelee le 2010-08-12 et je n'ai pas encore mergé mes modifications avec celles de Tarkin effectuées le 2010-11-28 <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite3" alt=":(" title="Frown :(" loading="lazy" data-shortname=":(" /></p><p></p><p>------------------------------------------------------------------------------------------------------------</p><p><span style="color: Green"></span></p><p><span style="color: Green">Voici les modifs (toutes concernent la méthode .GetDetails) :</span></p><p><span style="color: Green"></span></p><p><span style="color: Green">// TITRE</span></p><p><span style="color: Green">string movieTitlebasic;</span></p><p><span style="color: Green">movieTitlebasic = removeUnwantedChars(Regex.Match(strBodyDetail, "<h1>.*?</h1>").ToString());</span></p><p><span style="color: Green">if (movieTitlebasic == "")</span></p><p><span style="color: Green">{</span></p><p><span style="color: Green">movieTitlebasic = removeUnwantedChars(Regex.Match(strBodyDetail, "<h1 property=\"v:itemreviewed\">.*?</h1>").ToString());</span></p><p><span style="color: Green">}</span></p><p><span style="color: Green"></span></p><p><span style="color: Green">...</span></p><p><span style="color: Green"></span></p><p><span style="color: Green">// AFFICHE</span></p><p><span style="color: Green">string patern = "<div class=\"poster\">.*<img src=.*" + movieTitlebasic + ".*</div>";</span></p><p><span style="color: Green">movieDetails.ThumbURL = Regex.Match(strBodyDetail, patern).ToString();</span></p><p><span style="color: Green">movieDetails.ThumbURL = Regex.Match(movieDetails.ThumbURL , "http://[^<]*(jpg|gif)").ToString();</span></p><p><span style="color: Green">movieDetails.ThumbURL = movieDetails.ThumbURL.Replace("r_160_214/b_1_cfd7e1", "r_760_x");</span></p><p><span style="color: Green"></span></p><p><span style="color: Green">...</span></p><p><span style="color: Green"></span></p><p><span style="color: Green">// SYNOPSIS</span></p><p><span style="color: Green">string strBodyDetailcleaned;</span></p><p><span style="color: Green">strBodyDetailcleaned = strBodyDetail.Replace("<b>", "");</span></p><p><span style="color: Green">strBodyDetailcleaned = strBodyDetailcleaned.Replace("</b>", "");</span></p><p><span style="color: Green">strBodyDetailcleaned = strBodyDetailcleaned.Replace("<i>", "");</span></p><p><span style="color: Green">strBodyDetailcleaned = strBodyDetailcleaned.Replace("</i>", "");</span></p><p><span style="color: Green">Match Plot = Regex.Match(strBodyDetailcleaned, "<span property=\"v:summary\">([^<]*)<");</span></p><p><span style="color: Green">movieDetails.Plot = removeUnwantedChars(Plot.Groups[1].Value);</span></p><p><span style="color: Green"></span></p><p><span style="color: Green"></span></p><p>------------------------------------------------------------------------------------------------------------</p><p></p><p><strong>NB1:</strong> mes connaissances en expressions régulières sont faibles et je n'ai pas pu coder ce que je voulais, pour le synopsis ([^<]*)< n'est pas optimal (j'ai du filtrer le formatage .. gras et italique mais ce n'est pas propre et suffisant à mon avis) ... quelle est la syntaxe pour filter un mot entier dans une expression régulière (ex: </span>) :sorry:</p></blockquote><p></p>
[QUOTE="nazgul64, post: 687408, member: 91990"] Voici mes modifications du code afin de corriger les problèmes suivants: _ récupération image du film _ récupération du titre _ récupération du synopsis Je suis partie du script édité par Dezelee le 2010-08-12 et je n'ai pas encore mergé mes modifications avec celles de Tarkin effectuées le 2010-11-28 :( ------------------------------------------------------------------------------------------------------------ [COLOR="Green"] Voici les modifs (toutes concernent la méthode .GetDetails) : // TITRE string movieTitlebasic; movieTitlebasic = removeUnwantedChars(Regex.Match(strBodyDetail, "<h1>.*?</h1>").ToString()); if (movieTitlebasic == "") { movieTitlebasic = removeUnwantedChars(Regex.Match(strBodyDetail, "<h1 property=\"v:itemreviewed\">.*?</h1>").ToString()); } ... // AFFICHE string patern = "<div class=\"poster\">.*<img src=.*" + movieTitlebasic + ".*</div>"; movieDetails.ThumbURL = Regex.Match(strBodyDetail, patern).ToString(); movieDetails.ThumbURL = Regex.Match(movieDetails.ThumbURL , "http://[^<]*(jpg|gif)").ToString(); movieDetails.ThumbURL = movieDetails.ThumbURL.Replace("r_160_214/b_1_cfd7e1", "r_760_x"); ... // SYNOPSIS string strBodyDetailcleaned; strBodyDetailcleaned = strBodyDetail.Replace("<b>", ""); strBodyDetailcleaned = strBodyDetailcleaned.Replace("</b>", ""); strBodyDetailcleaned = strBodyDetailcleaned.Replace("<i>", ""); strBodyDetailcleaned = strBodyDetailcleaned.Replace("</i>", ""); Match Plot = Regex.Match(strBodyDetailcleaned, "<span property=\"v:summary\">([^<]*)<"); movieDetails.Plot = removeUnwantedChars(Plot.Groups[1].Value); [/COLOR] ------------------------------------------------------------------------------------------------------------ [B]NB1:[/B] mes connaissances en expressions régulières sont faibles et je n'ai pas pu coder ce que je voulais, pour le synopsis ([^<]*)< n'est pas optimal (j'ai du filtrer le formatage .. gras et italique mais ce n'est pas propre et suffisant à mon avis) ... quelle est la syntaxe pour filter un mot entier dans une expression régulière (ex: </span>) :sorry: [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
Submit: Movie Info Grabbers
[French] allocine.fr (2009-01-31)
Contact us
RSS
Top
Bottom