Skip to content

Instantly share code, notes, and snippets.

@AJFaraday
Created March 28, 2011 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AJFaraday/890247 to your computer and use it in GitHub Desktop.
Save AJFaraday/890247 to your computer and use it in GitHub Desktop.
Twitter setup
# with twitter gem
# In my /app/models/event.rb
require 'twitter'
def tweet_about
@message = "\##{project.short_name} http://ideas-factory.co.uk/e/#{id} #{name} #{time.strftime("%a %d %b-%I:%M%P")}-#{desc}"
twit_init
@client.update(@message[0..136] + '...')
end
def twit_init
Twitter.configure do |config|
config.consumer_key = #consumer key
config.consumer_secret = #consumer secret
config.oauth_token = # oauth token
config.oauth_token_secret = # oauth secret
end
@client = Twitter::Client.new
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment