A script to update the status of live streams listed in the 2020 George Floyd Protest Tracker by twitch.tv/woke.
These tools use HTML scraping and hacks to get rapid information out of streaming websites with heterogeneous APIs. The methods employed will become stale over time.
- Run
npm install
- Create a service account and grant it edit access to the sheet.
- Save the service account JSON key as "creds.json" in this directory.
- Get a YouTube API Key if you'd like to monitor YouTube live streams.
This script checks links in the spreadsheet to determine if streams are live or offline. It works for the following services:
- YouTube (requires API key)
- Facebook Live
- Twitch.tv
- Periscope
A browser window will open and automatically load up stream URLs. You will need to fill in CAPTCHAs occasionally.
UPDATE_SECONDS=<age in seconds to consider check stale> CHECK_INTERVAL=<seconds between individual site checks> SLEEP_SECONDS=30 SHEETS='<sheets id from url>,<tab name 1>,<tab name 2>' PREV_STREAMS_SHEET_ID=<sheets id from url> PREV_STREAMS_TAB_NAME=<tabname> STREAM_EXPIRE_SECONDS=14400 YT_API_KEY=... IG_USER=... IG_PASS=... npm start
SHEET_ID=<sheets id from url> TAB_NAME=... npm run twitch-urls
To set up Twitter bot:
- Create a new Twitter app key, setting callback URL to http://localhost:3000/callback.
- Authenticate with Twitter:
- Run
node ./scripts/setupTwitter.js CONSUMER_KEY CONSUMER_SECRET > ../twitter-creds.json
and open http://localhost:3000 in a web browser. - Click the link and authorize your Twitter app.
- Run
FROM_SHEETS='<sheets id from url>,<tab name 1>,<tab name 2>' TO_SHEET_ID=<sheets id from url> TO_TAB_NAME=... FLAGGED_SHEET_ID=<sheets id from ulr> FLAGGED_TAB_NAME=... PUBLISHED_COL_NAME=... VETTED_COL_NAME=... ANNOUNCE_WEBHOOK_URL=<webhook url from discord> ANNOUNCE_DETAILS_WEBHOOK_URL=<webhook url from discord> SLEEP_SECONDS=30 npm run link-publisher