A simple React app which displays a random fact from Reddit using their API.
🎉 Site is live here 🎉
-
Create and register your script app here
-
Clone the repo and go into it. Run
npm install
to install the dependencies. -
Create a
config
folder insrc
directory and create adata.js
file in it.The directory structure is something like this:
project | | |-src | | |-config |data.js
-
Create a requester like so and export it:
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