nobody.live

View twitch streamers with zero viewers at nobody.live

https://github.com/jkingsman/nobody.live

Science Score: 39.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.9%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

View twitch streamers with zero viewers at nobody.live

Basic Info
  • Host: GitHub
  • Owner: jkingsman
  • License: mit
  • Language: JavaScript
  • Default Branch: main
  • Homepage: https://nobody.live
  • Size: 5.14 MB
Statistics
  • Stars: 101
  • Watchers: 5
  • Forks: 8
  • Open Issues: 0
  • Releases: 0
Created over 5 years ago · Last pushed over 1 year ago
Metadata Files
Readme Contributing License Citation

README.md

nobody.live

Architecture

A worker script (scanner.py) loops through the Twitch API's list of streams and spins until it inserts all streamers it finds matching the search criteria (default zero viewers), then it starts again. These stale streams are pruned after a fresh reload occurs on the assumption that someone will view them and then they won't have zero viewers any more so should not be served for too long; we'll pick them back up on the next load if they're still viewerless.

Environment variables needed for both scanner and app:

  • NOBODY_HOST: the database host
  • NOBODY_DATABASE: the database name
  • NOBODY_USER: the database user
  • NOBODY_PASSWORD: the database password

Environment variables to be set for the scanner only:

  • CLIENT_ID: Your Twitch application client ID (found at https://dev.twitch.tv/console)
  • CLIENT_SECRET: Your Twitch application client secret (found at https://dev.twitch.tv/console)

Meanwhile, the Sanic app in app.py serves the index and the endpoint to get a random streamer.

Note that the database schema makes use of slightly unusual extensions, namely pg_trgm (trigram indices) and tsm_system_rows. You may need to install your operating system's flavor of postgresql-contrib in order for them to work correctly. Also, you may need to grant your service user superuser permissions OR remove the extension creation calls from the db_utils.py migration block.

Getting Up and Running

  • Install and start Postgres with a created database
  • Run the stream fetcher (e.g. python scanner.py). This will need to run continuously. Be sure to include your database credentials in the environment variables. This also performs the initial database schema migration; additional modifications to the schema may require dropping tables/etc. See db_utils.py for the exact schema.
  • Run the server app (python app.py). Be sure to include your database credentials in the environment variables.

This is obviously not production ready; you'll need to make sure all services are running as daemons (an example supervisord config is included in etc) and that your Sanic app is running safely (e.g. behind gunicorn/nginx/pick your poison).

Dependencies

Update direct dependencies in requirements.in; use pip-compile to compile them down to requirements.txt if you update them.

Components

Cite this work

If you reference Nobody.live in a paper, check out the CITATION.cff file for the correct citation.

bibtex @misc{Nobody.live, url={https://nobody.live/}, journal={Nobody.live}, publisher={Jack Kingsman}, author={Kingsman, Jack}, year={2020}, month={Nov}, doi="10.13140/RG.2.2.15356.55682", note={{\url{https://github.com/jkingsman/Nobody.live}}} }

Owner

  • Name: Jack Kingsman
  • Login: jkingsman
  • Kind: user
  • Location: United States

All work here is mine, and not my employer's. Like my work? Donate $5 to pay for a week of server time for one of my projects! https://ko-fi.com/jackkingsman

GitHub Events

Total
  • Watch event: 3
  • Push event: 2
Last Year
  • Watch event: 3
  • Push event: 2

Dependencies

requirements.in pypi
  • Flask ==1.1.2
  • asyncpg ==0.24.0
  • black ==22.3.0
  • gunicorn ==20.0.4
  • psycopg2 ==2.9.1
  • pylint ==2.7.4
  • python-dateutil ==2.8.2
  • requests ==2.24.0
  • sanic ==21.12.1
requirements.txt pypi
  • aiofiles ==0.7.0
  • astroid ==2.6.6
  • asyncpg ==0.24.0
  • black ==22.3.0
  • certifi ==2021.10.8
  • chardet ==3.0.4
  • click ==8.0.3
  • flask ==1.1.2
  • gunicorn ==20.0.4
  • httptools ==0.3.0
  • idna ==2.10
  • isort ==5.9.3
  • itsdangerous ==2.0.1
  • jinja2 ==3.0.2
  • lazy-object-proxy ==1.6.0
  • markupsafe ==2.0.1
  • mccabe ==0.6.1
  • multidict ==5.2.0
  • mypy-extensions ==0.4.3
  • pathspec ==0.9.0
  • platformdirs ==2.5.2
  • psycopg2 ==2.9.1
  • pylint ==2.7.4
  • python-dateutil ==2.8.2
  • requests ==2.24.0
  • sanic ==21.12.1
  • sanic-routing ==0.7.2
  • six ==1.16.0
  • toml ==0.10.2
  • tomli ==2.0.1
  • typing-extensions ==4.2.0
  • ujson ==4.2.0
  • urllib3 ==1.25.11
  • uvloop ==0.16.0
  • websockets ==10.1
  • werkzeug ==2.0.2
  • wrapt ==1.12.1