tweepy

Python tweepy writing to sqlite3 db

大兔子大兔子 提交于 2021-02-05 11:18:12
问题 My script below (taken from various resources online) isn't writing to the database. I do not get any errors, and if I comment out the database lines then it outputs to the console without issue. The database exists, it has 2 fields, its writeable by me.... Any ideas please? Updated code below #!/usr/bin/env python import sys import tweepy from textwrap import TextWrapper import sqlite3 CONSUMER_KEY = '' CONSUMER_SECRET = '' ACCESS_KEY = '' ACCESS_SECRET = '' auth1 = tweepy.auth.OAuthHandler

Python tweepy writing to sqlite3 db

本秂侑毒 提交于 2021-02-05 11:16:07
问题 My script below (taken from various resources online) isn't writing to the database. I do not get any errors, and if I comment out the database lines then it outputs to the console without issue. The database exists, it has 2 fields, its writeable by me.... Any ideas please? Updated code below #!/usr/bin/env python import sys import tweepy from textwrap import TextWrapper import sqlite3 CONSUMER_KEY = '' CONSUMER_SECRET = '' ACCESS_KEY = '' ACCESS_SECRET = '' auth1 = tweepy.auth.OAuthHandler

How to get tweets in real time from a user's timeline using Tweepy

可紊 提交于 2021-01-29 13:18:33
问题 I'm trying to pull tweets from a user's timeline in real-time. I then want to do some analysis on those tweets. Having read the docs it looks like I will need to use tweepy.Stream for this use case. I've done the following: stream.filter(follow='25073877') But Twitter's filter API states the following: Tweets created by the user. Tweets which are retweeted by the user. Replies to any Tweet created by the user. Retweets of any Tweet created by the user. Manual replies, created without pressing

Ignoring Retweets When Streaming Twitter Tweets

僤鯓⒐⒋嵵緔 提交于 2021-01-28 08:14:52
问题 I am trying to run a simple script that will stream live Tweets. Several attempts to filter out retweets have been unsuccessful. I still get manual retweets (with the text "RT @") in my stream. I've tried other methods including link and link. As I am learning, my code is very similar to the following: link What can I do to ignore retweets? Here is a snippet of my code: class StreamListener(tweepy.StreamListener): def on_status(self, status): if (status.retweeted) and ('RT @' not in status

Tweepy Get Tweets in reply to a particular tweet

≡放荡痞女 提交于 2021-01-27 17:44:22
问题 So I've been doing a lot of work with Tweepy and Twitter data mining, and one of the things I want to do is to be able to get all Tweets that are replies to a particular Tweet. I've seen the Search api, but I'm not sure how to use it nor how to search specifically for Tweets in reply to a specific Tweet. Anyone have any ideas? Thanks all. 回答1: user_name = "@nameofuser" replies = tweepy.Cursor(api.search, q='to:{}'.format(user_name), since_id=tweet_id, tweet_mode='extended').items() while True

Query for Tweet within time interval using tweepy

坚强是说给别人听的谎言 提交于 2021-01-27 06:43:03
问题 I am trying to use tweepy to query for tweet that falls within certain interval. Using the snippet below for days interval works: page_count = 0 for tweets in tweepy.Cursor(api.search,q=query,count=100,result_type="recent",include_entities=True,since= "2016-02-18", until= "2016-03-18" ).pages(): page_count+=1 print tweets[0].text.encode('utf-8') if page_count >=20: break but i want it to be within time interval e.g (between 06:00 and 13:00). I tried using this query but it returns nothing:

Query for Tweet within time interval using tweepy

馋奶兔 提交于 2021-01-27 06:41:10
问题 I am trying to use tweepy to query for tweet that falls within certain interval. Using the snippet below for days interval works: page_count = 0 for tweets in tweepy.Cursor(api.search,q=query,count=100,result_type="recent",include_entities=True,since= "2016-02-18", until= "2016-03-18" ).pages(): page_count+=1 print tweets[0].text.encode('utf-8') if page_count >=20: break but i want it to be within time interval e.g (between 06:00 and 13:00). I tried using this query but it returns nothing:

Unable to import tweepy module

安稳与你 提交于 2021-01-26 03:57:49
问题 I am new to installing new python modules. I installed tweepy using pip install tweepy. The installation was successful and 2 folders tweepy & tweepy-3.3.0.dist-info are created in the Lib/site-packages, hence I assumed all should be fine. However, when I went to the IDE and import tweepy. It is unable to detect the module: >>> import tweepy Traceback (most recent call last): File "<interactive input>", line 1, in <module> ImportError: No module named tweepy What is wrong? I am running python

Unable to import tweepy module

雨燕双飞 提交于 2021-01-26 03:57:20
问题 I am new to installing new python modules. I installed tweepy using pip install tweepy. The installation was successful and 2 folders tweepy & tweepy-3.3.0.dist-info are created in the Lib/site-packages, hence I assumed all should be fine. However, when I went to the IDE and import tweepy. It is unable to detect the module: >>> import tweepy Traceback (most recent call last): File "<interactive input>", line 1, in <module> ImportError: No module named tweepy What is wrong? I am running python

Tweepy Twitter get all tweet replies of particular user

三世轮回 提交于 2021-01-20 19:44:30
问题 I am trying to get all replies of this particular user. So this particular user have reply_to_user_id_str of 151791801. I tried to print out all the replies but I'm not sure how. However, I only manage to print out only 1 of the replies. Can anyone help me how to print out all the replies? My codes are: for page in tweepy.Cursor(api.user_timeline, id="253346744").pages(1): for item in page: if item.in_reply_to_user_id_str == "151791801": print item.text a = api.get_status(item.in_reply_to