From 52154ac271f7221ce2e91a80be99e6a918af99e5 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Wed, 20 Jan 2021 09:59:38 -0600 Subject: [PATCH] Migrated support to Trending Topics --- src/controller/buffers/twitterBuffers.py | 6 +++--- src/controller/trendingTopics.py | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/controller/buffers/twitterBuffers.py b/src/controller/buffers/twitterBuffers.py index 10532030..fb07cb2e 100644 --- a/src/controller/buffers/twitterBuffers.py +++ b/src/controller/buffers/twitterBuffers.py @@ -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"] diff --git a/src/controller/trendingTopics.py b/src/controller/trendingTopics.py index 4982c7d7..5b6bd270 100644 --- a/src/controller/trendingTopics.py +++ b/src/controller/trendingTopics.py @@ -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)