Skip to content

Instantly share code, notes, and snippets.

@adambair
Created March 19, 2009 18:44
Show Gist options
  • Save adambair/81994 to your computer and use it in GitHub Desktop.
Save adambair/81994 to your computer and use it in GitHub Desktop.
Git post-commit hook for Present.ly (presentlyapp.com)
#!/usr/bin/perl
# change your account, username, password, and group
# it'll run every time you commit (not push, mind you)
$account='account';
$username='username';
$password='password';
$group='group';
$git_text = `git log -n1 --pretty=format:"(%h) %s"`;
$git_long_text = `git log -n1 --stat`;
chomp $git_text;
$message = "d $group #commit $git_text";
$api="https://$account.presentlyapp.com/api/twitter/statuses/update.xml";
`curl $api -u $username:$password -d status="$message" -d paste_format='text' -d paste_text='$git_long_text'`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment