Added to CVS.

Michael Kollmann wrote:
Sorry, but there's still something wrong with the contrib script. Requires URL 
to episode_listings.html not to episode_guide.html as mentioned in the 
example given.

The patch attached applies to current CVS (tvtome.php, 2.16) therefore it 
includes the other fix to the score value regex (hunk 4)..

Mike
  

Index: contrib/tvtome.php =================================================================== RCS file: /cvsroot/videodb/videodb/contrib/tvtome.php,v retrieving revision 2.16 diff -u -r2.16 tvtome.php --- contrib/tvtome.php 20 Nov 2006 20:54:56 -0000 2.16 +++ contrib/tvtome.php 21 Nov 2006 11:49:28 -0000 @@ -78,7 +78,7 @@ <tr> <td nowrap>TV.com episode guide URL</td> <td><input type="text" name="tomeurl" value="<?=formvar($tomeurl)?>"></td> - <td>e.g. <code>http://www.tv.com/futurama/show/249/episode_guide.html?season=3</code> + <td>e.g. <code>http://www.tv.com/futurama/show/249/episode_listings.html?season=3</code> omitting the <code>?season=#</code> parameter will fetch the 1st season. (See <a href="http://www.tv.com" target="_blank">tv.com</a>)</td> </tr> <tr> @@ -94,7 +94,7 @@ <tr> <td nowrap>VideoDB language search</td> <td><input type="text" name="languagesql" value="<?=formvar($languagesql)?>"></td> - <td>Empty field will show any language.</td> + <td>Empty field will include any language.</td> </tr> <tr> <td>Show details</td> @@ -124,9 +124,11 @@ function printEpisodes($tomeurl,$titlesql,$subtitlesql,$languagesql,$showext) { - // url contains unique id - if (!stristr($tomeurl, 'http://')) { - print "Need full URL!"; + // some url sanity checks + $r = preg_match('|^http://www.tv.com/.*/episode_listings\.html|i', $tomeurl); + if (!$r) { + print "Need full URL to a tv.com `episode_listings.html' file!"; + return; } // fetch data @@ -383,8 +385,8 @@ $body = $matches[1]; // score - preg_match('|<span[^>]*>(\d\S*)|si', $body, $match); - $episode[score] = $match[1]; + preg_match('|<span[^>]*>(\d[^<]*)|si', $body, $match); + $episode[score] = trim($match[1]); // episode preg_match('|Episode Number: (\d+)|si', $body, $match);

------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________ videodb-devel mailing list videodb-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/videodb-devel