Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 1.48 KB

README.md

File metadata and controls

53 lines (38 loc) · 1.48 KB

This program is used for sending posts to twitter. It is being specialized for sending notification of svn/trac changes.

To use this you need to install simplejson and oauth2 which are both available easy_install or through many of the standard package managers.

Setup

Run CodeNotifier.py config and follow the prompts to create a configuration file. For the usage below it is assumed to be named /home/svn/CodeNotifier_config.py.

Usage

First you need to make sure simplejson and oauth2 are installed.

SVN

To use the svn mode add the following (or something like it) to your post-commit:

TWIT_HOOK="/usr/local/bin/CodeNotifier.py"
"$TWIT_HOOK" --config /home/svn/CodeNotifier_config.py svn "$REPOS" "$REV"

This will do nothing if it thinks the trac hook will fire.

TRAC

The trac mode is a bit harder to configure, but here are the tips to making it work.

  1. Add a line to /etc/aliases
twit_trac_submit: "|/usr/local/bin/twit_trac.sh"
  1. Add that email address to your smtp_always_cc in your conf/trac.ini as something like [email protected].

  2. Create a file /usr/local/bin/twit_trac.sh with the contents:

#!/bin/sh
cat - | /usr/local/bin/CodeNotifier.py --config /usr/local/bin/CodeNotifier_config.py trac

DEVELOPMENT / TESTING


cat trac_msg4 | ./CodeNotifier.py trac --debug --config ./CodeNotifier_config.py