tweepy

Tweepy 2.1: Add member to a list

Deadly 提交于 2019-12-07 21:03:21
问题 Using Tweepy2.1, I am trying to add a member ( people ) of my Twitter account to a list ( testlist ) with: import tweepy ... api = tweepy.API(auth) api.add_list_member(testlist, people) I get the following error: TweepError: [{'message': 'You must specify either a list ID or a slug and owner', 'code': 112}] I have tried other ways of calling the add_list_member function, but nothing worked. Also, I have some difficulties with the incomplete Tweepy documentation. Anyone have a solution for

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

会有一股神秘感。 提交于 2019-12-07 18:06:57
问题 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:

Tweepy. Make stream run forever

瘦欲@ 提交于 2019-12-07 18:04:43
问题 I am relatively new to tweepy python library. I want to be sure that my stream python script always runs on a remote server. So it would be great if someone will share the best practices on how to make it happen. Right now I am doing it this way: if __name__ == '__main__': while True: try: # create instance of the tweepy tweet stream listener listener = TweetStreamListener() # set twitter keys/tokens auth = OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) auth.set_access_token(ACCESS_TOKEN, ACCESS

Filtering in tweepy

倾然丶 夕夏残阳落幕 提交于 2019-12-07 16:50:15
问题 I am new to tweepy and have encountered a problem. I want to download tweets with special hashtags. But it seems stream.filter(track = ['word1', 'word2', 'word3']) looks for these words in tweet and not in hashtags of the tweet. How can I filter on hashtags? 回答1: You find the tags in the status object. It is there you have to make the comparison with the ones you are looking for. example: for hashtag in status.entities['hashtags']: print(hashtag['text']) example here: http://www.pythoncentral

Error with tweepy OAuthHandler

我是研究僧i 提交于 2019-12-07 09:57:56
问题 I'm new here and kind of unexperienced with python, so sorry if the question is trivial. I have this simple script, to fetch followers of a given twitter user: import time import tweepy consumer_key="xxx" consumer_secret="yyy" access_token="zzz" access_token_secret="www" auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_token_secret) of course xxx,yyy,etc are being set in my script with API key, secret, access token etc I get this error: c:

Converting time to epoch (Python) [duplicate]

你离开我真会死。 提交于 2019-12-07 05:21:46
问题 This question already has answers here : Convert string date to timestamp in Python (13 answers) Closed 9 months ago . I am using tweepy to get a tweet. I am trying to send this tweet over Slack. Tweepy gives the time in a strange format, and Slack requires the time in epoch. for i in tweets: created=(i.created_at) print(created) print(created.strftime('%s')) This returns 2017-01-17 14:36:26 Traceback (most recent call last): File "C:\Users\Administrator\Desktop\slackbot3\run.py", line 287,

Tweepy: get old tweets now possible with Twitter search api?

♀尐吖头ヾ 提交于 2019-12-07 05:04:13
问题 Accoring to http://www.theverge.com/2014/11/18/7242477/twitter-search-now-lets-you-find-any-tweet-ever-sent Twitter search now lets you find any tweet ever sent. But when i am trying to get tweets from 2014 to 2015 using tweepy it gets only recent: query = 'Nivea' max_tweets = 1000 searched_tweets = [json.loads(status.json) for status in tweepy.Cursor(api.search, q=query, count=100, #since_id="24012619984051000", since="2014-02-01", until="2015-02-01", result_type="mixed", lang="en" ).items

retrieving a list of tweets using tweet ID in tweepy

冷暖自知 提交于 2019-12-06 15:54:44
问题 I ha ve a file containing a list of tweet IDs and I want to retrieve those tweets. The file contains more than 100000 tweets and the twitter API allows to retrieve only 100. api = tweepy.API(auth) good_tweet_ids = [i for i in por.TweetID[0:100]] tweets = api.statuses_lookup(good_tweet_ids) for tweet in tweets: print(tweet.text) Is there a way to retrieve more tweets say 1000 or 2000, I don't want to take a sample of the data and save the results to a file and change the index of the tweet ID

Using Tweepy OAuth to authenticate a user when they submit a form

家住魔仙堡 提交于 2019-12-06 11:30:25
I'm building a web app (using Django) in which I need to use OAuth. I'm using Tweepy and have installed and imported it. I now have no idea to set it up so that when a user hits the "Submit" button on my form, they are asked to Log in via Twitter. I have followed a number of different tutorials/blogs to try and get it working but I can't seem to crack it. This is the flow I am after: User submits a message using the form User is asked to authenticate Twitter account Message from the form and Twitter details (@username, screen name, profile pic etc) are stored in database (using SQLite3) User

Tweepy StreamListener to CSV

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 10:17:27
问题 I'm a newbie on python and I'm trying to develop an app that retrieves data from Twitter with Tweepy and the Streaming APIs and converts the data on a CSV file. The problem is that this code doesn't create an output CSV file, maybe because I should set the code to stop when it achieves for eg. 1000 tweets but I'm not able to set this stop point here's the code import sys import tweepy import csv #pass security information to variables consumer_key="" consumer_secret="" access_key = "" access