Skip to content

Instantly share code, notes, and snippets.

@tigawa
Created September 28, 2013 09:13
Show Gist options
  • Save tigawa/6740200 to your computer and use it in GitHub Desktop.
Save tigawa/6740200 to your computer and use it in GitHub Desktop.
module Yahoo
class Proofreading
require 'nokogiri'
def self.make(sentence)
conn = Faraday.new(:url => 'http://jlp.yahooapis.jp') do |builder|
builder.request :url_encoded
builder.response :logger
builder.adapter :net_http
end
res = conn.get '/KouseiService/V1/kousei', {
:appid => "dj0zaiZpPTFlV1FCTkFsTmJ2TCZzPWNvbnN1bWVyc2VjcmV0Jng9NDI-",
:sentence => sentence,
}
Nokogiri::XML(res.body)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment