Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lrmn7/randomcats

This is the source code of a simple website for showing various cat pictures/videos people have posted on reddit and which members have upvoted
https://github.com/lrmn7/randomcats

cat cats random-cat

Last synced: about 1 month ago
JSON representation

This is the source code of a simple website for showing various cat pictures/videos people have posted on reddit and which members have upvoted

Awesome Lists containing this project

README

        









This is the source code of a simple [website](https://lrmn.is-a.dev/randomcats) for showing various cat pictures/videos people have posted on reddit and which members have upvoted. How it works is that a python script ([gen.py](https://github.com/lrmn7/randomcats/blob/main/gen.py)) scrapes various cat posts in [these](https://github.com/msr8/cats/blob/main/subreddits.md) cat subreddits, and stores all the data in a JSON file called [files.json](https://github.com/lrmn7/randomcats/blob/main/docs/files.json). This contains information about the post ID, link to the post, number of upvotes, username of OP, etc. Then in [/random](lrmn.is-a.dev/randomcats/random), [script.js](https://github.com/lrmn7/randomcats/blob/main/docs/random/script.json) chooses a random image/video from the scraped data and displays it on the page. The various endpoints available are:


## /
Homepage. Contains an inroduction to the site as well as links to other resources/webpages

## /random
The main highlight of the site, shows a random cat image/video upon visiting/reloading the page

## /stats
Contains various statistics about the scraped data (such as distribution of upvotes and domains) in the form of interactive graphs

## /files.json
Contains all the scraped data in a human readable JSON format

## /files.min.json
Contains the scraped data in a minified way, is almost 4x smaller than files.json