This commit is contained in:
j 2012-03-08 13:57:11 +01:00
parent b76bb80577
commit 966f558853

View file

@ -23,7 +23,6 @@ def readUrl(url, data=None, headers=ox.cache.DEFAULT_HEADERS, timeout=ox.cache.c
def readUrlUnicode(url, timeout=ox.cache.cache_timeout): def readUrlUnicode(url, timeout=ox.cache.cache_timeout):
return ox.cache.readUrlUnicode(url, _readUrl=readUrl, timeout=timeout) return ox.cache.readUrlUnicode(url, _readUrl=readUrl, timeout=timeout)
def getUrl(id): def getUrl(id):
return "http://www.imdb.com/title/tt%s/" % id return "http://www.imdb.com/title/tt%s/" % id
@ -568,6 +567,11 @@ def getMoviePoster(imdbId):
return getMoviePoster(info['series']) return getMoviePoster(info['series'])
return '' return ''
def maxVotes():
data = ox.cache.readUrl('http://www.imdb.com/chart/top')
votes = int(ox.findRe(data,'<td align="right"><font face="Arial, Helvetica, sans-serif" size="-1">([\d,]+)</font></td></tr>').replace(',', ''))
return votes
def guess(title, director='', timeout=-1): def guess(title, director='', timeout=-1):
return getMovieId(title, director, timeout=timeout) return getMovieId(title, director, timeout=timeout)