Baggio
Baggio

Reputation: 183

Is it possible to schedule a tweet?

Is it possible to schedule a tweet using Tweepy?

I could not find any mention to the datetime, referring to the code I use to create a tweet in tweepy:

api.update_status(tw_post)

If it is not possible, which workaround would you suggest to schedule tweets using python? Thanks

Upvotes: 0

Views: 454

Answers (2)

Aurelio Martinez
Aurelio Martinez

Reputation: 1

You could use the twitter-api-client library, and do something like this:

    account.schedule_tweet(tweet, date)

Upvotes: 0

Matei Piele
Matei Piele

Reputation: 620

You can use datetime to check for the current time:

if (DateTime.Now.Hour == 18)
    api.update_status(tw_post) 

If the hour on your computer is 18, the code will run.

Upvotes: -2

Related Questions