vinaykevadia/bing-api-php

PHP 的 Bing API 封装器

0.3 2016-04-22 12:27 UTC

This package is not auto-updated.

Last update: 2024-09-20 19:45:25 UTC


README

PHP 中非常简单的 Bing API 封装器。

安装

推荐的方式是通过 composer。只需创建一个 composer.json 文件,并运行 php composer.phar install 命令来安装它

{
    "require": {
        "scragg0x/bing-api-php": "dev-master"
    }
}

API 参考

http://datamarket.azure.com/dataset/bing/search

示例

<?php

require_once __DIR__ . "/vendor/autoload.php";

use Bing\Client;

// You need to obtain a key
$key = '';

$c = new Client($key, 'json');

$res = $c->get('News', array('Query' => 'Obama'));

$res = json_decode($res, true);

print_r($res);