Use python twitter tools.
pip install twitter
Next, register the twitter app at https://apps.twitter.com/. At this time, set the Access level to Read and write. Make the necessary registrations to get the API key, API secret, Access token, and Access token secret.
Execute the following script.
from twitter import *
api_key = "My api key"
api_secret = "My api secret"
access_token = "My access token"
access_token_secret = "My access token secret"
twitter = Twitter(auth=OAuth(access_token, access_token_secret, api_key, api_secret))
text = 'Only multiples of 3 and numbers with 3!!Execute the script to tweet with'
twitter.statuses.update(status=text)
tweet = []
for i in range(1,31):
if i % 3 == 0:
tweet.append(str(i) + '!!')
elif '3' in str(i):
tweet.append(str(i) + '!!')
else:
tweet.append(str(i))
tweet = " ".join(tweet)
twitter.statuses.update(status=tweet)
Recommended Posts