Skip to content
This repository has been archived by the owner on Sep 10, 2023. It is now read-only.

Commit

Permalink
allows 280 character tweets. closes #50
Browse files Browse the repository at this point in the history
  • Loading branch information
tommeagher committed May 9, 2018
1 parent 862fb5f commit 71192d5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def connect(type='twitter'):
return twitter.Api(consumer_key=MY_CONSUMER_KEY,
consumer_secret=MY_CONSUMER_SECRET,
access_token_key=MY_ACCESS_TOKEN_KEY,
access_token_secret=MY_ACCESS_TOKEN_SECRET)
access_token_secret=MY_ACCESS_TOKEN_SECRET,
tweet_mode='extended')
elif type == 'mastodon':
return Mastodon(client_id=CLIENT_CRED_FILENAME, api_base_url=MASTODON_API_BASE_URL, access_token=USER_ACCESS_FILENAME)
return None
Expand Down Expand Up @@ -102,9 +103,12 @@ def grab_tweets(api, max_id=None):
source_tweets = []
user_tweets = api.GetUserTimeline(screen_name=user, count=200, max_id=max_id, include_rts=True, trim_user=True, exclude_replies=True)
if user_tweets:
max_id = user_tweets[-1].id - 1
max_id = user_tweets[-1].id -
for tweet in user_tweets:
tweet.text = filter_status(tweet.text)
if tweet.full_text:
tweet.text = filter_status(tweet.full_text)
else:
tweet.text = filter_status(tweet.full_text)
if re.search(SOURCE_EXCLUDE, tweet.text):
continue
if tweet.text:
Expand Down

0 comments on commit 71192d5

Please sign in to comment.