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.
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
.
First you need to make sure simplejson
and oauth2
are installed.
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.
The trac mode is a bit harder to configure, but here are the tips to making it work.
- Add a line to
/etc/aliases
twit_trac_submit: "|/usr/local/bin/twit_trac.sh"
-
Add that email address to your
smtp_always_cc
in yourconf/trac.ini
as something like[email protected]
. -
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
cat trac_msg4 | ./CodeNotifier.py trac --debug --config ./CodeNotifier_config.py