Program to monitor twitter spaces for when a given user speaks in or hosts a twitter space.
Project description
Stay up to date with Twitter Spaces
Explination
This tool uses Selenium Firefox webdriver to grab the spaces ID's which a specified user is speaking at or hosting. There are currently no unauthenticated api endpoints (both public or private) which allow you to view when a user is speaking in a space. For this reason, this library requires a twitter login to run.
It runs selenium in headless mode and scrapes from a users profile page.
The original motivation for this tool is to monitor users and make trades based on what they say in twitter spaces, but saw others online asking how to get these space ids so decided to share! Hope you enjoy.
Installation
To install, you must have firefox downloaded on your computer
pip install Twitter-Spaces-Speaker-Lookup
Create a blank file called "login.json"
Open up firefox and log into twitter and navigate into your profile page.
Download a cookie grabbing extension (I use EditThisCookie2 for firefox) and copy all cookies.
Paste these cookies into login.json and you're good to go!
Example:
ts = Twitter_Spaces()
// Create a callback function which takes in a twitter_spaces_id to be run for each space the target user joins or
def example_callback(spaces_id):
print(f"New Space: '{spaces_id}'!")
monitor_user = 'elonmusk'
ts.monitor_user_for_spaces(monitor_user, example_callback)
// Whenever the monitored user speaks at or hosts a twitter space, your callback function will be called.
💙 Contributing
PR's are welcome !
Found a Bug ? Create an Issue.
💖 Like this project ?
Leave a ⭐ If you think this project is cool.
👨💻 Author
Chris Piper
🍁 Licence
ISC
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for Twitter-Spaces-Speaker-Lookup-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5893d433141142f29e1675f04045ca9c98007a293ff27fa272daac77c7119867 |
|
MD5 | 9fd6fcbbddb2b4eba8dd24c3561850c3 |
|
BLAKE2b-256 | c39f498f40c24fd37d9804ecaca7f7a5702cc33f22133f3764c4995cb19aeec3 |
Hashes for Twitter_Spaces_Speaker_Lookup-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58847c9f0c009e5bde7e79ae2b7a1b73c22f95d1bb53194cd982623357d38ba1 |
|
MD5 | d5102b85f53a4465309a5f64b7d8e125 |
|
BLAKE2b-256 | f0d9d57191e5dda3898c178e4092fd67d9714e27def53eff0dcdad22db2431b4 |