Skip to content

Instantly share code, notes, and snippets.

@Momijinn
Last active December 4, 2015 03:44
Show Gist options
  • Save Momijinn/0a4e903aee710f74445a to your computer and use it in GitHub Desktop.
Save Momijinn/0a4e903aee710f74445a to your computer and use it in GitHub Desktop.
pythonでTwitter自動フォロー
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Create date: 2015/10/11
implementafor: K.Takano
HP: http://miyakawamomiji.blogspot.jp/
'''
from twitter import *
def Initialize():
#あなたのツイッターIDを記入
your_twitter_id = "@Your_twitterID" #(ex)"momijinn_aka"
#OAuth ToolからもらえるKeyなどを入力
consumerKey = "Consumer key"
consumerSecret = "Consumer secret"
accessToken = "Access token"
accessSecret = "Access token secret"
return Twitter(auth=OAuth(accessToken, accessSecret, consumerKey, consumerSecret)),your_twitter_id
pass
def main(tw, your_id):
followers = tw.followers.list(screen_name=your_id, count=200)
for fw in followers['users']:
name = fw['screen_name']
if fw['following']:
pass
else:
tw.friendships.create(screen_name=name)
pass
pass
pass
if __name__ == '__main__':
tw,your_id = Initialize()
main(tw, your_id)
@Momijinn
Copy link
Author

Python3でTwitter自動フォロー
Twitter Auto Follow us on Python3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment