elcamino / yboss Goto Github PK
View Code? Open in Web Editor NEWyboss is a ruby library for the Yahoo BOSS API (http://developer.yahoo.com/boss/search/)
License: BSD 3-Clause "New" or "Revised" License
yboss is a ruby library for the Yahoo BOSS API (http://developer.yahoo.com/boss/search/)
License: BSD 3-Clause "New" or "Revised" License
Not sure if yahoo has changed or there's a code issue, but I literally copied and pasted your sample code with my key and secret, I get a 403 forbidden. Thanks for any help.
Hi,
I'm pretty sure I'm doing everything right (your gem is pretty intuitive!) but I'm getting this error for every request using your sample code from the documentation:
503 Service Unavailable (YBoss::FetchError)
The offending code:
require 'yboss'
YBoss::Config.instance.oauth_key = '....'
YBoss::Config.instance.oauth_secret = '....'
res = YBoss.web('q' => 'tuscany')
Any ideas?
Thanks,
Martin
The response object has a #responsecode, implying that you might find a code other than 200 there.
But if the API returns a 5xx (say, because I didn't give it the right secret key), I don't get back a response with a 5xx responsecode... I get an exception raised.
Would it make more sense to make this not raise but return a non-200 response code? Or to make it a call option? Or to at least document in what cases one should expect an exception (of what class) to be raised?
1.9.3-p194 :006 > YBoss.spelling('q' => 'gruffaloe')
=> #<YBoss::Spelling::Result:0x0000000b6abdb8 @responsecode="200", @start="0", @count="1", @totalresults="1", @items=[#<YBoss::Result::Base::Item:0x0000000b6b7028 @data={"suggestion"=>"gruffalo"}>]>
1.9.3-p194 :007 > YBoss.spelling('q' => "women's rights")
# YBoss::FetchError: Got error while fetching http://yboss.yahooapis.com/ysearch/spelling?format=json&q=women's%20rights?format=json&oauth_consumer_key=dj0yJmk9YWJuYVZlOHZ1YTBKJmQ9WVdrOVEwdHRUVzlXTkdzbWNHbzlOamcyTWpVNE1qWXkmcz1jb25zdW1lcnNlY3JldCZ4PTU2&oauth_nonce=93ab3ec716&oauth_signature=8CrcKi1CuPeDRMAvhVK7bdxs1x0%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1362501074&oauth_version=1.0&q=women's%20rights: 401 Authorization Required
from /home/rochkind/.rvm/gems/ruby-1.9.3-p194/gems/yboss-0.2.0/lib/yboss/base.rb:62:in `block in fetch'
from /home/rochkind/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:745:in `start'
from /home/rochkind/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/http.rb:557:in `start'
from /home/rochkind/.rvm/gems/ruby-1.9.3-p194/gems/yboss-0.2.0/lib/yboss/base.rb:58:in `fetch'
from /home/rochkind/.rvm/gems/ruby-1.9.3-p194/gems/yboss-0.2.0/lib/yboss/base.rb:27:in `call'
from /home/rochkind/.rvm/gems/ruby-1.9.3-p194/gems/yboss-0.2.0/lib/yboss.rb:13:in `method_missing'
from (irb):7
from /home/rochkind/.rvm/rubies/ruby-1.9.3-p194/bin/irb:16:in `<main>'
I am getting the following error when i try to execute this code.
Zlib::BufError in JsonOutPutController#yahoo
This is my code.
YBoss::Config.instance.oauth_key = 'my_auth_key'
YBoss::Config.instance.oauth_secret = 'my_auth_secret'
res = YBoss.related('q' => 'gruffalo').
I am using Ruby 2 and Rails 4.
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.