Project

gnib

0.0
No commit activity in last 3 years
No release in over 3 years
Gnib provides interfaces for Bing Search API version 2.0
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 0

Runtime

 Project Readme

Gnib

Gnib is a Ruby interface for Microsoft Bing Search API.

Build Status

Installation

Rails 3.x users

For Rails 3.x projects, add the following line to your Gemfile.

gem 'gnib'

All Others

Install gnib gem with Rubygems.

$ gem install gnib

Usage

Obtain your Application key from [here] (https://ssl.bing.com/webmaster/developers/appids.aspx)

Standalone

Gnib.config.application_id = 'YOUR_APP_ID'
results = Gnib::Search.get('Great', :sources => [:image])

Rails 3.x

In initializers like config/initializers/gnib.rb, configure Gnib with your Application key.

Gnib.config.application_id = 'YOUR_APP_ID'

You can search items in your actions.

@results = Gnib::Search.get('hello world', :sources => [:web, :image])

(Not so much) More Complicated Usage Example

Gnib::Search#get is a helper function implemented to maximize usability of the library. You can utilize Gnib::Search, Gnib::SearchRequest, Gnib::SearchResponse instances which provide more useful options than that of the helper function.

search = Gnib::Search.new 'query', :sources => [:web, :image] # Other options include :market, :version, :adult, :latitude, :longitude, ...
request = search.request
response = request.response

image_results = response.images # Image search results
web_results = response.webs # Web search results

More descriptive documentations will be available soon. Stay tuned!

References