Created
December 4, 2010 07:52
-
-
Save wasabili/728020 to your computer and use it in GitHub Desktop.
asayama_bot
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
# coding: utf-8 | |
import tweepy | |
consumer_key = 'Uvd67rNyTjrPF3Dbq87vw' | |
consumer_sec = 'xzbruHo4mZsPNtQ2U90eHhV2Msf3WNwCS3B2Fzxsw' | |
auth = tweepy.OAuthHandler(consumer_key, consumer_sec) | |
auth.set_access_token('155831769-5LOcoO9aU5U4iP70KSGqVYzvvjhJNfehFjGMK4fZ','hqkoLtBDi3z4q8kwEIjQpVSkZDgpqFPnHHywFZKr4do') | |
api = tweepy.API(auth) | |
quotations = [ | |
u'なんじゃコーリャン', | |
u'キリ↓マン↑ジャロ', | |
u'ギャグちゃいますやん', | |
u'チマ↓チョゴ↑リ', | |
] | |
def unofficial_retweet(tweet, comment): | |
text = tweet.text | |
user = tweet.user.screen_name | |
return u'{0} RT @{1}: {2}'.format(comment, user, text) | |
from random import choice | |
if choice([True,False]): | |
# retweet | |
tweet = api.friends_timeline()[0] | |
com = unofficial_retweet(tweet, choice(quotations)) | |
api.update_status(com) | |
else: | |
# tweet | |
api.update_status(choice(quotations)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment