Skip to content

Instantly share code, notes, and snippets.

@niquola
Created November 12, 2011 02:04
Show Gist options
  • Save niquola/1359899 to your computer and use it in GitHub Desktop.
Save niquola/1359899 to your computer and use it in GitHub Desktop.
send tweet message on commit
#!/usr/bin/env ruby
#
# An example hook script that is called after a successful
# commit is made.
#
# To enable this hook, rename this file to "post-commit".
message = `git log --pretty=format:'%an: %s (%h)' -n 1`
require 'rubygems'
require 'twitter'
Twitter.configure do |config|
config.consumer_key = '6PXyQZx74PfC1c3wQSGyA'
config.consumer_secret = 'bbyuzHqjgjSZZGuH3fjz3YzkHjTE5qN8l2Ac7VJ0'
config.oauth_token = '410293785-iQLTgYt5cfibbffZnA3VKLMIy47wHCa9XYtyL8Ge'
config.oauth_token_secret = 'x1VamBt2uu4bX3HOA9ehaOeR868BSOFyFA7eRv1ig'
end
Twitter.update(message)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment