Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search function - limit rate & tweet replies #67

Open
crl-ick opened this issue Jul 15, 2024 · 0 comments
Open

Search function - limit rate & tweet replies #67

crl-ick opened this issue Jul 15, 2024 · 0 comments

Comments

@crl-ick
Copy link

crl-ick commented Jul 15, 2024

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)?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant