Skip to content

Instantly share code, notes, and snippets.

@inoshiro
Created January 21, 2012 08:11
Show Gist options
  • Save inoshiro/1651991 to your computer and use it in GitHub Desktop.
Save inoshiro/1651991 to your computer and use it in GitHub Desktop.
create twitter list from connpass event
>>> import from_connpass
>>> content = from_connpass.getContent("http://connpass.com/event/213/")
>>> users = from_connpass.getidlist(content)
OUT: get id: tmae
OUT: get id: noguchi616
OUT: get id: th0x0472
# 長いので省略
OUT: get id: utsuidai
OUT: get id: n0ts
OUT: get id: matetsu
>>> users
OUT: [u'tmae', u'noguchi616', u'th0x0472', u'yut148', u'dz_', u'hansode', u'sorakuma34', u'haru860', '', u'tagomoris', u'fujya', u'neotsutchie', u'nullpopopo', u'penguinJr1', u'richardx64', u'ttkzw', u'aoki_d', u'jbking', u'soestudio', u'sugyan', u's_miyaza', u'nslope', u'image_', u'you_tomita', u'hebikuzure', u'drillbits', u'k_ishikawa', u'ymotongpoo', u'MiCHiLU', u'kashew_nuts', u'do_aki', u'horiken1216', u'harutama', u'd_Joker', u'Wslash', u'hekyou', u'naoki_kurosawa', u'ishikawa84g', '', u'takuan_osho', u'hagaeru3sei', u'KeME_S', u'usaturn', u'riywo', u'kotakanbe', u'itchycoo_park', u'kamipo', u'wenbose', u'hattara_tw', u'hirose31', u'IanMLewis', u'ikasamt', u'hafoc', u'nekoruri', u'urasoko', u'torufurukawa', u'kazeburo', u'poohtarou', u'xaicron', u'RisucoMorino', u'hasegaw', u'kwy8791', u'kiwamuk', '', u'shu_san', u'den_debiantokyo', u'think_t2', u'fujisaki_hb', u'inoshiro', u'shidocchi', u'iketa93', '', u'hajime_nakagami', u'mizoken001', u'jhotta', u'tell_k', u'udaotoko', u'ryoaita', u'd_endle', u'ichigotake', u'nixie_san', u'kenjiskywalker', u'nntsugu', u'feiz', u'yamada746', u'semind', u'tomofusa', u'kazyk', '', u'kurototoro', u'akisutesama', u'shin_no_suke', u'sechiro', u'_nao8', u'bellche', u'kzsmz', u'ar1', u'yktko', u'Jumo_211', u'shin1ogawa', u'petach', u'su_aska', u'sho7650', u'anri_c', '', u'fujiwara', u'H_Shinonome', u'p41c0', u'siwamot', '', u'orita', u'mikeda', u'takanory', u'yujiorama', u'aodag', u'int128', '', '', u'xcir', u'man_pei', u'natsu_nanana', u'tetete3434', u'wasaist', u'Y2msk', u'st000m', u'shugonumano', u'yutarommx', u'norinori1103', u'gandalf_maki', u'tokibito', u'AE35', u'arvined', u'shomah4a', u'masasuz', u'salasen', u'3aru3a', u'railute', u'syncsynchalt', u'ysaotome', u'henrich', u'hiroohi', u'kashisan', u'flag_boy', u'matsuu', u'blaue_fuchs', u'atusi', u'tomita', u'shmza', u'mtakahas', u'u1', u'kiris', u'utsuidai', u'n0ts', u'matetsu']
>>> import connect_twitter # connect_twitterは、tweepyモジュールのapiオブジェクトを取得するために書いた。keyとか書いてあるのでgitには上げてない。
>>> api = connect_twitter.get_api()
>>> l = api.create_list('xxstudy_beer')
>>> [ l.add_member(user) for user in users if not user == '' ]
OUT: [<tweepy.models.List object at 0x1046b6c10>, <tweepy.models.List object at 0x1046b6d10>, <tweepy.models.List object at 0x1046b6dd0>, <tweepy.models.List object at 0x1046b6e90>, <tweepy.models.List object at 0x1046b6fd0>, <tweepy.models.List object at 0x1046c9150>, <tweepy.models.List object at 0x1046c9290>, <tweepy.models.List object at 0x1046c93d0>, <tweepy.models.List object at 0x1046c9510>, <tweepy.models.List object at 0x1046c9650>, <tweepy.models.List object at 0x1046c9790>, <tweepy.models.List object at 0x1046c98d0>, <tweepy.models.List object at 0x1046c9a10>, <tweepy.models.List object at 0x1046c9b50>, <tweepy.models.List object at 0x1046c9c90>, <tweepy.models.List object at 0x1046c9dd0>, <tweepy.models.List object at 0x1046c9ed0>, <tweepy.models.List object at 0x1046e0050>, <tweepy.models.List object at 0x1046e0190>, <tweepy.models.List object at 0x1046e02d0>, <tweepy.models.List object at 0x1046e0410>, <tweepy.models.List object at 0x1046e0550>, <tweepy.models.List object at 0x1046e0690>, <tweepy.models.List object at 0x1046e07d0>, <tweepy.models.List object at 0x1046e0910>, <tweepy.models.List object at 0x1046e0a50>, <tweepy.models.List object at 0x1046e0b90>, <tweepy.models.List object at 0x1046e0cd0>, <tweepy.models.List object at 0x1046e0e10>, <tweepy.models.List object at 0x1046e0f50>, <tweepy.models.List object at 0x10486a0d0>, <tweepy.models.List object at 0x10486a210>, <tweepy.models.List object at 0x10486a350>, <tweepy.models.List object at 0x10486a490>, <tweepy.models.List object at 0x10486a5d0>, <tweepy.models.List object at 0x10486a710>, <tweepy.models.List object at 0x10486a850>, <tweepy.models.List object at 0x10486a990>, <tweepy.models.List object at 0x10486aad0>, <tweepy.models.List object at 0x10486ac10>, <tweepy.models.List object at 0x10486ad50>, <tweepy.models.List object at 0x1046e0510>, <tweepy.models.List object at 0x1046e0090>, <tweepy.models.List object at 0x1046c9b10>, <tweepy.models.List object at 0x1046c9610>, <tweepy.models.List object at 0x1046c9110>, <tweepy.models.List object at 0x1046b6e10>, <tweepy.models.List object at 0x1046b6b50>, <tweepy.models.List object at 0x10486aa90>, <tweepy.models.List object at 0x10486a810>, <tweepy.models.List object at 0x10486a310>, <tweepy.models.List object at 0x10486ae10>, <tweepy.models.List object at 0x10486af10>, <tweepy.models.List object at 0x104864050>, <tweepy.models.List object at 0x104864150>, <tweepy.models.List object at 0x104864250>, <tweepy.models.List object at 0x104864350>, <tweepy.models.List object at 0x104864450>, <tweepy.models.List object at 0x104864550>, <tweepy.models.List object at 0x104864650>, <tweepy.models.List object at 0x104864750>, <tweepy.models.List object at 0x104864850>, <tweepy.models.List object at 0x104864950>, <tweepy.models.List object at 0x104864a50>, <tweepy.models.List object at 0x104864b50>, <tweepy.models.List object at 0x104864c50>, <tweepy.models.List object at 0x104864d50>, <tweepy.models.List object at 0x104864e50>, <tweepy.models.List object at 0x104864f50>, <tweepy.models.List object at 0x10488b090>, <tweepy.models.List object at 0x10488b190>, <tweepy.models.List object at 0x10488b290>, <tweepy.models.List object at 0x10488b390>, <tweepy.models.List object at 0x10488b490>, <tweepy.models.List object at 0x10488b590>, <tweepy.models.List object at 0x10488b690>, <tweepy.models.List object at 0x10488b790>, <tweepy.models.List object at 0x10488b890>, <tweepy.models.List object at 0x10488b990>, <tweepy.models.List object at 0x10488ba90>, <tweepy.models.List object at 0x10488bb90>, <tweepy.models.List object at 0x10488bc90>, <tweepy.models.List object at 0x10488bd90>, <tweepy.models.List object at 0x10488bed0>, <tweepy.models.List object at 0x10489d050>, <tweepy.models.List object at 0x10489d190>, <tweepy.models.List object at 0x10489d2d0>, <tweepy.models.List object at 0x10489d410>, <tweepy.models.List object at 0x10489d550>, <tweepy.models.List object at 0x10489d690>, <tweepy.models.List object at 0x10489d7d0>, <tweepy.models.List object at 0x10489d910>, <tweepy.models.List object at 0x10489da50>, <tweepy.models.List object at 0x10489db90>, <tweepy.models.List object at 0x10489dcd0>, <tweepy.models.List object at 0x10489de10>, <tweepy.models.List object at 0x10489df50>, <tweepy.models.List object at 0x10489d8d0>, <tweepy.models.List object at 0x10489d3d0>, <tweepy.models.List object at 0x10488be90>, <tweepy.models.List object at 0x10488ba50>, <tweepy.models.List object at 0x10488b650>, <tweepy.models.List object at 0x10488b250>, <tweepy.models.List object at 0x104864e10>, <tweepy.models.List object at 0x104864a10>, <tweepy.models.List object at 0x104864610>, <tweepy.models.List object at 0x104864210>, <tweepy.models.List object at 0x10486ad90>, <tweepy.models.List object at 0x1046b6b10>, <tweepy.models.List object at 0x1046c9750>, <tweepy.models.List object at 0x1046e0f10>, <tweepy.models.List object at 0x10488d110>, <tweepy.models.List object at 0x10488d210>, <tweepy.models.List object at 0x10488d310>, <tweepy.models.List object at 0x10488d410>, <tweepy.models.List object at 0x10488d510>, <tweepy.models.List object at 0x10488d610>, <tweepy.models.List object at 0x10488d710>, <tweepy.models.List object at 0x10488d810>, <tweepy.models.List object at 0x10488d910>, <tweepy.models.List object at 0x10488da10>, <tweepy.models.List object at 0x10488db10>, <tweepy.models.List object at 0x10488dc10>, <tweepy.models.List object at 0x10488dd10>, <tweepy.models.List object at 0x10488de10>, <tweepy.models.List object at 0x10488df10>, <tweepy.models.List object at 0x104740050>, <tweepy.models.List object at 0x104740150>, <tweepy.models.List object at 0x104740250>, <tweepy.models.List object at 0x104740350>, <tweepy.models.List object at 0x104740450>, <tweepy.models.List object at 0x104740550>, <tweepy.models.List object at 0x104740650>, <tweepy.models.List object at 0x104740750>, <tweepy.models.List object at 0x104740850>, <tweepy.models.List object at 0x104740950>, <tweepy.models.List object at 0x104740a50>, <tweepy.models.List object at 0x104740b50>, <tweepy.models.List object at 0x104740c50>, <tweepy.models.List object at 0x104740d50>, <tweepy.models.List object at 0x104740e50>, <tweepy.models.List object at 0x104740f50>, <tweepy.models.List object at 0x10472a090>, <tweepy.models.List object at 0x10472a190>, <tweepy.models.List object at 0x10472a290>]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment