Posted By

tamuratetsuya on 03/17/09


Tagged

google python engine app django


Versions (?)

twitterで自分のfollowerを取得


 / Published in: Python
 

  1. def getFollowers():
  2. #url作成
  3. followers=[]
  4. url = 'http://twitter.com/statuses/followers.xml'
  5. print >>sys.stderr,url
  6. base64string =b64encode("%s:%s" % (username, password))
  7. headers = {"Authorization": "Basic %s" % base64string}
  8. xml_result=urlfetch.fetch(url, payload='', method=urlfetch.POST, headers=headers).content
  9. for soup in BeautifulSoup(xml_result)('screen_name'):
  10. #print >>sys.stderr,soup(text = True)[0]
  11. followers.append(soup(text = True)[0])
  12. return followers

Report this snippet  

You need to login to post a comment.