Created
September 6, 2010 20:12
-
-
Save psychemedia/567473 to your computer and use it in GitHub Desktop.
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
import tweepy | |
#these are the keys you would normally use with oAuth | |
consumer_key='' | |
consumer_secret='' | |
#these are the special keys for single user apps from http://dev.twitter.com/apps | |
#as described in http://dev.twitter.com/pages/oauth_single_token | |
#select your app, then My Access Token from the sidebar | |
key='' | |
secret='' | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
auth.set_access_token(key, secret) | |
api = tweepy.API(auth) | |
listowner='ousefulapi' | |
tag='solo10' | |
f=open(tag+'listhomepages.xml','w') | |
#the key for your Custom Search Engine | |
cse='' | |
f.write("<GoogleCustomizations>\n\t<Annotations>\n") | |
#for u in lm: | |
# for un in u: | |
for un in tweepy.Cursor(api.list_members,owner=listowner,slug=tag).items(): | |
if type(un) is tweepy.models.User: | |
print un.url, | |
l=un.url | |
if l: | |
l=l.replace("http://","") | |
if not l.endswith('/'): | |
l=l+"/*" | |
else: | |
if l[-1]=="/": | |
l=l+"*" | |
print l | |
f.write("\t\t<Annotation about=\""+l+"\" score=\"1\">\n") | |
f.write("\t\t\t<Label name=\""+cse+"\"/>\n") | |
f.write("\t\t</Annotation>\n") | |
f.write("\t</Annotations>\n</GoogleCustomizations>") | |
print "done" | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment