diff --git a/README.md b/README.md index 99aa940..97e1964 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Did you know about the available IMDb.com API? The price to use it is around $15 --- -**If you want to thank me for my work and the support, feel free to do this through PayPal (use mail@fabian-beiner.de as payment destination) or just buy me a book at [Amazon](http://www.amazon.de/registry/wishlist/8840JITISN9L) – thank you! :-)** +**If you want to thank me for my work and the support, feel free to buy me a book or something at [Amazon](http://www.amazon.de/registry/wishlist/8840JITISN9L) – thank you! :-)** ## License @@ -20,6 +20,11 @@ Since version 5.5.0 the script is licensed under [CC BY-NC-SA 3.0](http://creati ## Changes +5.5.20 +- Updated lots of the IMDB_* constants. *(Thanks to bla0r)* +- Fixed Runtime (issue #46). +- Improved the regular expressions. + 5.5.19 - Fixed IMDB_FULL_CAST and IMDB_YEAR. - getSitesAsUrl() only returns a link, if the url starts with "http". diff --git a/imdb.class.php b/imdb.class.php index 781b0f6..b44294e 100644 --- a/imdb.class.php +++ b/imdb.class.php @@ -48,9 +48,9 @@ class IMDB { const IMDB_AKA = '~Also Known As:(.*) (.*)~Ui'; + const IMDB_CAST = '~itemprop="actor"(?:.*)>(?:\s*)(.*)~Ui'; const IMDB_FULL_CAST = '~(.*?)~Ui'; - const IMDB_CHAR = '~\s+
(.*)
\s+(.*)
~Ui'; const IMDB_COMPANY = '~Production Co:(.*)~Ui'; const IMDB_COMPANY_NAME = '~href="/company/co(\d+)(?:\?.*)"(?:\s*)itemprop=\'url\'>(.*)~Ui'; @@ -58,32 +58,32 @@ class IMDB { const IMDB_CREATOR = '~(?:Creator|Creators):(.*)~Ui'; const IMDB_DESCRIPTION = '~

(.*)(?:)~Ui'; const IMDB_DIRECTOR = '~(?:Director|Directors):(.*)~Ui'; - const IMDB_GENRE = '~href="/genre/(.*)(?:\?.*)"(?:\s+|)>(.*)~Ui'; + const IMDB_GENRE = '~href="/genre/(.*)(?:\?.*)"(?:\s*)>(.*)~Ui'; const IMDB_ID = '~(tt\d{6,})~'; const IMDB_LANGUAGES = '~href="/language/(.*)(?:\?.*)"(?:\s*)itemprop=\'url\'>(.*)~Ui'; const IMDB_LOCATION = '~href="/search/title\?locations=(.*)(?:&.*)"itemprop=\'url\'>(.*)~Ui'; const IMDB_MPAA = '~span itemprop="contentRating"(?:.*)>(.*)(.*)~Ui'; const IMDB_OPENING = '~Opening Weekend:(.*)\(~Ui'; - const IMDB_PLOT = '~Storyline\s+

\s+

(.*)(?:|<\/div>)~Ui'; + const IMDB_PLOT = '~Storyline(?:\s*)

(?:\s*)

(.*)(?:|<\/div>)~Ui'; const IMDB_POSTER = '~"src="(.*)"itemprop="image" \/>~Ui'; const IMDB_RATING = '~(.*)~Ui'; - const IMDB_REDIRECT = '~Location:\s(.*)~'; + const IMDB_REDIRECT = '~Location:(?:\s*)(.*)~'; const IMDB_RELEASE_DATE = '~Release Date:(.*)(?:)~Ui'; - const IMDB_RUNTIME = '~Runtime:\s+~Uis'; - const IMDB_SEARCH = '~ (.*)<\/a>~Uis'; - const IMDB_SEASONS = '~Season:\s+(.*)\s+

~Ui'; + const IMDB_RUNTIME = '~~Uis'; + const IMDB_SEARCH = '~ (.*)<\/a>~Uis'; + const IMDB_SEASONS = '~Season:(?:\s*)(.*)(?:\s*)
~Ui'; const IMDB_SITES = '~Official Sites:(.*)(?:(.*)~Ui'; const IMDB_SOUND_MIX = '~Sound Mix:(.*)~Ui'; const IMDB_SOUND_MIX_A = '~href="/search/title\?sound_mixes=(?:.*)"(?:\s*)itemprop=\'url\'>(.*)~Ui'; const IMDB_TAGLINE = '~Taglines:(.*)(?:|)~Ui'; const IMDB_TITLE = '~property=\'og:title\' content="(.*) \((?:.*)\)"~Ui'; - const IMDB_TITLE_ORIG = '~(.*)\(original title\)<\/i>\s+~Ui'; + const IMDB_TITLE_ORIG = '~(.*)\(original title\)<\/i>(?:\s*)~Ui'; const IMDB_TRAILER = '~href="/video/(.*)/(?:\?.*)"(?:.*)itemprop="trailer">~Ui'; const IMDB_URL = '~http://(?:.*\.|.*)imdb.com/(?:t|T)itle(?:\?|/)(..\d+)~i'; const IMDB_VOTES = '~(.*)~Ui'; - const IMDB_YEAR = '~

(?:\s+)(?:.*)(?:\s+)\((.*)\)~Ui'; + const IMDB_YEAR = '~

(?:\s*)(?:.*)(?:\s*)\((.*)\)~Ui'; const IMDB_WRITER = '~(?:Writer|Writers):

(.*)~Ui'; // cURL cookie file.