コード例 #1
0
ファイル: flixster.py プロジェクト: mrowl/filmdata
 def _dump(self, type='ids'):
     if type == 'ids':
         log.info('dumping ids to %s' % config.flixster.titles_path)
         json.dump(list(self.known_ids),
                   open(config.flixster.title_ids_path, 'w'))
     elif type == 'reviews':
         log.info('dumping reviews to %s' %
                  config.flixster.title_reviews_path)
         dson.dump(dict([ (i['id'], i) for i in
                          self._get_fetched_info('reviews') ]),
                   config.flixster.titles_path)
     else:
         log.info('dumping titles to %s' % config.flixster.titles_path)
         dson.dump(dict([ (i['id'], i) for i in
                          self._get_fetched_info('title') ]),
                   config.flixster.titles_path)
     log.info('dump complete')
コード例 #2
0
ファイル: netflix.py プロジェクト: mrowl/filmdata
 def _scrape_response(cls):
     log.info('Done scraping! Dumping now...')
     votes = {}
     for data in filmdata.sink.get_source_data('netflix', 'title'):
         votes[data['id']] = data['votes']
     dson.dump(votes, config.netflix.votes_path)
コード例 #3
0
ファイル: imdb.py プロジェクト: mrowl/filmdata
 def _scrape_response(cls, type='title'):
     log.info('Done scraping! Dumping now...')
     dson.dump(cls._get_known_ids(type), config.imdb['%s_ids_path' % type])