Last active
August 29, 2015 13:56
-
-
Save b-abctech/8949941 to your computer and use it in GitHub Desktop.
bing with perl sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use LWP::UserAgent; | |
use JSON; | |
my $query = 'Norway'; | |
my $ua = LWP::UserAgent->new; | |
my $account_key = 'VHqbZUljwrsMUrVUBjTMPVD1SaY4aReHQYBPtk8dcGg='; | |
$ua->credentials( 'api.datamarket.azure.com:443', '', '', $account_key ); | |
my $response = $ua->get( 'https://api.datamarket.azure.com/Bing/Search/v1/Web?Query=%27' . $query . '%27&$format=JSON' ); | |
my $ref = JSON::decode_json( $response->decoded_content ); | |
use Data::Dumper; | |
warn Dumper( $ref ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment