Skip to content

Search function - limit rate & tweet replies #67

@crl-ick

Description

@crl-ick

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)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions