Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gnib

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gnib

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Gnib

Gnib is a Ruby interface for Microsoft Bing Search API.

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

FAQs

Package last updated on 04 Jan 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc