wassr ã§ã·ã£ã¤ãªãã®åã¨ãåéã«ãªãæ¹æ³
空åã® wassr ãã¼ã ã§ããã¿ãªãããããããããã§ãããã?
ã¨ããã§ãwassr ã«ã¯ Twitter ã«ç¡ãæ©è½ãè²ã
ããã ãããã§æ¥½ããã§ã¾ã!!
注ç®ã®è¶³è·¡æ©è½
ã§ãã足跡ã¤ãã¦ã¦ãè³¼èªããã¦ãªãã¨åãå¯ããã§ããã?
æ°å¼±ãªåã¯
ãããèå³ãªãã§ãã?ã
ããã®ä¸è¨ãé§ç®ã ã£ãããªãã
ããå£ã«ããã¾ããã§ããã?ã
ãããããã¨ãã·ã£ã¤ã§ç³è«ã§ããªãã£ãã®ããª?ã
ã¨ãèãã¡ããã¾ãï¼ï¼
ã§ãæè§ã ãã仲è¯ããªããã!!
ãããªã·ã£ã¤ãªåã§ãæè§ã¿ã¦ããã£ããã ãã
仲è¯ããªããã!!
ä¸æä¸ä¼ ã ãã!! ã¨æã£ãã Python ã§åºæ¥ã¾ããã
#!/usr/bin/env python # -*- coding: utf-8 -*- import simplejson, urllib2 from pit import Pit print 'start' def getOpener(): config = Pit.get('wassr.jp',{'require' : {'user':'Your wassr name','password':'Your wassr password'}}) passman = urllib2.HTTPPasswordMgrWithDefaultRealm() passman.add_password(None, 'api.wassr.jp', config['user'], config['password']) authhandler = urllib2.HTTPBasicAuthHandler(passman) opener = urllib2.build_opener(authhandler) return opener opener = getOpener() r = opener.open('http://api.wassr.jp/footmark/recent.json') data = simplejson.loads(r.read()) for user in data: login_id = user['login_id'] opener.open('http://api.wassr.jp/friendships/create/%s.json' % (login_id), {}) print 'add '+ login_id print 'end'
Pit 使ã£ã¦ãã®ã§
$ sudo easy_install Pit
ãã¦ãããå©ç¨ãã ããï¼ï¼
ä»è¿ãPit 㧠wassr 使ã£ã¦ãªããã°
ã¦ã¼ã¶ã¼åã¨ãã¹ã¯ã¼ããèããã¾ãã
cron ã§10åã«ä¸åãããã§ã©ãã§ããã?
ã¹ãå¥ã« Pit 使ãããã£ããããããªããã ããã!!