basti2342 / retweet-bot

Retweets tweets mentioning your hashtag/search query. Supports Twitter API v1.1.
Mozilla Public License 2.0
127 stars 96 forks source link

Retweets all at once, how to slow it down? #15

Closed ChaseyChaser closed 7 years ago

ChaseyChaser commented 8 years ago

How can I slow down the retweets to once every 15 minutes? Currently it is spamming them out all at once.

basti2342 commented 8 years ago

As a short hack you could just add break in the for-loop after line 45. This way the list of Tweets contains only 1 Tweet each time the script is called. Now call it every 15 minutes via crontab (if you're using something Unix-like) or task scheduler (for Windows).

mikeyny commented 8 years ago

@ChaseyChaser Another hack you could use instead of using break is specifying how many tweet you want on line 40

timelineIterator = tweepy.Cursor(api.search, q=hashtag, since_id=savepoint, lang=tweetLanguage).items(5)
# for five twits
timelineIterator = tweepy.Cursor(api.search, q=hashtag, since_id=savepoint, lang=tweetLanguage).items(25)
# for 25 twits