Exemplo n.º 1
0
def getImdbRentals():
	entries = getImdbRentalsList()
	for entry in entries:
		link_number,title,year = entry
		common.createMovieListItemfromimdbid(link_number,len(entries))
	common.endofDir()
        return 
def getpopular(url):

	d = feedparser.parse( url )
	mylist= list()
	html = d.entries[0]['content'][0]['value'].replace('\n','')
	entries = re.findall(r'<a href="http://www.imdb.com/title/tt(\d{7})/">',html)
	for entry in entries:
		imdbid = entry
		common.createMovieListItemfromimdbid(imdbid,len(entries))
	common.endofDir()
        return
Exemplo n.º 3
0
def getpopular(url):

    d = feedparser.parse(url)
    mylist = list()
    html = d.entries[0]['content'][0]['value'].replace('\n', '')
    entries = re.findall(r'<a href="http://www.imdb.com/title/tt(\d{7})/">',
                         html)
    for entry in entries:
        imdbid = entry
        common.createMovieListItemfromimdbid(imdbid, len(entries))
    common.endofDir()
    return
Exemplo n.º 4
0
def showMovies(movies):
	for movie in movies:
		try:
			imdbid = movie['alternate_ids']['imdb']
		except:
			imdbid = None
		if imdbid:
			rating = '[ ' + str(movie['ratings']['critics_rating']) + ' ' + str(movie['ratings']['critics_score']) + '%] '
			common.createMovieListItemfromimdbid(imdbid,totalItems = len(movies),extrainfo = rating + '{0} ({1})')
		else:
			movietitle = movie['title']
			movieyear = movie['year']
			rating = '[ ' + str(movie['ratings']['critics_rating']) + ' ' + str(movie['ratings']['critics_score']) + '%] '
			common.createMovieListItemTrakt(None,movietitle,movieyear,totalItems = len(movies), extrainfo = rating + '{0} ({1})')
	common.endofDir()
Exemplo n.º 5
0
def getImdbtop250(page):

        response = urllib2.urlopen('http://www.imdb.com/chart/top')
	html = response.read()
	entries = re.findall(r'<tr bgcolor="#(?:e5e5e5|ffffff)" valign="top"><td align="right"><font face="Arial, Helvetica, sans-serif" size="-1"><b>(\d{1,3})\.</b></font></td><td align="center"><font face="Arial, Helvetica, sans-serif" size="-1">(\d\.\d)</font></td><td><font face="Arial, Helvetica, sans-serif" size="-1"><a href="/title/tt(\d{7})/">([^<]+)</a> \((\d{4})\)</font></td><td align="right"><font face="Arial, Helvetica, sans-serif" size="-1">(\d{1,3}(?:,\d{3})*)</font></td></tr>', html)
	page = int(page)
	first = page-1
	pagesize = 25
        for entry in entries[first*pagesize:page*pagesize]:
		number, score, link_number, title, year, votes = entry
		s= '#{0}: {1} r:{2}'.format(number,'{0}',score)
		common.createMovieListItemfromimdbid(link_number,pagesize,s)
	url = sys.argv[0]+'?action=imdbTop250&page=' + str(page+1)
	if page*pagesize < 250:
		common.createListItem('Next ' + str(pagesize),True, url )
	common.endofDir()
        return