0

I'm having a problem using tweepy for tweet scrape.

here's the code

import tweepy
from textblob import TextBlob
import pandas as pd
import numpy as np
import re
import matplotlib.pyplot as plt
plt.style.use("fivethirtyeight")

#armazenar os dados de login
log = pd.read_csv("tokens.csv")




#Criar objeto de autenticação
authenticate = tweepy.OAuthHandler(consumerKey, consumerSecret)
#configurar o access token e o access secret
authenticate.set_access_token(accessToken, accessTokenSecret)

#Criar o objeto da API
api = tweepy.API(authenticate, wait_on_rate_limit=True)

#Coletar 2000 Tweets sobre Amazonia

search_term = "#Amazonia -filter:retweets"
#criar um cursor object
tweets = tweepy.Cursor(api.search_tweets, q=search_term, lang= "pt", since ="2018-01-01", until = "2021-12-01", tweet_mode="extended").items(2000)

#armazenar os tweets em uma variavel
all_tweets = [tweets for tweet in tweets]

I've got the following error when i run the code: "Unexpected parameter: since"

Any hints?

1 Answers1

0

Welcome on Stack Overflow !

The tweepy client uses the api from Twitter. As Twitter updates its api, parameters may be removed. In this case, as noted here, the API doesn't have a since parameter anymore.

I redirect you to this Stack Overflow question, where another user tried the since parameter with another endpoint. The answers for this questions give good examples on how to filter results with time.

D. LaRocque
  • 397
  • 5
  • 16