Module: YaCan::YahooAPI
- Included in:
- YaCan
- Defined in:
- lib/yacan/yahoo_api.rb
Defined Under Namespace
Classes: AppIDUnconfiguredError
Constant Summary
collapse
- @@host =
'jlp.yahooapis.jp'
- @@appid =
nil
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.appid=(appid) ⇒ Object
10
11
12
|
# File 'lib/yacan/yahoo_api.rb', line 10
def appid=(appid)
@@appid = appid
end
|
.request(path, params = {}) ⇒ Object
14
15
16
17
18
19
20
|
# File 'lib/yacan/yahoo_api.rb', line 14
def request(path, params={})
params['appid'] = appid
Net::HTTP::Proxy(YaCan.proxy_host, YaCan.proxy_port).start(@@host){ |http|
res = http.post(path, params.map{ |k,v| "#{URI.encode(k)}=#{URI.encode(v)}"}.join('&'))
res.body
}
end
|
Instance Method Details
#analyze(*args) ⇒ Object
22
23
24
|
# File 'lib/yacan/yahoo_api.rb', line 22
def analyze(*args)
raise NotImplementedError
end
|