Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion twarc/client2.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ def search_all(
until_id (int):
Return all tweets up to this tweet_id.
start_time (datetime):
Return all tweets after this time (UTC datetime).
Return all tweets after this time (UTC datetime). If none of start_time, since_id, or until_id
are specified, this defaults to 2006-3-21 to search the entire history of Twitter.
end_time (datetime):
Return all tweets before this time (UTC datetime).
max_results (int):
Expand All @@ -223,6 +224,12 @@ def search_all(
"""
url = "https://api.twitter.com/2/tweets/search/all"

# start time defaults to the beginning of Twitter to override the
# default of the last month. Only do this if start_time is not already
# specified and since_id and until_id aren't being used
if start_time is None and since_id is None and until_id is None:
start_time = datetime.datetime(2006, 3, 21, tzinfo=datetime.timezone.utc)

return self._search(
url,
query,
Expand Down
6 changes: 0 additions & 6 deletions twarc/command2.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,6 @@ def _search(
# default number of tweets per response 500 when not set otherwise
if max_results == 0:
max_results = 100 # temp fix for #504

# start time defaults to the beginning of Twitter to override the
# default of the last month. Only do this if start_time is not already
# specified and since_id and until_id aren't being used
if start_time is None and since_id is None and until_id is None:
start_time = datetime.datetime(2006, 3, 21, tzinfo=datetime.timezone.utc)
else:
if max_results == 0:
max_results = 100
Expand Down