Skip to content

Commit

Permalink
Merge branch 'main' of github.com:DocNow/twarc into main
Browse files Browse the repository at this point in the history
  • Loading branch information
edsu committed Aug 17, 2021
2 parents 9375c2d + bfd59e1 commit 3780503
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
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

0 comments on commit 3780503

Please sign in to comment.