imdb.getUrl

This commit is contained in:
j 2011-10-30 13:31:19 +01:00
parent 4cfd74b4b9
commit 78d8f8cc0b

View file

@ -15,6 +15,7 @@ import ox.cache
from siteparser import SiteParser
import google
def readUrl(url, data=None, headers=ox.cache.DEFAULT_HEADERS, timeout=ox.cache.cache_timeout, valid=None):
headers = headers.copy()
return ox.cache.readUrl(url, data, headers, timeout)
@ -22,6 +23,10 @@ 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
class Imdb(SiteParser):
'''
>>> Imdb('0068646')['title']