Last active
April 3, 2016 16:49
-
-
Save famasoon/cc00aaf02505b8f31717fdb60458536e to your computer and use it in GitHub Desktop.
require tweepy
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 = '' #set consumer key | |
consumer_secret = '' #set consumer secret | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
auth_url = auth.get_authorization_url() | |
print 'Please authorize: ' + auth_url | |
verifier = raw_input('PIN: ').strip() | |
auth.get_access_token(verifier) | |
ACCESS_KEY = auth.access_token | |
ACCESS_SECRET = auth.access_token_secret | |
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET) | |
api = tweepy.API(auth) | |
print 'Hello' + api.me().name | |
request_users = api.friendships_incoming() | |
for target in request_users: | |
print 'block ' + str(target) | |
api.create_block(target) | |
print 'end' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment