Commit 47231bac authored by Prabod Rathnayaka's avatar Prabod Rathnayaka

Replace all emoticons with their title, to be included in the tweet text

parent 7a035b11
...@@ -127,6 +127,9 @@ async def outTweet(tweet): ...@@ -127,6 +127,9 @@ async def outTweet(tweet):
# The @ in the username annoys me. # The @ in the username annoys me.
username = tweet.find("span", "username").text.replace("@", "") username = tweet.find("span", "username").text.replace("@", "")
timezone = strftime("%Z", gmtime()) timezone = strftime("%Z", gmtime())
# Replace all emoticons with their title, to be included in the tweet text
for img in tweet.findAll("img", "Emoji Emoji--forText"):
img.replaceWith("<%s>" % img['aria-label'])
# The context of the Tweet compressed into a single line. # The context of the Tweet compressed into a single line.
text = tweet.find("p", "tweet-text").text.replace("\n", "").replace("http", " http").replace("pic.twitter", " pic.twitter") text = tweet.find("p", "tweet-text").text.replace("\n", "").replace("http", " http").replace("pic.twitter", " pic.twitter")
# Regex for gathering hashtags # Regex for gathering 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