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

feat: extend twitter api - initial commit #17

Merged
merged 11 commits into from
Jan 27, 2025
Merged

Conversation

alvin-reyes
Copy link
Contributor

@alvin-reyes alvin-reyes commented Jan 22, 2025

Description

This PR extends the twitter api based on the requirements here https://github.com/masa-finance/issues/issues/217.

This also bumps the tee-worker to use masa's own fork of twitter-scraper.

@alvin-reyes alvin-reyes self-assigned this Jan 22, 2025
@alvin-reyes alvin-reyes marked this pull request as ready for review January 22, 2025 22:01
@alvin-reyes alvin-reyes requested review from a team, mcamou, mudler and restevens402 and removed request for a team January 22, 2025 22:01
mcamou
mcamou previously requested changes Jan 24, 2025
Copy link
Contributor

@mcamou mcamou left a comment

Choose a reason for hiding this comment

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

Some thoughts on the design of the API, and why include count when we don't have a chance to paginate. Also some additional points.

Regarding the tests, I've added some suggestions. In short:

  • Always check the error after unmarshalling. This will catch some breaking changes in the Twitter schema (not all, but something is better than nothing).

  • Use Expect(x).ToNot(BeEmpty()) instead of Expect(len(x)).ToNot(BeZero()). This should result in slightly better error messages if the test fails.

There are one or two additional suggestions in the tests. I would also recommend, if you can, changing the other tests in thtwitter_test.go accordingly.

go.mod Show resolved Hide resolved
internal/jobs/twitter_test.go Show resolved Hide resolved
internal/jobs/twitter_test.go Show resolved Hide resolved
internal/jobs/twitter_test.go Outdated Show resolved Hide resolved
internal/jobs/twitter_test.go Show resolved Hide resolved
internal/jobs/twitter_test.go Outdated Show resolved Hide resolved
internal/jobs/twitter_test.go Outdated Show resolved Hide resolved
internal/jobs/twitter.go Outdated Show resolved Hide resolved
internal/jobs/twitter.go Show resolved Hide resolved
internal/jobs/twitter.go Outdated Show resolved Hide resolved
@alvin-reyes alvin-reyes requested a review from mcamou January 26, 2025 21:26
@alvin-reyes alvin-reyes dismissed mcamou’s stale review January 26, 2025 21:27

resolved the review pointed on the latest commit.

@alvin-reyes alvin-reyes merged commit 5821384 into main Jan 27, 2025
2 checks passed
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