Skip to content

A reddit bot that scans comments for 'note to self' and replies with a reminder one day later.

Notifications You must be signed in to change notification settings

Anaphase/note-to-self-bot

Repository files navigation

note-to-self-bot

NTSB is a reddit bot that scans comments for 'note to self' and replies with a reminder one day later.

The bot uses reddit-stream to scan comments, MongoDB/Mongoose to save them locally, and raw.js to send comment replies. The bot uses socket.io to communicate with the frontend dashboard and Pushover to notify your phone when it picks up a comment. NTSB runs forever using Forever.

Bot

ntsb-bot.coffee performs the scanning and database operations.

API

ntsb-api.coffee provides a REST-ful API for CRUD operations against the comment database.

Dashboard

dashboard/ contains a Brunch project that provides a front-end web application for easy comment monitoring and manipulation (via the API.) Here are some screenshots:

NTSB Dashboard Screenshot- Comment List NTSB Dashboard Screenshot - Edit Comment Modal

Usage

To run the bot, you'll need to install Brunch, Bower, and MongoDB. Then follow these steps:

  1. Start a MongoDB database:
$ mongod --config mongodb.conf

Here's a good mongodb.conf:

fork = true
bind_ip = 127.0.0.1
port = 27017
quiet = true
dbpath = /data/db
logpath = /var/log/mongodb/mongod.log
logappend = true
journal = true
  1. Install NPM packages for the backend:
$ cd note-to-self-bot
$ npm install
  1. Create lib/auth.coffee and supply your reddit and Pushover credentials:
module.exports =
  reddit:
    username: 'your-bot-name'
    password: 'your-password'
    app:
      id: 'reddit-app-id'
      secret: 'reddit-app-secret'
  pushover:
    user: 'pushover-user'
    token: 'pushover-token'

If you do not have a reddit app created, visit this page and create a new "script" application to obtain an app id & secret. Put whatever you want in "redirect uri" as it will not be used.

  1. Install NPM & Bower packages for the frontend:
$ cd dashboard
$ npm install && bower install
  1. Build the frontend:
$ brunch build -P
  1. Start the API server and bot:
$ cd ..
$ chmod +x backend.sh
$ ./backend.sh start api
$ ./backend.sh start bot
  1. Load the frontend by pointing your browser to the dashboard's public folder (probably http://localhost/note-to-self-bot/dashboard/public/)

Comments will appear in this list as the bot picks them up. You're free to edit the responses before the bot comments.

About

A reddit bot that scans comments for 'note to self' and replies with a reminder one day later.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published