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
In reply to New Bing Search Api (5) by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |