Created
June 8, 2011 08:19
-
-
Save hj91/1014025 to your computer and use it in GitHub Desktop.
Getting subscriber id for identi.ca and statusnet
This file contains hidden or 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 feedparser,urllib2 | |
#this is my user id..it will be different for you | |
a=urllib2.urlopen("http://identi.ca/api/statusnet/app/subscriptions/32987.atom") | |
b=feedparser.parse(a) | |
c=[] | |
for i in b.entries: | |
print i.title,i.id | |
c.append[i.id] | |
print c | |
after this i get a list in form of | |
. | |
. | |
. | |
. | |
. | |
Goblin http://identi.ca/user/57601 | |
Shapado http://identi.ca/user/77141 | |
Chimo http://identi.ca/user/44586 | |
Jon Spriggs http://jon.sprig.gs/user/1 | |
naw http://identi.ca/user/74514 | |
Shashi Gowda http://identi.ca/user/46323 | |
Tobias Diekershoff http://diekershoff.homeunix.net/statusnet/index.php/user/1 | |
Matt Copperwaite http://identi.ca/user/34067 | |
Cesare Rocchi http://identi.ca/user/9410 | |
Ed Fonseca http://identi.ca/user/7605 | |
. | |
. | |
. | |
. | |
. | |
. | |
Now how do i get link of rss or atom feed for each user ?? i dont want to use regular expressions... | |
Note - the atom feed link for each user(eg Shapado http://identi.ca/user/77141) looks like this - http://identi.ca/api/statuses/user_timeline/77141.atom | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think i will use an old python function split() to break the url and get the uid..
print c
n=c[1].split('/')
print n[4]
And the op is
u'57601'