Python code that keeps tweeting "Bals" as much as you can

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

Python code that keeps tweeting "Bals" as much as you can
python Creating functions that you can remember later
If you know this much, you can write Python test code! ~ Super introductory edition ~
As you may know, Python can be written like this
[Python3] Code that can be used when you want to resize images in folder units
Kalman filter that you can understand
That Python code has no classes ...
Python | What you can do with Python
[Python] Code that can be written with brain death at the beginning when scraping as a beginner
[Python3] Code that can be used when you want to cut out an image in a specific size
[Python3] Code that can be used when you want to change the extension of an image at once
Until you can use opencv with python