Migrated support to Trending Topics

This commit is contained in:
Manuel Cortez 2021-01-20 09:59:38 -06:00
parent cdc285e362
commit 52154ac271
2 changed files with 4 additions and 6 deletions

View File

@ -1134,9 +1134,9 @@ class trendsBufferController(baseBuffers.buffer):
if self.execution_time == 0 or current_time-self.execution_time >= 180 or mandatory == True:
self.execution_time = current_time
try:
data = self.session.call_paged("get_place_trends", id=self.trendsFor)
except:
return
data = self.session.twitter.trends_place(id=self.trendsFor)
except TweepError as err:
log.error("Error %s: %s" % (err.api_code, err.reason))
if not hasattr(self, "name_"):
self.name_ = data[0]["locations"][0]["name"]
self.trends = data[0]["trends"]

View File

@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from builtins import object
from wxUI.dialogs import trends
import widgetUtils
@ -10,7 +8,7 @@ class trendingTopicsController(object):
self.countries = {}
self.cities = {}
self.dialog = trends.trendingTopicsDialog()
self.information = session.twitter.get_available_trends()
self.information = session.twitter.trends_available()
self.split_information()
widgetUtils.connect_event(self.dialog.country, widgetUtils.RADIOBUTTON, self.get_places)
widgetUtils.connect_event(self.dialog.city, widgetUtils.RADIOBUTTON, self.get_places)