Skip to content

Instantly share code, notes, and snippets.

@cduruk
Created October 2, 2009 04:07
Show Gist options
  • Save cduruk/199454 to your computer and use it in GitHub Desktop.
Save cduruk/199454 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'httparty'
require 'crack'
class Wherein
include HTTParty
base_uri 'http://wherein.yahooapis.com'
def initialize(apikey)
self.class.default_params({:appid => apikey})
end
def post(text)
self.class.post('/v1/document', :body => {:documentContent => text, :documentType => 'text/plain', :outputType => 'xml'})
end
end
puts Wherein.new('RgQciF3V34F8ZY7oiMZsbt6AP49KryxhhKexmcLdzoILr7LoRoOgQ2vFGSpkW7nRqR8').post('Pittsburgh')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment