def on_data(self, status): #Carregando para o formato json tweet = json.loads(status) #Inserindo na coleção, se não for retweet if (tweet['text'][0:2]!='RT'): friends_ids, followers_ids = funcoestwitter.get_friends_followers_ids(twitter_api, screen_name=tweet['user']['screen_name']) tweet['user']['friends_ids']=friends_ids tweet['user']['followers_ids']=followers_ids collection.insert(tweet) return True
# -*- coding: utf-8 -*- import sys import tweepy import twitter import json import twitter import types import funcoestwitter twitter_api = funcoestwitter.autenticar() friends_ids, followers_ids = funcoestwitter.get_friends_followers_ids(twitter_api, screen_name=sys.argv[1]) print (friends_ids) print (followers_ids)
# -*- coding: utf-8 -*- import sys import tweepy import twitter import json import twitter import types import funcoestwitter twitter_api = funcoestwitter.autenticar() friends_ids, followers_ids = funcoestwitter.get_friends_followers_ids( twitter_api, screen_name=sys.argv[1]) print(friends_ids) print(followers_ids)