Code Monkey home page Code Monkey logo

gist-notifications's Introduction

Gist Notifications

Send emails when new comments are made on your gists.

This is useful because Github does not currently send any notifications.

This script uses a file to keep track of the last run time, and has been designed to run alone without any extra gems.

Usage

With some defaults:

$ ./notify_of_new_gist_comments github_username recipient_email sender_email email_password

This will notify for public gists only, will use smtp.gmail.com to send your emails, and use the file /tmp/gist-notifications-last-run-time to store the last run time in. It's a good idea to create a separate email account for sending emails, so you're not leaving your personal email password lying around in clear text.

To see comments on private gists that you have shared with others, you will need to create a Github OAuth token with the gist scope here, and pass the token in after the email_password.

With all args:

$ ./notify_of_new_gist_comments github_username recipient_email sender_email email_password github_auth_token smtp.gmail.com last_run_time_file_location

Installing with Launchd configuration

Update com.bethesque.gist-notifications.plist with appropriate values, and run the following:

cp notify_of_new_gist_comments /usr/local/bin/notify_of_new_gist_comments
chmod +x /usr/local/bin/notify_of_new_gist_comments
sudo mkdir /var/log/gist-notifications
sudo chown $USER:staff /var/log/gist-notifications
cp com.bethesque.gist-notifications.plist $HOME/Library/LaunchAgents/com.bethesque.gist-notifications.plist
launchctl load $HOME/Library/LaunchAgents/com.bethesque.gist-notifications.plist
launchctl start com.bethesque.gist-notifications

To update the launchd config:

launchctl unload $HOME/Library/LaunchAgents/com.bethesque.gist-notifications.plist && \
launchctl load $HOME/Library/LaunchAgents/com.bethesque.gist-notifications.plist && \
launchctl start com.bethesque.gist-notifications

Troubleshooting

If you get a Net::SMTPAuthenticationError, and you're sending with gmail, it may be because Google has some security checks around sending emails from new hosts. Try going to https://accounts.google.com/b/0/DisplayUnlockCaptcha, submitting, and then running the code again.

For launchd issues, try:

$ tail -f /var/log/system.log

Or

$ tail -f /var/log/gist-notifications/launchd.out

gist-notifications's People

Contributors

bethesque avatar

Watchers

James Cloos avatar Rajan Vijayan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.