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

Adding offset, min, and max options to allow for complete collection on keywords using the search function #6

Merged
merged 4 commits into from
Aug 18, 2022
Merged
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
23 changes: 22 additions & 1 deletion truthbrush/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,41 @@ def search(
query: str = None,
limit: int = 4,
resolve: bool = 4,
offset: int=0,
min_id: str='0',
max_id: str=None
) -> Optional[dict]:
"""Search users, statuses or hashtags."""

assert query is not None and searchtype is not None
if max_id==None:
return self._get(
"/v2/search",
params=dict(
q=query,
resolve=resolve,
limit=limit,
type=searchtype,
offset=offset,
min_id=min_id,

),
)

return self._get(
"/v2/search",
params=dict(
q=query,
resolve=resolve,
limit=limit,
type=searchtype,
offset=offset,
min_id=min_id,
max_id=max_id,
),
)



def trending(self):
"""Return trending truths."""

Expand Down