Bing API PHP Library - 简单Bing API的PHP库

这是一个简单的php库文件,可以方便的在php中调用Bing API实现一些功能,具体可以去作者项目站上查询。

  // Include the Bing API PHP Library

require_once 'library/BingAPI.php';

// Simply start the class with your AppID argumented

$search = new BingAPI('YOUR APPID KEY');

/* To use multiple resources simply do

->setSources('Web+Image') ,

it must match the source type bing.com provides */

// Build your query easily

$search->query('gimp')

->setSources('Web')

->setFormat('xml')

# Also you can try: xml, soap or json

->setOptions(

array(

'Web.Count' => '10',

'Web.Offset' => '0',

'Adult' => 'Moderate',

'Options' => 'EnableHighlighting')

);

# Check the API documentation in bing.com for more information

# This will give you a raw output

echo $search->getResults();

项目网站:http://bingapiphp.codeplex.com/

下载:bingapiphp-1.1.zip(Bing API PHP库)

下载:bingmoccha.zip(演示代码)

评论

Popular Posts

常用的国内外延迟测速链接(generate_204)

随身WiFi折腾指南: 解锁、刷机与DIY

Cromite - 极度注重隐私的Chromium浏览器

《爱的博弈》约翰·戈特曼 (John Gottman)

为什么你睡了11个小时仍然觉得疲累?

神奇动物在哪里 Fantastic Beasts and Where to Find Them (2016)

野兽组合 - 很快再相见 Звери - До скорой встречи

MiniPomodoro - 极简番茄计时器(附源码)

解决MacBook重装系统报错"无法与恢复服务器取得联系"

为爱而活:三毛和荷西的情感世界