Skip to content

Instantly share code, notes, and snippets.

@b-abctech
Last active August 29, 2015 13:56
Show Gist options
  • Save b-abctech/8949941 to your computer and use it in GitHub Desktop.
Save b-abctech/8949941 to your computer and use it in GitHub Desktop.
bing with perl sample
#!/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