scragg0x / bing-api-php

PHP 的 Bing API 包装器

dev-master 2015-11-10 16:21 UTC

This package is not auto-updated.

Last update: 2024-09-23 14:21:38 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);