better impawards module

This commit is contained in:
Rolux 2008-05-09 13:54:41 +02:00
parent 8e9d0e8304
commit 2fe6a9e989

View file

@ -38,7 +38,21 @@ def parseArchivePage(html):
def parseMoviePage(html):
data = {}
data['imdbId'] = findRe(html, 'imdb.com/title/tt(.*?) ')
data['posterUrl'] = 'http://impawards.com/%s' % findRe(html, '<td align=center><br><img SRC="(.*?)"')
data['title'] = findRe(html, '<font size=\+3>(.*?) \(')
data['year'] = findRe(html, '\(<a href="eligible.html">(.*?)</a>\)')
result = findRe(html, '<a href = (\w*?_xlg.html) target= _blank>')
if result:
url = 'http://impawards.com/%s/%s' % (data['year'], result)
html = getUrlUnicode(url, timeout = -1)
d = parsePosterPage(html, data['year'])
data['posterUrl'] = d['posterUrl']
else:
data['posterUrl'] = 'http://impawards.com/%s/%s' % (data['year'], findRe(html, '<td align=center><br><img SRC="(.*?)"'))
return data
def parsePosterPage(html, year):
data = {}
data['posterUrl'] = 'http://impawards.com/%s/%s' % (year, findRe(html, '<img SRC="(.*?)"'))
return data
if __name__ == '__main__':