def trackFriendFeed(args): screen_name = args[0] password = args[1] if password=='' or password==None: password = getpass.getpass('Enter '+screen_name+' password: '******'twitterFeed' in locals(): logger.info('Choon Kee') maxid = twitterFeed.maxid else: logger.info('not choon kee') maxid = 0 rateData = TwitterFunctions.getTwitterRateLimitStatus(screen_name, password) accountRateLimit = AccountRateLimit(rateData) print accountRateLimit if int(accountRateLimit.remainingHits) ==0: time.sleep(int(accountRateLimit.resetTimeSeconds)-int(time.time())+5) data = TwitterFunctions.getFriendTwitterFeed(screen_name, password, maxid, '', 10) if not 'twitterFeed' in locals(): twitterFeed = TwitterFeed(data) twitterFeed.update(data) displayStatus(twitterFeed) time.sleep(90) except TwitterFunctions.TwitterException, ex: logger.error(ex) continue
def getAccountRateLimit(args): screen_name = args[0] password = args[1] if screen_name: if password: rateData = TwitterFunctions.getTwitterRateLimitStatus(screen_name, password) accountRateLimit = AccountRateLimit(rateData) print accountRateLimit else: password = getpass.getpass('Enter '+screen_name+' password: ') rateData = TwitterFunctions.getTwitterRateLimitStatus(screen_name, password) accountRateLimit = AccountRateLimit(rateData) print accountRateLimit else: rateData = TwitterFunctions.getTwitterRateLimitStatus() accountRateLimit = AccountRateLimit(rateData) print accountRateLimit
def trackUserFeed(args): screen_name=args[0] #print screen_name while True: try: if 'twitterFeed' in locals(): maxid = twitterFeed.maxid else: maxid = 0 rateData = TwitterFunctions.getTwitterRateLimitStatus() accountRateLimit = AccountRateLimit(rateData) print accountRateLimit if int(accountRateLimit.remainingHits) ==0: time.sleep(int(accountRateLimit.resetTimeSeconds)-int(time.time())+5) data = TwitterFunctions.getUserTwitterFeed(screen_name, maxid, '', 10) if not 'twitterFeed' in locals(): twitterFeed = TwitterFeed(data) twitterFeed.update(data) displayStatus(twitterFeed) time.sleep(90) except TwitterFunctions.TwitterException, ex: logger.error(ex) continue