def get_home(self): """ Gets the home stream, that manages home timeline, mentions, direct messages and sent.""" try: self.stream = twitter.buffers.stream.streamer(application.app_key, application.app_secret, config.main["twitter"]["user_key"], config.main["twitter"]["user_secret"], parent=self) stream_threaded(self.stream.user) except: self.stream.disconnect()
def get_timelines(self): log.debug("Starting the timelines stream...") self.timelinesStream = twitter.buffers.indibidual.timelinesStreamer(keyring.get("api_key"), keyring.get("api_secret"), self.settings["twitter"]["user_key"], self.settings["twitter"]["user_secret"], session=self) ids = "" for i in self.settings["other_buffers"]["timelines"]: ids = ids + "%s, " % (self.db[i+"-timeline"][0]["user"]["id_str"]) for i in self.lists: for z in i.users: ids += str(z) + ", " if ids != "": stream_threaded(self.timelinesStream.statuses.filter, self.session_id, follow=ids)
def get_timelines(self): log.debug("Starting the timelines stream...") self.timelinesStream = twitter.buffers.indibidual.timelinesStreamer(keyring.get("api_key"), keyring.get("api_secret"), self.settings["twitter"]["user_key"], self.settings["twitter"]["user_secret"], session=self) ids = "" for i in self.settings["other_buffers"]["timelines"]: ids = ids + "%s, " % (self.db[i+"-timeline"][0]["user"]["id_str"]) for i in self.lists: for z in i.users: ids += str(z) + ", " if ids != "": # print ids stream_threaded(self.timelinesStream.statuses.filter, self.session_id, follow=ids)
def get_tls(self): """ Setting the stream for individual user timelines.""" # try: self.stream2 = twitter.buffers.indibidual.streamer(application.app_key, application.app_secret, config.main["twitter"]["user_key"], config.main["twitter"]["user_secret"], parent=self) # The self.ids contains all IDS for the follow argument of the stream. ids = "" # If we have more than 0 items on a list, then. for i in config.main["other_buffers"]["timelines"]: ids = ids+self.db.settings[i][0]["user"]["id_str"]+", " for i in range(0, self.nb.GetPageCount()): if self.nb.GetPage(i).type == "list": for z in self.nb.GetPage(i).users: ids+= str(z)+", " if ids != "": # try: stream_threaded(self.stream2.statuses.filter, follow=ids)
def get_main_stream(self): log.debug("Starting the main stream...") self.main_stream = twitter.buffers.stream.streamer(keyring.get("api_key"), keyring.get("api_secret"), self.settings["twitter"]["user_key"], self.settings["twitter"]["user_secret"], self) stream_threaded(self.main_stream.user, self.session_id)
def get_main_stream(self): log.debug("Starting the main stream...") self.main_stream = twitter.buffers.stream.streamer(keyring.get("api_key"), keyring.get("api_secret"), self.settings["twitter"]["user_key"], self.settings["twitter"]["user_secret"], self) stream_threaded(self.main_stream.user, self.session_id)