twitter

Twitter API v2 and Tweepy, how to get tweet author for streamed tweets?

Twitter API v2 and Tweepy, how to get tweet author for streamed tweets? Question: I am trying to filter out tweets that include a specific hashtag, which works great, I can even display the text. But additionally, I want to print the user_screenname or author name. But it seems like my class can only display …

Total answers: 2

How to convert a "yyyy-MM-dd'T'HH:mm:ssZ'" format in a dataframe to a datetime format

How to convert a "yyyy-MM-dd'T'HH:mm:ssZ'" format in a dataframe to a datetime format Question: How can I convert a "yyyy-MM-dd’T’HH:mm:ssZ’" format in a dataframe to a datetime format that I can further format to an index 2021-01-02T05:22:58.000Z is one of the dates in the dataframe i’ve tried this line of code: df[‘created_at_tweet’]= pd.to_datetime(df[‘created_at_tweet’], format=("yyyy-MM-dd’T’HH :mm:ss.SSS’Z’")) …

Total answers: 1

Scrape Tweet replies with Python and Selenium

Scrape Tweet replies with Python and Selenium Question: I’m trying to scrape replies to public Tweets using Python. I have the code below, which gets all replies displayed on the screen, but I am having trouble getting the rest of the replies that need scrolling. The code works fine without the scroll loop, but once …

Total answers: 3

Unauthorized: 401 Unauthorized 32 – Could not authenticate you

Unauthorized: 401 Unauthorized 32 – Could not authenticate you Question: I am trying to get the data related to a specific hashtags from a specific location , but I am getting error.. I searched on the internet that it can be because of the since but I am not sure what to use instead of …

Total answers: 1

Django AllAuth with Twitter Error: "No access to private resources at api.twitter.com"

Django AllAuth with Twitter Error: "No access to private resources at api.twitter.com" Question: I’m trying to setup the Django AllAuth Twitter login. When the user authenticates with Twitter and is redirected to my website, Django AllAuth raises the Error "No access to private resources at api.twitter.com" and I’m pretty lost here. I have the following …

Total answers: 2

Receiving "Stream encountered HTTP error: 403" when using Twitter API. What is causing this error and how can I fix it?

Receiving "Stream encountered HTTP error: 403" when using Twitter API. What is causing this error and how can I fix it? Question: I am very new to using the Twitter API and was testing some Python code (below) from tweepy import OAuthHandler from tweepy import Stream import twitter_credentials class StdOutListener(Stream): def on_data(self, data): print(data) return …

Total answers: 2

Python: How to iterate through a list of Twitter users using Snscrape?

How to iterate through a list of Twitter users using Snscrape? Question: I trying to retrieve tweets over a list of users, however in the snscrape function this argument is inside quotes, which makes the username to be taken as a fixed input import snscrape.modules.twitter as sntwitter tweets_list1 = [] users_name = [{‘username’:’@bbcmundo’},{‘username’:’@nytimes’}] for i,tweet …

Total answers: 2

Retrieving specific conversations using Tweepy

Retrieving specific conversations using Tweepy Question: I have been trying to retrieve conversation threads using Tweepy, and although the functionality has been added to the Twitter api (conversation_id is an optional parameter), it has not been added to Tweepy. I was wondering if anyone was familiar enough with Tweepy that they might know a way …

Total answers: 2

How could I solve this error to scrape Twitter with Python?

How could I solve this error to scrape Twitter with Python? Question: I’m trying to do a personal project for my portfolio, I would like to scrape the tweets about the president Macron but I get this error with twitterscrapper. from twitterscraper import query_tweets import datetime as dt import pandas as pd begin_date=dt.date(2020,11,18) end_date=dt.date(2020,11,19) limit=1000 …

Total answers: 1

Merge multiple JSON files into one file by using Python (stream twitter)

Merge multiple JSON files into one file by using Python (stream twitter) Question: I’ve pulled data from Twitter. Currently, the data is in multiple files and I could not merge it into one single file. Note: all files are in JSON format. The code I have used is here and here. It has been suggested …

Total answers: 1