mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 19:28:09 -06:00
Render tweets for invisible interface from template specified in config
This commit is contained in:
parent
a47fa31346
commit
af4594f16c
@ -19,7 +19,7 @@ import languageHandler
|
|||||||
import logging
|
import logging
|
||||||
from audio_services import youtube_utils
|
from audio_services import youtube_utils
|
||||||
from controller.buffers.base import base
|
from controller.buffers.base import base
|
||||||
from sessions.twitter import compose, utils, reduce
|
from sessions.twitter import compose, utils, reduce, templates
|
||||||
from mysc.thread_utils import call_threaded
|
from mysc.thread_utils import call_threaded
|
||||||
from tweepy.errors import TweepyException
|
from tweepy.errors import TweepyException
|
||||||
from tweepy.cursor import Cursor
|
from tweepy.cursor import Cursor
|
||||||
@ -100,8 +100,10 @@ class BaseBuffer(base.Buffer):
|
|||||||
return self.get_message()
|
return self.get_message()
|
||||||
|
|
||||||
def get_message(self):
|
def get_message(self):
|
||||||
|
template = self.session.settings["templates"]["tweet"]
|
||||||
tweet = self.get_right_tweet()
|
tweet = self.get_right_tweet()
|
||||||
return " ".join(self.compose_function(tweet, self.session.db, self.session.settings["general"]["relative_times"], self.session.settings["general"]["show_screen_names"], self.session))
|
t = templates.render_tweet(tweet, template, self.session, relative_times=self.session.settings["general"]["relative_times"], offset_seconds=self.session.db["utc_offset"])
|
||||||
|
return t
|
||||||
|
|
||||||
def get_full_tweet(self):
|
def get_full_tweet(self):
|
||||||
tweet = self.get_right_tweet()
|
tweet = self.get_right_tweet()
|
||||||
|
Loading…
Reference in New Issue
Block a user