Skip to content

Instantly share code, notes, and snippets.

@stefanoverna
Created August 29, 2011 21:30
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 stefanoverna/1179460 to your computer and use it in GitHub Desktop.
Save stefanoverna/1179460 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'twitter'
require 'yaml'
Twitter.configure do |config|
config.consumer_key = "XXX"
config.consumer_secret = "XXX"
config.oauth_token = "XXX"
config.oauth_token_secret = "XXX"
end
client = Twitter::Client.new
puts "Stream state"
puts client.user_timeline("socialsuitetest").map(&:text).to_yaml
puts "*" * 100
messages = (0..3).map {
text = rand(36**15).to_s(36)
puts "- Posting message #{text}..."
client.update(text)
}
puts "*" * 100
sleep(15)
puts "Stream state"
puts client.user_timeline("socialsuitetest").map(&:text).to_yaml
puts "*" * 100
messages.each { |message|
puts "- deleting #{message.text}..."
client.status_destroy message.id
}
puts "*" * 100
sleep(15)
puts "Stream state"
puts client.user_timeline("socialsuitetest").map(&:text).to_yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment