Skip to content

jlevy-io/moontimers-reddit-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌕MoonTimers Reddit Bot

This is the backend code for the 🌕MoonTimers Reddit comment bot

The app listens to multiple subreddits for the following comment triggers:

!moontimer or !moontimers

If the post has been flaired as "DD" and the post ID has not already been added to the MoonTimers database, it will be added and create a new timer.

Current Subreddit List

The subs currently streaming are:

Installation & Local Development

Download the repo and:

$ npm install

You will need a Reddit account to create an application token in order to get OAuth access to the Reddit API - Link

There is a great tool here to easily generate your refresh token

Create a .env file in the project root and enter the following variables:

NODE_ENV=development
CLIENT_ID=your-reddit-app-client-id
CLIENT_SECRET=your-reddit-app-client-secret
REFRESH_TOKEN=your-oauth-refresh-token

You can change NODE_ENV to production for less logging

Deployment

I use the incredible PM2 package for deploying this app.

$ npm install pm2 -g

then from the project root:

$ pm2 start ./src/app.js

That's it, the bot is running!

You can open a terminal and use the following command to see the live logs:

$ pm2 logs app --lines 100

About

A Reddit bot that adds DD posts to the Moontimers.com website

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published