Parsing Live.com with Developer Application IDs in PHP
As you may know, live.com provides search API to include Live.com search results to whatever you need. An API key may be obtained for free at their website. There are a plenty of services but we’re interested in Search API at the moment. You can register your application named “Test PHP Script” and obtain a key that should look like 59745B4E9DF79988C3509DB3AB9AA3D210A92E. This will allow you to request search engine results from live.com with a structured query. This can be done using any programming language, I’ll show you PHP usage of this interface. We’ll need nusoap library for PHP, it can be obtained here. Take a look at this little, but very useful code:
<?
$request = array(‘Request’ => array(
‘AppID’ => $mkey,
‘Query’ => urlencode($keyword),
‘CultureInfo’ => ‘en-US’,
‘SafeSearch’ => ‘Strict’,
‘Flags’ => ”,
‘Location’ => ”,
‘Requests’ => array(
‘SourceRequest’ => array(
‘Source’ => ‘Web’,
‘Offset’ => 0,
‘Count’ => 10,
‘ResultFields’ => ‘All’))));
$soapClient = new soapclient(“http://soap.search.live.com/webservices.asmx?wsdl”, false);
$result = $soapClient->call(“Search”, $request);?>
First of all we’re building the query with two variables: Live.com Developer ID and keyword you wish to use to query live.com. Then we’re creating the query and then getting the result into $result. Investigate this variable with var_dump and apply it for your needs!