iSarabjitDhiman / TweeterPy

TweeterPy is a python library to extract data from Twitter. TweeterPy API lets you scrape data from a user's profile like username, userid, bio, followers/followings list, profile media, tweets, etc.
MIT License
169 stars 30 forks source link

Search function - limit rate & tweet replies #67

Open crl-ick opened 4 months ago

crl-ick commented 4 months ago

Hi,

Thank you for the amazing work! I have a couple of questions regarding the search function.

  1. I'm trying to extract 1000 tweets, but no matter the search term and the value passed to total parameter, I only get 39 tweets returned in the dictionary. This is the code that I'm using:
from tweeterpy import TweeterPy
from tweeterpy.util import RateLimitError
from tweeterpy.util import find_nested_key

import itertools

import urllib3
urllib3.disable_warnings()

twitter = TweeterPy()
twitter.login("username","pass")
try:
    tweets = twitter.search('taylor swift', end_cursor=None, total=1000, pagination=True) 

except Exception as e:
    print(e)

x = find_nested_key(tweets,'full_text')
print(len(x))
  1. Is it possible to filter out the retweets?
  2. How to collect all the replies for each of the tweets containing the searched term? Is there a parameter providing this functionality or do we have to follow a two-step approach (i.e., collect tweets containing the search keyword, extract tweet id and get tweet replies for tweet id iteratively)?