Last active
March 31, 2016 01:22
-
-
Save MarkEEaton/044d27f9abb3ce56af63 to your computer and use it in GitHub Desktop.
Bot Day: Script 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Original script (kept up to date): https://github.com/robincamille/bot-tutorial/blob/master/mybot.py | |
# Twitter Bot Starter Kit: Bot 1 | |
# This bot tweets three times, waiting 15 seconds between tweets. | |
# If you haven't changed credentials.py yet with your own Twitter | |
# account settings, this script will tweet at twitter.com/lacunybot | |
# Housekeeping: do not edit | |
import tweepy, time | |
from credentials import * | |
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) | |
auth.set_access_token(ACCESS_TOKEN, ACCESS_SECRET) | |
api = tweepy.API(auth) | |
# What the bot will tweet | |
tweetlist = ['Test tweet one!', 'Test tweet two!', 'Test tweet three!'] | |
for line in tweetlist: | |
api.update_status(line) | |
print line | |
print '...' | |
time.sleep(15) # Sleep for 15 seconds | |
print "All done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment