DocNow / twarc

A command line tool (and Python library) for archiving Twitter JSON
https://twarc-project.readthedocs.io
MIT License
1.36k stars 255 forks source link

Support for Spaces API #567

Open igorbrigadir opened 2 years ago

igorbrigadir commented 2 years ago

Twitter Spaces are temporary audio chat rooms. The APIs for spaces allow you to retrieve and list them, and they have recently added the ability to record them, which is of interest to archiving - so twarc2 should support the spaces APIs that have useful data. For example:

https://developer.twitter.com/en/docs/twitter-api/spaces/search/api-reference/get-spaces-search

twarc2 spaces search "foo" output.json

https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-id

twarc2 spaces 12345 

or https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces

twarc2 spaces "12345,67890"

or

twarc2 spaces input.txt output.txt

or https://developer.twitter.com/en/docs/twitter-api/spaces/lookup/api-reference/get-spaces-by-creator-ids

twarc2 spaces --user-ids "123,456,789" output.json

(these are just suggestions)

edsu commented 2 years ago

This sounds like a useful thing to add @igorbrigadir. The interface makes me think that perhaps twarc2 stream-rules list should be twarc2 stream-rules.

igorbrigadir commented 2 years ago

I marked this "good first issue" but this is a big chunk of work, there are multiple endpoints to implement and the command line isn't set in stone either - so there's likely a bit of work to do just figuring stuff out first.