ãã£ã¨ä½è ã«ããªããªããã£ã³ã»ã°ã³ã½ã¯ã«åããâ¦â¦ã»ãã¨ã«äººæ°ãªã®?
ãµã¨ãããªè¨äºãè¦ã¤ãã¾ããã
韓流スターのチャン・グンソク公式Twitterのフォロワー数5万人に違和感 / なぜかツイート数0のユーザーが多い | ロケットニュース24
6 ææ«ã§ 5 ä¸ãããã©ãã¯ã¼ããã§ã« 7 ä¸äººãè¶ãã¦ãã¾ãã
ãããã§ãã!!ãã£ã³ã»ã°ã³ã½ã¯å¤§äººæ°ã§ãã!!
ç¥ããªããã©ã
ãããªå¤§äººæ°ãªãã£ã³ã»ã°ã³ã½ã¯ã«ãããã¦ä¸è¨ã®è¨äºã¯å¤±ç¤¼ããã¾ã!!
ãã£ã³ã»ã°ã³ã½ã¯å ¬å¼Twitterã®ãã©ãã¯ã¼æ°5ä¸äººã®ãã¡ã500人ã®ãã¤ã¼ãæ°ã¨ãã©ãã¯ã¼æ°ãªã©ãå½ç·¨éé¨ã§èª¿æ»ããã¨ãããããã¤ã¼ãã0ã§ããã©ãã¯ã¼æ°ã5人以ä¸ãã®ã¦ã¼ã¶ã¼ã¯168人ãã¤ã¾ããç´33.6ï¼ ã®ã¦ã¼ã¶ã¼ããä½ããã¦ãã¤ãã¤ã®ã¢ã«ã¦ã³ãã§ããå¯è½æ§ãé«ãã
1/100 調ã¹ã¦è¨ã£ã¦ããã®ã§ãããªãã«æ£ç¢ºãªæ°åã ã¨æãã¾ãããç¾å¨ã¯ã©ããªãã§ããã??
ä½æ
ãåã®ãã½ã³ã³ã«ã¯ twitter ã®è²ã
㪠API ãå©ããããªã¹ã¯ãªãããè²ã
転ãã£ã¦ããããã¦ãæ TDD ä¼é師ã®å½¼å¥³ã®ã¢ã«ã¦ã³ããç¹å®ããããã«ä½¿ããã¦ãããããããªãã£ããããã®ã§ãæè§ãªã®ã§ããã£ã¨é©å½ã«ã¹ã¯ãªããæ¸ãã¦å
¨é¨èª¿ã¹ã¦ã¿ã¾ããã
å ¨ä½ 71770 äººä¸ | äººæ° | æ¯ç |
ãã¤ã¼ã 0 件 | 10321 | 14.380660443082% |
ãã¤ã¼ã 5 ä»¶ä»¥ä¸ | 18868 | 26.289536017835% |
ã»ããä¸è¨ã®è¨äºãããã¤ãã¤ã¢ã«ã¦ã³ãå°ãã§ãã!!
åãã§ãã!!!ãã¤ã¼ã 5 件以ä¸ã«ããã£ã¦ã¯ 25% è¶ãã§ã!!
Twitter ã®ã¢ã«ã¦ã³ãåå¾ãã¦ä¸åº¦ãçºè¨ããªã人ãä¸ä¸äººä»¥ä¸ããã£ã³ã»ã°ã³ã½ã¯ã®æ¥æ¬ã®ãã¡ã³ã¯ã©ãã®çºè¨ãè¦ããã¦ãã©ãã¼ãã¦ããã§ãã!!!
éæµãã¡ã³ã¯ ROM ãªäººãå¤ããã§ãã!!! ROM ãªäººãå¤ãããèªåã®ã¾ããã«ã¯ãã£ã³ã»ã°ã³ã½ã¯ãã¡ã³ã¨ãè¦ãäºãªãã£ããã§ãã!!!
ãã©ãã¯ã¼ã® 25% 以ä¸ã 5 件以ä¸ããçºè¨ãã¦ãªããã§ãã!!å
¨ç¶çºè¨ããªãã§ï¼ãã£ã³ã»ã°ã³ã½ã¯ã®ç¿»è¨³ãããè¨èã ãè¦ã¦ãã¤ãã¤ãã¦ããã§ãã!!
ã¤ãã§ãªã®ã§åã®ãã©ãã¯ã¼ã§ã調æ»ãã¦ã¿ã¾ãã!!
ãã£ã³ã»ã°ã³ã½ã¯ã® 1/7 ãããã¾ãããåèã¾ã§ã«â¦â¦
å ¨ä½ 9808 äººä¸ | äººæ° | æ¯ç |
ãã¤ã¼ã 0 件 | 67 | 0.683115823817% |
ãã¤ã¼ã 5 ä»¶ä»¥ä¸ | 181 | 1.845432300163% |
ä¸åããã¤ã¼ããã¦ãªã人ã 67 人ãããäºã«ããã¯ãªãã¾ããã
ããã§ã 1% 以ä¸ã§ãã!!
éæµãã¡ã³ä¸æè°ã ã¼
ã¨ãããã以ä¸ã½ã¼ã¹
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys, simplejson, urllib2, urllib, dbm from pit import Pit from time import sleep from tw3 import MyTwitter screen_name = 'yoshiori' def collect(): while int(db.get('cursor')): try: data = twitter.get_followers(int(db.get('cursor')),screen_name) except: exceptionType, exceptionValue, exceptionTraceback = sys.exc_info() print exceptionType print exceptionValue print exceptionTraceback exit() for user in data['users']: status_count = user['statuses_count'] db['all'] = str( int( db['all']) + 1) if status_count == 0: db['zero'] = str( int(db['zero']) + 1) if status_count < 5: db['under5'] = str( int(db['under5']) + 1) print '%s : %s : %s' % (db['zero'], db['under5'], db['all']) db['cursor'] = str(data.get('next_cursor')) print db.get('cursor') sleep(wait) log.info('0件 : %s', db['zero']) log.info('5ä»¶ä»¥ä¸ : %s', db['under5']) log.info('å ¨ä½: %s', db['all']) if __name__ == '__main__': import rfc822,logging, pickle from datetime import datetime, timedelta log = logging.getLogger() hdlr = logging.FileHandler('yoshiori.log') formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') hdlr.setFormatter(formatter) log.addHandler(hdlr) log.setLevel(logging.INFO) twitter = MyTwitter() db = dbm.open('yoshiori','c') if not db.get('cursor'): db['cursor'] = '-1' if not db.get('zero'): db['zero'] = '0' if not db.get('under5'): db['under5'] = '0' if not db.get('all'): db['all'] = '0' print 'start' print 'cursor : %s' % db.get('cursor') log.info('start') wait = 1 collect() log.info('success')