From 966f558853878e6985f0d5f686766be9b4f9e133 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 8 Mar 2012 13:57:11 +0100 Subject: [PATCH] maxVotes --- ox/web/imdb.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ox/web/imdb.py b/ox/web/imdb.py index 1af6c0c..02e407a 100644 --- a/ox/web/imdb.py +++ b/ox/web/imdb.py @@ -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): return ox.cache.readUrlUnicode(url, _readUrl=readUrl, timeout=timeout) - def getUrl(id): return "http://www.imdb.com/title/tt%s/" % id @@ -568,6 +567,11 @@ def getMoviePoster(imdbId): return getMoviePoster(info['series']) return '' +def maxVotes(): + data = ox.cache.readUrl('http://www.imdb.com/chart/top') + votes = int(ox.findRe(data,'([\d,]+)').replace(',', '')) + return votes + def guess(title, director='', timeout=-1): return getMovieId(title, director, timeout=timeout)