Skip to content

Instantly share code, notes, and snippets.

@rochefort
Created June 15, 2011 22:53
Show Gist options
  • Save rochefort/1028328 to your computer and use it in GitHub Desktop.
Save rochefort/1028328 to your computer and use it in GitHub Desktop.
official_notification.rb
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