mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-01-19 00:40:42 -06:00
Added basic tweet rendering
This commit is contained in:
parent
bcd51d6259
commit
d0cc12ef5c
@ -39,7 +39,7 @@ chars = "abcdefghijklmnopqrstuvwxyz"
|
|||||||
def compose_tweet(tweet, db, relative_times, show_screen_names=False, session=None):
|
def compose_tweet(tweet, db, relative_times, show_screen_names=False, session=None):
|
||||||
""" It receives a tweet and returns a list with the user, text for the tweet or message, date and the client where user is."""
|
""" It receives a tweet and returns a list with the user, text for the tweet or message, date and the client where user is."""
|
||||||
if system == "Windows":
|
if system == "Windows":
|
||||||
original_date = arrow.get(tweet.created_at, "ddd MMM DD H:m:s Z YYYY", locale="en")
|
original_date = arrow.get(tweet.created_at, locale="en")
|
||||||
if relative_times == True:
|
if relative_times == True:
|
||||||
ts = original_date.humanize(locale=languageHandler.curLang[:2])
|
ts = original_date.humanize(locale=languageHandler.curLang[:2])
|
||||||
else:
|
else:
|
||||||
@ -138,7 +138,7 @@ def compose_quoted_tweet(quoted_tweet, original_tweet, show_screen_names=False,
|
|||||||
original_text = StripChars(original_tweet.text)
|
original_text = StripChars(original_tweet.text)
|
||||||
quoted_tweet.message = _(u"{0}. Quoted tweet from @{1}: {2}").format( text, original_user, original_text)
|
quoted_tweet.message = _(u"{0}. Quoted tweet from @{1}: {2}").format( text, original_user, original_text)
|
||||||
quoted_tweet = tweets.clear_url(quoted_tweet)
|
quoted_tweet = tweets.clear_url(quoted_tweet)
|
||||||
quoted_tweet.entities.urls.extend(original_tweet.entities.urls)
|
quoted_tweet.entities["urls"].extend(original_tweet.entities["urls"])
|
||||||
return quoted_tweet
|
return quoted_tweet
|
||||||
|
|
||||||
def compose_followers_list(tweet, db, relative_times=True, show_screen_names=False, session=None):
|
def compose_followers_list(tweet, db, relative_times=True, show_screen_names=False, session=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user