Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/flashblaze/reddit-fact
A simple implementation of Reddit API
https://github.com/flashblaze/reddit-fact
react reactjs reddit reddit-api snoowrap tailwindcss
Last synced: 27 days ago
JSON representation
A simple implementation of Reddit API
- Host: GitHub
- URL: https://github.com/flashblaze/reddit-fact
- Owner: flashblaze
- License: mit
- Created: 2019-07-26T07:52:03.000Z (over 5 years ago)
- Default Branch: no-redux
- Last Pushed: 2023-01-04T05:26:08.000Z (almost 2 years ago)
- Last Synced: 2024-04-14T16:46:25.227Z (8 months ago)
- Topics: react, reactjs, reddit, reddit-api, snoowrap, tailwindcss
- Language: CSS
- Homepage: https://reddit-fact.netlify.com/
- Size: 4.22 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# reddit-fact
A simple React app which displays a random fact from Reddit using their API.
:tada: Site is live [here](https://reddit-fact.netlify.com) :tada:
## How to use
1. Create and register your **script** app [here](https://www.reddit.com/prefs/apps)
2. Clone the repo and go into it. Run `npm install` to install the dependencies.
3. Create a `config` folder in `src` directory and create a `data.js` file in it.The directory structure is something like this:
```
project
|
|
|-src
|
|
|-config
|data.js
```4. Create a requester like so and export it:
```js
const snoowrap = require('snoowrap');const r = new snoowrap({
userAgent: 'put your user-agent string here',
clientId: 'put your client id here',
clientSecret: 'put your client secret here',
username: 'put your username here',
password: 'put your password here'
});export default r;
```For more info, you can refer [this](https://github.com/not-an-aardvark/snoowrap#examples)