tweepy

Tweepy - How to add user to specific list

限于喜欢 提交于 2019-12-13 03:16:36
问题 I'm trying to make multiple actions in one run retweet the tweets with a specific hashtag and add a user to list (already created list). I get to error message that [{'code': 108, 'message': 'Cannot find specified user.'}] # Import Tweepy, sleep, credentials.py import tweepy from time import sleep from credentials import * # Access and authorize our Twitter credentials from credentials.py auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access

How can I fix Encoding in tweepy?

谁都会走 提交于 2019-12-13 01:47:47
问题 I'm working on tweety module and I tried this code for taking tweet by written Turkish(in turkish language,some charecter doesn't support ascii such as ğ,ş,ö,ç,İ,ı) but I need clearly whole data. from tweepy import Stream from tweepy import OAuthHandler from tweepy.streaming import StreamListener import time ckey = "****" csecret = "****" atoken = "****" asecret = "****" class listener(StreamListener): def on_data(self,data): tweet = data.split(',"text":"')[1].split('","source')[0] print

Tweepy: AttributeError: 'tuple' object has no attribute 'followed_by'

血红的双手。 提交于 2019-12-13 01:41:17
问题 I am trying to make a "simple" script that will unfollow users whom I am following that are not following me back using the Tweepy module for Python 3.5. import sys, time, tweepy auth = tweepy.OAuthHandler('Consumer Key', 'Consumer Secret') auth.set_access_token('Access Token', 'Access Token Secret') api = tweepy.API(auth) for page in tweepy.Cursor(api.friends, screen_name='My Twitter Handle').pages(): for friend in page: relationship = api.show_friendship(source_screen_name='My Twitter

Tweepy OpenSSL.SSL.WantReadError

故事扮演 提交于 2019-12-12 16:35:07
问题 Python 3.6. I use the streamer of tweepy to get tweets. It works well. But sometimes, if I let it open for more than 24h, I have this error Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\site-packages\requests\packages\urllib3\contrib\pyopenssl.py", line 277, in recv_into return self.connection.recv_into(*args, **kwargs) File "C:\ProgramData\Anaconda3\lib\site-packages\OpenSSL\SSL.py", line 1547, in recv_into self._raise_ssl_error(self._ssl, result) File "C:\ProgramData

Tweepy multiple auth handler

吃可爱长大的小学妹 提交于 2019-12-12 09:14:01
问题 I am using nirgs forked version of Tweepy, which I need to use to get tweets between 2017-01-31 and 2017-02-01 . My code works and due to Twitters Rate Limits I have to switch between multiple auth handlers to be able to work with tweets which dates are as far away as mentioned before. I am using this instruction, but after reaching Rate Limit and trying to switch to the next auth handler by using api.auth_idx += 1 I get the following error: File "build/bdist.macosx-10.11-intel/egg/tweepy/api

Python: How to only loop over first 'x' items of a very long list; Writing a Twitter bot with tweepy

二次信任 提交于 2019-12-12 06:47:57
问题 Noob here. I'm sure this is a simple problem. I'm writing a Twitter bot with tweepy. I've hit a snag. I'm getting a 'Rate limit exceeded' error when I'm calling the api to make a list of followers. From what I understand, this is due to Twitter imposing a limit on calls to the api. My code snippet: for follower in tweepy.Cursor(api.followers).items(): follower_ids.append(follower.id) My question: How do I grab the first 'x' items from tweepy.Cursor(api.followers).items()? in range seemed like

module 'tweepy' has no attribute 'OAuthHandler'

余生颓废 提交于 2019-12-12 06:29:14
问题 So I'm trying to set up Tweepy so I can start programming with it. How my first program looks: #IMPORTING LIBRARIES # * tweepy - Twitter API import tweepy #LISTING CREDENTIALS _consumer_key = 'MYCONSUMERKEY' _consumer_secret = 'MYCONSUMERSECRETKEY' _access_token = 'MYACCESSTOKEN' _access_token_secret = 'MYACCESSTOKENSECRET' #OAUTHHANDLER INSTANCE # * works over HTTP and authorizes devices, APIs, servers, and # applications — is a standard that provides secure and delegated access. auth =

TypeError: 'Status' object is not iterable

混江龙づ霸主 提交于 2019-12-12 05:48:28
问题 Running this gives me the error TypeError: 'Status' object is not iterable I'm trying to get the statuses from the user. import simplejson import httplib2 import tweepy import random import time import itertools def paginate(iterable, page_size): while True: i1, i2 = itertools.tee(iterable) iterable, page = (itertools.islice(i1, page_size, None), list(itertools.islice(i2, page_size))) if len(page) == 0: break yield page auth = tweepy.OAuthHandler("removed", "removed") auth.set_access_token(

Tweepy returns 414 error retrieving status of only most recent tweet

一笑奈何 提交于 2019-12-12 05:04:19
问题 My code looks like: user = api.get_user('any_user_you_like') for status in api.user_timeline(user, count=1, trim_user=1): status = str(status.id) When I run this on my own twitter account it returns my latest tweet ID with no issue. However when I run this on the twitter account of someone with a lot of tweets, like a celebrity I receive the error: tweepy.error.TweepError: Twitter error response: status code = 414 It looks like something is coming back too large to be parsed, however I'm only

How can I get tweets more than a year

送分小仙女□ 提交于 2019-12-12 04:28:14
问题 I'm trying to get twitters timelime using tweepy, but I can't get old tweets that are more than a year ago. My Python script is shown below: #!/usr/bin/env python # -*- coding:utf-8 -*- from __future__ import unicode_literals import tweepy import json CONSUMER_KEY = 'XXXXXXXXXXXXXXXXXXXXX' CONSUMER_SECRET = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) ACCESS_TOKEN = 'XXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' ACCESS_SECRET =