Add box office top10 to IMDB automation. closes #2427

This commit is contained in:
Ruud
2013-11-05 22:45:25 +01:00
parent e119020016
commit 5c64ba3c9e
2 changed files with 19 additions and 1 deletions

View File

@@ -55,7 +55,14 @@ config = [{
'label': 'TOP 250',
'description': 'IMDB <a href="http://www.imdb.com/chart/top/">TOP 250</a> chart',
'default': True,
},
},
{
'name': 'automation_charts_boxoffice',
'type': 'bool',
'label': 'Box offce TOP 10',
'description': 'IMDB Box office <a href="http://www.imdb.com/chart/">TOP 10</a> chart',
'default': True,
},
],
},
],

View File

@@ -70,8 +70,11 @@ class IMDBAutomation(IMDBBase):
chart_urls = {
'theater': 'http://www.imdb.com/movies-in-theaters/',
'top250': 'http://www.imdb.com/chart/top',
'boxoffice': 'http://www.imdb.com/chart/',
}
first_table = ['boxoffice']
def getIMDBids(self):
movies = []
@@ -84,6 +87,14 @@ class IMDBAutomation(IMDBBase):
try:
result_div = html.find('div', attrs = {'id': 'main'})
try:
if url in self.first_table:
table = result_div.find('table')
result_div = table if table else result_div
except:
pass
imdb_ids = getImdb(str(result_div), multiple = True)
for imdb_id in imdb_ids: