Created
June 15, 2011 22:53
-
-
Save rochefort/1028328 to your computer and use it in GitHub Desktop.
official_notification.rb
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 'net/http' | |
require 'json' | |
url = 'search.twitter.com' | |
path = '/search.json?q=人事異動&locale=ja&rpp=100' | |
Net::HTTP.start(url) do |http| | |
json = JSON.parse(http.get(path).body) | |
puts json['results'].map{ |r| "#{r['from_user']}: #{r['text'].gsub(/[\r|\n]/, ' ')}" } | |
end | |
#json = JSON.parse(Net::HTTP.get(url, path)) | |
#puts json['results'].map{ |r| "#{r['from_user']}: #{r['text'].gsub(/[\r|\n]/, ' ')}" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment