I tried following code :
import snscrape.modules.twitter as sntwitter
import time
query5 = "(from:BBC) until:2023-01-12 since:2023-01-08 -filter:replies"
news = [query5]
tweets = []
for news_data in news:
limit = 500
for tweet in sntwitter.TwitterSearchScraper(news_data).get_items():
# print(vars(tweet))
# break
if len(tweets) == limit:
break
else:
tweets.append([tweet.date, tweet.username, tweet.content])
time.sleep(2)
CodePudding user response:
Faced the same issue. I guess snscraper, made use of Twitter API (elevated access) in the backend. Twitter shut down all the bots which were fetching the API data. Twitter essentially wants you to make authentic use of their data. I suggest signing up on twitter's developer account and requesting the elevated environment. Notice the first line in error makes a call to Twitter API.
CodePudding user response:
you have to install the last version of snscrape 0.5.0.20230113.