Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/lrmn7/randomcats
- Owner: lrmn7
- Created: 2023-08-31T07:49:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-31T07:49:50.000Z (over 1 year ago)
- Last Synced: 2024-05-01T22:38:02.290Z (8 months ago)
- Topics: cat, cats, random-cat
- Language: Python
- Homepage: http://lrmn.is-a.dev/randomcats/
- Size: 1.14 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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