Code Monkey home page Code Monkey logo

nobody.live's Introduction

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:

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

nobody.live's People

Contributors

jkingsman avatar jkingsman-atl avatar painfulsine9038 avatar pilattebe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nobody.live's Issues

Increase interval between stats requests

Because you've set this to hit your endpoint every 250ms, this will cause unnecessary data transfer for people who have internet data caps (because they're sending HTTP requests 4 times for every second that they're on your web page), and will increase your monthly bills for hosting this (because your Redis instance is getting hit 4 times per second for every user looking at your website). The more people who look at your site (and the more time they spend on your site), the faster your hosting bills are going to grow.

If you must have this, I'd recommend caching it at the server layer once per minute. That way, the endpoint will return the latest value instead of ask Redis every time it gets the request. I don't think your users will get any value from seeing those numbers fluctuate so quickly.

}, 250);

Create filtering system

Streams should be filterable by game being played. This will most likely require a rework of the storage layer to something queryable (mongo?).

Language filtering?

I have noticed the stream shows the language (almost always english). I am wondering if you could add a language filter to the interface, though I have no idea whether the Twitch API let you filter on that basis.

Thank you for https://nobody.live/ , it is really enjoyable.

Some suggestions

Hi, this app is a very good idea however it would be nice to have the option of blacklisting games i dont want to see, non english streams, streams that just went live and have 0 viewers because of that, etc.. Just having a few filters would be really nice. Also streams that appear on your website already have like 10 viewers because of other nobody.live visitors i assume so maybe try to solve that somehow. Otherwise cool idea.

Filter out option

I, along with some of my friends, have been using nobody.live for quite some time to get to interact with low-viewer streams and have met quite a few interesting people. However, one of the things that we've noticed is that most of the time while refreshing thumbnails, the vast majority of them are from a few of the most popular games (Fortnite, Warzone) or streams which are just starting up. Seeing as how we can see the game ID that the Twitch API provides when hovering over a stream thumbnail, it'd be very nice to be able to filter categories out, especially now that you've implemented filtering by category.

Not sure if Twitch also provides the info on how long a stream has been up, but in case they do it'd be nice to be able to filter out streams which are just starting up too, seeing as we've encountered quite a few "starting soon" streams which quickly populate with a lot of viewers.

Thanks for the great website and the work that you put in!

Cannot login. Authentication fails.

Hey! I'm new to github so i don't really know how to write issues, so I'm gonna put it in English. In order to chat in the website itself, we have to first log in which pops up another window, after you login , input the 2FA, you will get a message saying you can close the window, then you close the window, and login fails in the nobody.live window and you can't do anything.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.