Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Dear Eminences
Microsoft Bing has a brand new Search API. This will force me to modify some of my scripts. Unfortunately enough, Microsoft is not providing any example for Perl (but many in other languages)... guess what: I am having problems in making my script working. The API requiers to pass a key to the query. And this is giving me trubles. This is what I have so far adapting my old script:
my $BingKey="xxxxxxxxxxx";#This is my personal Microsoft API key my $MyBingJsonQuery=" My two Key words"; my $href= 'https://api.cognitive.microsoft.com/bing/v5.0/search[?'. "$ +MyBingJsonQuery". ']'; my $ua= LWP::UserAgent->new(keep_alive); $ua->credentials("api.cognitive.microsoft.com".':443', '', '', $BingKe +y); my $req = HTTP::Request->new(GET => $href); my $res = $ua->request($req); # Check the outcome of the response if ($res->is_success) { #DO SOMETHING }
My solution doesn't work. I guess the problem is in the $ua->credentials statement
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: New Bing Search Api (5)
by Corion (Patriarch) on Nov 21, 2016 at 17:37 UTC | |
by Anonymous Monk on Nov 21, 2016 at 17:57 UTC | |
by Corion (Patriarch) on Nov 21, 2016 at 18:05 UTC | |
by Anonymous Monk on Nov 21, 2016 at 18:17 UTC | |
by Corion (Patriarch) on Nov 21, 2016 at 18:24 UTC | |
| |
|
Re: New Bing Search Api (5)
by Anonymous Monk on Nov 21, 2016 at 18:49 UTC | |
by alain_desilets (Beadle) on Sep 25, 2018 at 13:47 UTC |