tweepy

Python Tweepy: Twitter Api saying that /users/lookup does not exist

浪子不回头ぞ 提交于 2019-12-06 08:33:51
问题 I'm making a research application which studies interactions between twitter users with high authority. Part of it is extracting information about the users. I built an application using Tweepy for Python and I've been extracting user information for that past 2 days without any porblems. All of a sudden for a request like: https://api.twitter.com/1.1/users/lookup.json?user_id=14063469%2C175965206%2C116959518%2C19814396%2C59871521%2C15879224%2C53116337%2C60620244%2C22667202%2C56455965

How to use the 'count' parameter in tweepy's streaming API?

橙三吉。 提交于 2019-12-06 07:53:50
问题 I can use the streaming API just fine when I don't include the count parameter in filter() call, but when I try to specify how many tweets from my history I want to receive, my stream object returns None . import tweepy from tweepy.streaming import StreamListener, Stream class Listener (StreamListener): def on_status(self, status): print '-' * 20 print status.text return def get_tweets(request): # if request.is_ajax(): # All keys and secrets are declared here, but were removed for security

streaming api with tweepy only returns second last tweet and NOT the immediately last tweet

只愿长相守 提交于 2019-12-06 07:31:35
问题 I am new to not only python, but programming altogether so I'd appreciate your help very much! I am trying to filter detect all tweets from the twitter streaming API using Tweepy. I have filtered by user id and have confirmed that tweets are being collected in real-time. HOWEVER , it seems that only the second last tweet is being collected in real-time as opposed to the very latest tweet. Can you guys help? import tweepy import webbrowser import time import sys consumer_key = 'xyz' consumer

Writing multiple JSON to CSV in Python - Dictionary to CSV

拜拜、爱过 提交于 2019-12-06 07:22:40
I am using Tweepy to stream tweets and would like to record them in a CSV format so I can play around with them or load them in database later. Please keep in mind that I am a noob, but I do realize there are multiple ways of handling this (suggestions are very welcome). Long story short, I need to convert and append multiple Python dictionaries to a CSV file. I already did my research ( How do I write a Python dictionary to a csv file? ) and tried doing this with DictWriter and writer methods. However, there are few more things that need to be accomplished: 1) Write key as header only once. 2

tweepy count limited to 200?

时光怂恿深爱的人放手 提交于 2019-12-06 07:03:26
问题 I'm currently trying to retrieve the followers of some big account with a lot of followers. I'm using Tweepy and this piece of code (with cursor): follower_cursors = tweepy.Cursor(api.followers, id = id_var,count=5000) for friend in follower_cursors.items(): Ok if I don't specify count it seems that by default only 20 results are shown per page, but as from Twitter API documentation it can provide 5000 followers I tried to set it to the maximum. However this doesn't seem to be taken into

How to get all users in a list Twitter API?

懵懂的女人 提交于 2019-12-06 06:49:59
问题 Is there a way to access all members in a list? Currently, I can only see the first 20 members? Specifically, I'm using python and tweepy. 回答1: In Tweepy, this can be facilitated by using the Cursor class Tweepy provides, which implements an appropriate iterator for the model returned to you depending on your desired method call. In your case, you want to initialize a Cursor with the list_members() method and parameters for the list owner and the list slug (see https://dev.twitter.com/docs

Passing data between classes in Tweepy and Tornado WebSocket

喜欢而已 提交于 2019-12-06 06:18:49
I have two main modules, Tornado WebSocket and Tweepy Streaming, and I'm trying to get them to talk to each other. Under on_status in the StdOutListener Tweepy class below (marked with <-- ), I'd like to call the WSHandler.on_message Tornado class higher up, with data passed from on_status . I'm not able to do so however, as I get error-messages related to undefined instances etc. with the code below. Any help greatly appreciated! (Also, the only non-blocking way I've managed to run both modules at the same time is with threading, as the IOLoop.add_callback does not keep StdOutListener from

How to create a pandas dataframe using Tweepy?

别说谁变了你拦得住时间么 提交于 2019-12-06 05:51:11
问题 In Python 3 I made program to extract posts and likes in Twitter: import tweepy import pandas as pd consumer_key = '' consumer_secret = '' access_token = '' access_token_secret = '' auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_token_secret) api = tweepy.API(auth) This function receives the didactic classification of profiles (only for database organization) and the name of the profile. It creates a list with dictionaries, which is then

Python at Synology, how to get Python3 modules installed and where is Python2.7 installed?

独自空忆成欢 提交于 2019-12-06 04:04:16
Can you please advise me how to get Python3 with modules running at my Synology (DS214play, with DSM 6.0.1-7393 Update 1)? What I want: run Tweepy and other modules in Python3 on my Synology. Where I am stuck: how to get PIP3 to install Tweepy, if I try I get: Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages Apparently I have a Python 2.7 installed but I was not aware... root@DiskStation:/volume1/@appstore/python3/include# ls get-pip.py python3.4m root@DiskStation:/volume1/@appstore/python3/include# python3 get-pip.py -ash: python3: command not found root@DiskStation:

What is the difference between on_data and on_status in the tweepy library?

一笑奈何 提交于 2019-12-05 23:38:24
问题 I just started using tweepy library to connect with streaming api of twitter. I encountered both on_status() and on_data() methods of the StreamListener class. What is the difference? Total noob here! 回答1: on_data() handles: replies to statuses deletes events direct messages friends limits, disconnects and warnings whereas, on_status() just handles statuses. source: https://github.com/tweepy/tweepy/blob/78d2883a922fa5232e8cdfab0c272c24b8ce37c4/tweepy/streaming.py 回答2: If you're only concerned