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

Pull Statuses (created after datetime) #22

Merged
merged 16 commits into from
Oct 2, 2023
Merged

Conversation

s2t2
Copy link
Contributor

@s2t2 s2t2 commented Sep 2, 2023

Updates created_after parameter of the Api#pull_statuses function to be a datetime, instead of a date, so we can collect statuses posted later in the same day as some previously collected status. Makes this an optional parameter, so default will pull entire timeline.

We could alternatively consider using an approach based on status identifiers instead of status timestamps (assuming the identifiers are in order of their creation). Implements a new optional since_id parameter for this purpose.

Implements automated testing to ensure this functionality works.


params = {}
id = self.lookup(username)["id"]

This comment was marked as resolved.

os.getenv("TRUTHSOCIAL_PASSWORD"),
os.getenv("TRUTHSOCIAL_TOKEN"),
)
api = Api()

This comment was marked as resolved.

@milesmcc milesmcc self-requested a review October 1, 2023 02:49
@@ -80,6 +82,36 @@ truthbrush user HANDLE

Contributions are encouraged! For small bug fixes and minor improvements, feel free to just open a PR. For larger changes, please open an issue first so that other contributors can discuss your plan, avoid duplicated work, and ensure it aligns with the goals of the project. Be sure to also follow the [code of conduct](CODE_OF_CONDUCT.md). Thanks!

Development setup (ensure you have [Poetry](https://python-poetry.org/) installed):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s2t2 made a few small changes to the README here — head's up.

Copy link
Collaborator

@milesmcc milesmcc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for these changes! I pushed a few commits myself to get things working, as we also need to change cli.py for these updates to work.

Main comment is about verbose logging; could we use logger.debug or something comparable?

Thanks again!

truthbrush/api.py Outdated Show resolved Hide resolved
truthbrush/api.py Outdated Show resolved Hide resolved
truthbrush/cli.py Show resolved Hide resolved
truthbrush/api.py Show resolved Hide resolved
README.md Show resolved Hide resolved
@s2t2 s2t2 changed the title Pull Statuses Pull Statuses (created after datetime) Oct 2, 2023
@s2t2 s2t2 requested a review from milesmcc October 2, 2023 01:28
@milesmcc milesmcc merged commit 1639259 into stanfordio:main Oct 2, 2023
@milesmcc
Copy link
Collaborator

milesmcc commented Oct 2, 2023

Thanks @s2t2!

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

Successfully merging this pull request may close these issues.

2 participants