Commit 3df4ebd9 authored by NoSuck's avatar NoSuck Committed by GitHub

Replace newlines with spaces (as before) (#966)

Keeping the newlines resulted in invalid CSV.

Co-authored-by: Friendly <Hacker>
parent ddb19782
...@@ -51,15 +51,16 @@ def getQuoteURL(tw): ...@@ -51,15 +51,16 @@ def getQuoteURL(tw):
return quote_url return quote_url
# def getText(tw): def getText(tw):
# """Replace some text """Replace some text
# """ """
# logme.debug(__name__ + ':getText') logme.debug(__name__ + ':getText')
# text = tw.find("p", "tweet-text").text text = tw['full_text']
# text = text.replace("http", " http") text = text.replace("http", " http")
# text = text.replace("pic.twitter", " pic.twitter") text = text.replace("pic.twitter", " pic.twitter")
# text = text.replace("\n", " ")
# return text
return text
def getStat(tw, _type): def getStat(tw, _type):
...@@ -209,7 +210,7 @@ def Tweet(tw, config): ...@@ -209,7 +210,7 @@ def Tweet(tw, config):
t.thumbnail = tw['extended_entities']['media'][0]['media_url_https'] t.thumbnail = tw['extended_entities']['media'][0]['media_url_https']
except KeyError: except KeyError:
t.thumbnail = '' t.thumbnail = ''
t.tweet = tw['full_text'] t.tweet = getText(tw)
t.lang = tw['lang'] t.lang = tw['lang']
try: try:
t.hashtags = [hashtag['text'] for hashtag in tw['entities']['hashtags']] t.hashtags = [hashtag['text'] for hashtag in tw['entities']['hashtags']]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment