Пример #1
0
 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
 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
 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)