The Friday Road Show on the treetop is an annual bals festival, so I created a python code to tweet the bals. The limit of twitter API is 180 times for 15 minutes, so When the program is executed, it keeps muttering "Bals" as long as the limit is reached. At the last 180th time, Muska shouts!
Let's enjoy Laputa, the castle in the sky!
tweetBalse.py
# coding=utf-8
import time
import tweepy
consumer_key = '****'
consumer_secret = '****'
access_key = '****'
access_secret = '****'
comment = 'Barth'
last_comment = 'Eyes, eyes ~~~~~~~~~!!!!!!! '
exclamation = '!'
counter = 179
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
# set access token to OAuth handler
auth.set_access_token(access_key, access_secret)
# create API
api = tweepy.API(auth_handler=auth)
for var in range(counter):
api.update_status(comment)
if len(comment) >= 140:
comment = 'Barth'
comment+=exclamation
print comment
time.sleep(0.1)
api.update_status(last_comment)
print last_comment
Recommended Posts