useopc / tylerhall

Automatically exported from code.google.com/p/tylerhall
0 stars 0 forks source link

Poster regex is broken #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
'|<a
name="poster"[\w\W\d\D\s\S]*src="(http://ia.media-imdb.com/images[\w\W\d\D]*)"
/></a>|U'

That is a working replacement :)
good luck

Original issue reported on code.google.com by k.schasf...@gmail.com on 22 May 2009 at 9:09

GoogleCodeExporter commented 9 years ago
Fixed. Thanks!

Original comment by tylerh...@gmail.com on 24 May 2009 at 8:53

GoogleCodeExporter commented 9 years ago
And I have made a better alternative:
[code]
        /*get poster info*/
        $p_url = "http://www.google.com/search?hl=en&q=themoviedb+" . urlencode($str) .
"&btnI=I%27m+Feeling+Lucky";
        $p_html = $this->geturl($p_url);
        $p_html = $this->geturl($this->match('|<a
href="(http://www.themoviedb.org/[\W\w\d\D\S]*)"|U', $p_html, 1));
        $poster = $this->match('|<a href=".*" target="_blank" title=".*"><img
src="(/image/posters/.*)" width=".*" height=".*" /></a>|U', $p_html, 1);
        if(!empty($poster)) $arr['poster'] = 'http://www.themoviedb.org'.$poster; [/code]
Maybe you could make it better. Because, when I uses google to search en use 
"I'm
Feeling Luck", nothing happens when I search for something with 
"themoviedb.org" in it :S

The posters from themoviedb are much bigger and do match better.
Not al the posters could be find on TMDb, so you still have to keep the one 
from IMDb ;)

Original comment by k.schasf...@gmail.com on 24 May 2009 at 10:34