summaryrefslogtreecommitdiff
path: root/twitter-bot
diff options
context:
space:
mode:
Diffstat (limited to 'twitter-bot')
-rwxr-xr-xtwitter-bot10
1 files changed, 8 insertions, 2 deletions
diff --git a/twitter-bot b/twitter-bot
index 6e98576..3513488 100755
--- a/twitter-bot
+++ b/twitter-bot
@@ -154,6 +154,7 @@ api = twitter.Api(
consumer_secret=consumer_secret,
access_token_key=access_token_key,
access_token_secret=access_token_secret,
+ tweet_mode="extended",
)
user = api.VerifyCredentials()
@@ -207,7 +208,7 @@ for status in statuses[::-1][: opts.limit_tweets]:
composed = f"{status.user.name} ({status.user.screen_name})"
url = f"https://twitter.com/{status.user.screen_name}/status/{status.id}"
# This contains all strings that could have caused the tweet to match our query.
- text_to_check = [status.text, status.user.screen_name]
+ text_to_check = [status.full_text, status.user.screen_name]
text_to_check.extend(url.expanded_url for url in status.urls)
text_to_check = [text.lower() for text in text_to_check]
@@ -240,7 +241,12 @@ for status in statuses[::-1][: opts.limit_tweets]:
elif opts.twitter_name:
subject = composed
- message = {"type": "stream", "to": [opts.stream], "subject": subject, "content": url}
+ message = {
+ "type": "stream",
+ "to": [opts.stream],
+ "subject": subject,
+ "content": f"{status.full_text}\n{status.created_at}\n{url}",
+ }
if opts.dry_run:
print(message)