script done

This commit is contained in:
arnaucode
2017-10-04 10:32:05 +02:00
parent 240089a03e
commit 4648c65336
3 changed files with 33 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*.pyc
twitterConfig.py

13
getTwitterListMembers.py Normal file
View File

@@ -0,0 +1,13 @@
# coding=utf-8
import tweepy
import twitterConfig
# READ 'twitterConfigEXAMPLE.py' FOR THE CONFIGURATION INSTRUCTIONS
auth = tweepy.OAuthHandler(twitterConfig.consumer_key, twitterConfig.consumer_secret)
auth.set_access_token(twitterConfig.access_token_key, twitterConfig.access_token_secret)
api = tweepy.API(auth)
for member in tweepy.Cursor(api.list_members, twitterConfig.list_owner, twitterConfig.list_name).items():
print member.screen_name + ',' + twitterConfig.list_owner

18
twitterConfigEXAMPLE.py Normal file
View File

@@ -0,0 +1,18 @@
# coding=utf-8
# INSTRUCTIONS
# -FIRST: copy this file and rename it to: 'twitterConfig.py'
# -SECOND: put the twitter app keys
# -THIRD: put the list_owner and list_name
# example: https://twitter.com/userexample/lists/listnameexample/members
# list_owner='userexample'
# list_name='listnameexample'
# Here the twitter app keys
consumer_key="xxxxx"
consumer_secret="xxxxx"
access_token_key="xxxxx"
access_token_secret="xxxxx"
list_owner='userOwnerOfTheList'
list_name='listName'