jonahb / bing-search

A Ruby client for the Bing Search API
MIT License
17 stars 4 forks source link

End Of Life coming soon for this api's endpoint #4

Open rcavezza opened 7 years ago

rcavezza commented 7 years ago

I wasn't sure if anyone was still actively maintaining this repo. Wanted to doublecheck about possibility of someone working on the changes that will be necessary due to the Bing Search END OF LIFE coming up in less than a week.

-Bob

(below is from email I received yesterday)

End of life for the Azure Data Market "Bing Search" and "Bing Web Results Only" API offerings will take place on December 15, 2016.

ACTION:

If you choose not to upgrade to the new API offering, you will automatically lose access to your existing Bing Search or Bing Web Results Only Azure subscriptions at 5:00 PM Pacific Time on December 15, 2016 and calls to these API endpoints will no longer return any data.

Webcast - How to move from Bing Search API V2 to Cognitive Services Our team is here to help you migrate to the Microsoft Cognitive Services Search API. In October, we hosted a webcast that walks you through the process. You can view a recording of the webcast at https://infopedia.eventbuilder.com/event?eventid=i5d7n8.

Note: To view the video, click the "Register" button and enter your details.

Support Also, we have developed resources to help guide you through the process:

Migration Guide -https://msdn.microsoft.com/en-US/library/mt707570.aspx

FAQ - See the updated FAQ with Azure Data Market subscription information

If you have any questions, please reach out to the Azure Support via User Voice.-

Thank you!

The Bing Team Microsoft Corporation

jonahb commented 7 years ago

Hi @rcavezza. I've looked into moving to the new API, but the changes are significant, and I don't have time right now. If you'd like to try, please feel free to use this code as a starting point.

martinvelez commented 7 years ago

This is still working as of today.


#!/usr/bin/env ruby 

require 'bing-search'

BingSearch.web_only = true
BingSearch.account_key = '123456789'
results = BingSearch.web('Martin Velez')
jonahb commented 7 years ago

Surprising

On Jan 13, 2017, at 4:09 AM, Martin Velez notifications@github.com wrote:

This is still working as of today.

!/usr/bin/env ruby

require 'bing-search'

BingSearch.web_only = true BingSearch.account_key = '123456789' results = BingSearch.web('Martin Velez') — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jonahb/bing-search/issues/4#issuecomment-272394988, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJtCrOvHnGDn_PDAgzFcKo49or1Q2Tfks5rRz8wgaJpZM4LJdw6.

vishne0 commented 7 years ago

Its not working anymore. Can you guide a bit what kind of changes needs to be done in the script.

martinvelez commented 7 years ago

@vishne0 You can do a basic web search with the following code:

# Make a call to the Bing Web Search Api v5
# Documentation: https://dev.cognitive.microsoft.com/docs/services/56b43eeccf5ff8098cef3807/operations/56b4447dcf5ff8098cef380d
#
# params: String query 
# returns response status and reponse body
def web_search(query)
  Rails.logger.debug __method__
  uri = URI('https://api.cognitive.microsoft.com/bing/v5.0/search')
  uri.query = URI.encode_www_form({
      # Request parameters
      'q' => query
      #'count' => '10',
      #'offset' => '0',
      #'mkt' => 'en-us'
      #'safesearch' => 'Moderate'
  })  

  request = Net::HTTP::Get.new(uri.request_uri)
  # Request headers
  request['Ocp-Apim-Subscription-Key'] = ENV['BING_KEY']
  # Request body
  request.body = "{body}"

  response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
      http.request(request)
  end 

  return response
end # web_search
vishne0 commented 7 years ago

Can we implement this code in bing-search? I want to fix bing-search as i am using it for few of my apps. I really wish to offer some money if you can fix it for new version ?

vishne0 commented 7 years ago

I do not have a developer right now and i cant code myself so if you can help please

jonahb commented 7 years ago

Hi @vishne0, we could discuss updating the gem on contract. Please email me — jonah@jonahb.com.

vishne0 commented 7 years ago

Hi Jonahb, I did send you an email yesterday but didnt get a reply. Can you please reply to me?

vishne0 commented 7 years ago

sent you few emails can you please reply ?