Jump to content

Search the Community

Showing results for tags 'bing'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. Sample json query : https://api.datamarket.azure.com/Bing/Search/Web?$format=json&Query=%27Xbox%27 . If you click on the link you are prompted for a username and password. both fields just require you to insert your Bing API. How can I send the password with the query attached? I'm using cURL to send the query. I have tried using the normal method outlined by bing to receive the search results but it doesn't seem to work for me.
  2. I'm just trying to retrieve results using bing API. All I have done so far is copy the example for the bing user manual. https://skydrive.live.com/view.aspx?resid=9C9479871FBFA822%21112&app=Word&authkey=%21ANNnJQREB0kDC04 but I'm getting an error with the scope of the variable. The variable in question is $context Warning: file_get_contents() [function.file-get-contents]: SSL: fatal protocol error in /home/msc2012/12254822/public_html/MetaSearchV1/bing_basic.php on line 35 Service Operation <?php $acctKey = 'xPx9I4rWqBBFRGO4+5aZai7x/KrqSMuM/jLIchClJ6I'; $rootUri = 'https://api.datamarket.azure.com/Bing/Search'; $contents = file_get_contents('index.html'); //contents therefore has basic in it as words? if ($_POST['query']) { $query = urlencode("'{$_POST['query']}'"); $serviceOp = $_POST['service_op']; $requestUri = "$rootUri/$serviceOp?\$format=json&Query=$query"; // Encode the credentials and create the stream context. $auth = base64_encode("$acctKey:$acctKey"); $data = array( 'http' => array( 'request_fulluri' => true, // ignore_errors can help debug – remove for production. This option added in PHP 5.2.10 'ignore_errors' => true, 'header' => "Authorization: Basic $auth") ); $context = stream_context_create($data); // Get the response from Bing. $response = file_get_contents($requestUri, 0, $conext); $jsonObj = json_decode($response); $resultStr = ''; foreach($jsonObj->d->results as $value) { switch ($value->__metadata->type) { case 'WebResult': $resultStr .= "<a href=\"{$value->Url}\">{$value->Title}</a><p>{$value->Description}</p>"; break; case 'ImageResult': $resultStr .= "<h4>{$value->Title} ({$value->Width}x{$value->Height}) " . "{$value->FileSize} bytes)</h4>" . "<a href=\"{$value->MediaUrl}\">" . "<img src=\"{$value->Thumbnail->MediaUrl}\"></a><br />"; break; } } $contents = str_replace('{RESULTS}', $resultStr, $contents); } echo $contents; ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.