Created
August 29, 2011 21:30
-
-
Save stefanoverna/1179460 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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