halcy / Mastodon.py

Python wrapper for the Mastodon ( https://github.com/mastodon/mastodon/ ) API.
MIT License
876 stars 150 forks source link

Streaming public posts originating from other servers #334

Closed jeafreezy closed 1 year ago

jeafreezy commented 1 year ago

Thank you for the wonderful library!

I have a bot that boost posts with a specific hashtag. It works fine using the stream_public(), however, It usually miss some posts from other servers.

Please is there a way I can provide list of servers I would like to plug to and stream posts from them, for my bot to boost?

There seems to be an endpoint for that on the official docs, but I can't find a way to do that with the library.

https://docs.joinmastodon.org/methods/streaming/ image

Thanks

halcy commented 1 year ago

It should ideally not be missing those posts in general, though: The stream_* function make no guarantee that the stream will contain everything in case of reconnect. If you absolutely want every single post, you'd have to add special handling on reconnect to make it so. This is a tad involved for base functionality, but if you do write code for that, maybe it would be neat to have it available as a helper in some form.

About those endpoints: Seems like quite a few are missing from the library. Thanks for the report, I will add those.

jeafreezy commented 1 year ago

Thank you!

On Sun, Apr 23, 2023, 5:07 PM Lorenz Diener @.***> wrote:

It should ideally not be missing those posts in general, though: The stream_* function make no guarantee that the stream will contain everything in case of reconnect.

About those endpoints: Seems like quite a few are missing from the library. Thanks for the report, I will add those.

— Reply to this email directly, view it on GitHub https://github.com/halcy/Mastodon.py/issues/334#issuecomment-1519100813, or unsubscribe https://github.com/notifications/unsubscribe-auth/AITKENELL4WJ3LDZTQ2KR7LXCVHTLANCNFSM6AAAAAAW4GEZYE . You are receiving this because you authored the thread.Message ID: @.***>

halcy commented 1 year ago

Actually - some of these are available only via the websocket based API which we currently don't support. May add that eventually. For now, the one i can add is public/remote

jeafreezy commented 1 year ago

I think remote and public will be awesome 👌

On Sun, Apr 23, 2023, 5:13 PM Lorenz Diener @.***> wrote:

Actually - some of these are available only via the websocket based API which we currently don't support. May add that eventually. For now, the one i can add is public/remote

— Reply to this email directly, view it on GitHub https://github.com/halcy/Mastodon.py/issues/334#issuecomment-1519101973, or unsubscribe https://github.com/notifications/unsubscribe-auth/AITKENCZADAE3CG52P5N3QTXCVIJVANCNFSM6AAAAAAW4GEZYE . You are receiving this because you authored the thread.Message ID: @.***>

halcy commented 1 year ago

Fixed in master