コード例 #1
0
ファイル: embed_static.py プロジェクト: ikram6/twitgraph
 def get(self):
   fetcher = TwitterFetcher()
   all_results = fetcher.fetch_results(self.get_q(), self.get_start(), self.get_end())
   if all_results is None:
     self.redirect('/s/img/ouch.png')
   else:
     analyzer = TweetsAnalyzer()
     stats, aggregate_results = analyzer.aggregate(all_results)
   url_params = self.build_charts_url_params(aggregate_results)
   url = '%s?%s' % (self.CHARTS_URL, url_params)
   self.redirect(url)
コード例 #2
0
ファイル: embed_static.py プロジェクト: vivek136/twitgraph
 def get(self):
     fetcher = TwitterFetcher()
     all_results = fetcher.fetch_results(self.get_q(), self.get_start(),
                                         self.get_end())
     if all_results is None:
         self.redirect('/s/img/ouch.png')
     else:
         analyzer = TweetsAnalyzer()
         stats, aggregate_results = analyzer.aggregate(all_results)
     url_params = self.build_charts_url_params(aggregate_results)
     url = '%s?%s' % (self.CHARTS_URL, url_params)
     self.redirect(url)
コード例 #3
0
ファイル: results.py プロジェクト: ikram6/twitgraph
 def get(self):
   template_values = self.get_template_values()
   fetcher = TwitterFetcher()
   all_results = fetcher.fetch_results(self.get_q(), self.get_start(), self.get_end())
   ret = {}
   if all_results is None:
     status = 500
   else:
     status = 200
     analyzer = TweetsAnalyzer()
     classified_results = analyzer.classify(all_results)
     stats, aggregate_results = analyzer.aggregate(classified_results)
     ret = {"stats": stats, "aggregate": aggregate_results}
     if self.get_show_text():
       ret['results'] = classified_results
   ret['status'] = status;
   self.spit_json(ret)
コード例 #4
0
 def get(self):
     template_values = self.get_template_values()
     fetcher = TwitterFetcher()
     all_results = fetcher.fetch_results(self.get_q(), self.get_start(),
                                         self.get_end())
     ret = {}
     if all_results is None:
         status = 500
     else:
         status = 200
         analyzer = TweetsAnalyzer()
         classified_results = analyzer.classify(all_results)
         stats, aggregate_results = analyzer.aggregate(classified_results)
         ret = {"stats": stats, "aggregate": aggregate_results}
         if self.get_show_text():
             ret['results'] = classified_results
     ret['status'] = status
     self.spit_json(ret)