3

Previously these folks promised a release of their implementation of Bing search for their site at the following article: http://www.globalnerdy.com/2009/06/29/learnhub-powered-by-rails-searches-with-bing/

Is anyone familiar with a Ruby or Rails lib that would facilitate site search with Bing? Google just hasn't been a good match so far with their site search and a search with MS Bing, surprisingly, seems to be a much better solution.

Otherwise, an example of how to accomplish this, even without a lib and directly using the API, would be much appreciated.

ylluminate
  • 12,102
  • 17
  • 78
  • 152

1 Answers1

2

While not a custom site search per se, you should be able to use RBing for accessing Bings search API. There's an introductory tutorial over at http://9astronauts.com/code/ruby/rbing/

To make it work like a site search, simply append a site:example.com to your queries and it will only return results from that domain. For example:

bing = RBing.new("YOURAPPID")
query = "something interesting"
results = bing.web("#{query} site:stackoverflow.com")
puts results.web.results[0].title
=> "javascript - How to illuminate a browser window/tab when something ..."
Jakob S
  • 19,575
  • 3
  • 40
  • 38
  • This is deprecated: http://www.bing.com/community/site_blogs/b/developer/archive/2012/05/17/bing-developer-update-2.aspx – sparkle Dec 01 '12 at 14:32
  • Yes and no. There is an RBing fork at https://github.com/travisp/rbing with an Azure branch that works with Azure Data Marketplace rather than the old Bing API. `"YOURAPPID"` will have to be replaced with `"YOURACCOUNTKEY"` but that's about it. – Jakob S Dec 04 '12 at 10:15