from feed import get_json
class Imdb(object):
- def __init__(self):
- pass #TODO: cache?
+ def __init__(self, api_key):
+ self.api_key = api_key
+ #TODO: cache?
def get(self, title):
- url = 'http://www.omdbapi.com/?y=&plot=short&r=json&'
- url += urllib.urlencode({'t': title})
+ url = 'http://www.omdbapi.com/?y=&plot=short&r=json&' +\
+ urllib.urlencode({'apikey': self.api_key}) + '&' +\
+ urllib.urlencode({'t': title})
return get_json(url)
self.log.exception('Error initializing internets bing API (%s)' % err)
self.nsp = calc.NumericStringParser()
self.google = google.Google(self.config.get('internets').get('key_google'), self.config.get('internets').get('yt_parse_delay'))
- self.imdb = imdb.Imdb()
+ self.imdb = imdb.Imdb(self.config.get('internets').get('key_imdb'))
self.ipinfo = ipinfo.IpInfo(self.config.get('internets').get('key_ipinfodb'))
self.lastfm = lastfm.LastFm(self.config.get('internets').get('key_lastfm'))
self.quotes = quotes.Quotes(self.config.get('internets').get('key_fml'))