-
-
Notifications
You must be signed in to change notification settings - Fork 45
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: Implement Tweets:Volume streams endpoint #148
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! :)
Hey @myConsciousness, thanks again for this great wrapper of the v2 api :)
Where should I add examples to? The |
Codecov Report
@@ Coverage Diff @@
## main #148 +/- ##
==========================================
- Coverage 84.44% 83.27% -1.17%
==========================================
Files 43 43
Lines 527 568 +41
==========================================
+ Hits 445 473 +28
- Misses 82 95 +13
Continue to review full report at Codecov.
|
Hi @robertodoering , I've seen a few differences and this is a great implementation! :) And thanks for your feedback, I'm also very glad to welcome you as a pioneer of the Twitter API library in the Dart language.
Yes, Also it's almost empty now, but I plan to create the following repository that will manage examples of this library's use for each endpoint.
Okay, I'll check your pull request when I can touch my laptop, thank you! :) |
/// ## Reference | ||
/// | ||
/// - https://developer.twitter.com/en/docs/twitter-api/tweets/volume-streams/api-reference/get-tweets-sample-stream | ||
Future<Stream<TweetData>> volumeStreams({int? backfillMinutes}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the expansions
parameter is missing, so I add List<TweetExpansion>? expansions
:)
/// ## Reference | ||
/// | ||
/// - https://developer.twitter.com/en/docs/twitter-api/tweets/volume-streams/api-reference/get-tweets-sample-stream | ||
Future<Stream<TweetData>> volumeStreams({int? backfillMinutes, List<TweetExpansion>? expansions}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also please let me fix method name to connectVolumeStreams
, because there are other Stream-related endpoints, but I intend to unify the prefixes of those endpoints with connect
:)
Thanks for your contribution @robertodoering ! 🚀 |
bors merge |
1. Description
This PR adds support for streamed responses and implements the Volume streams endpoint.
To handle the streamed responses, we can use the send method on http requests.
Since they return a StreamedResponse (rather than a Response), some changed were done to the
TwitterException
to allow also handling exceptions for streamed responses.The endpoint methods then just return a
Future<Stream<T>>
, which the user can handle like any other stream.E.g.:
1.1. Checklist
fix:
,feat:
,docs:
etc).docs
and added dartdoc comments with///
.examples
.1.2. Breaking Change
1.3. Related Issues
Closes #14