imdb.getUrl
This commit is contained in:
parent
4cfd74b4b9
commit
78d8f8cc0b
1 changed files with 5 additions and 0 deletions
|
@ -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']
|
||||
|
|
Loading…
Reference in a new issue