PHP cURL:从yahoo/google api中检索搜索数据?

lau*_*kok -6 php twitter curl

我试图在雅虎卷发服务上测试php_curl,但是我从雅虎收到了一个错误.

// create a new cURL resource
$handle = curl_init();

// set URL and other appropriate options
// http://search.yahooapis.com/WebSearchService/V1/webSearch?appid=YahooDemo&query=persimmon&results=10
curl_setopt_array(
    $handle,
    array(
        CURLOPT_URL => 'http://search.yahooapis.com/WebSearchService/V1/webSearch',
        CURLOPT_POST => true,
        CURLOPT_POSTFIELDS => 'appid=YahooDemo&query=test&results=10',
        CURLOPT_RETURNTRANSFER => true
    ) 
);

$response = curl_exec($handle);
curl_close($handle);

$xml = new SimpleXMLElement($response);

foreach($xml->Result as $x) {
    echo $x->Title.'<br/>';
}

echo '<pre>';
print_r($xml);
Run Code Online (Sandbox Code Playgroud)

结果:

SimpleXMLElement Object
(
    [Message] => The service has been shut down. For further details, please see the Deprecated Services blog post http://developer.yahoo.com/blogs/ydn/posts/2010/08/api_updates_and_changes
)
Run Code Online (Sandbox Code Playgroud)

自从该服务被弃用以来从yahoo 检索搜索数据的任何示例?它似乎需要从他们的BOSS API支付一些费用.

googel api怎么样 - 如果我想从谷歌返回搜索数据,我可以去哪里?

cee*_*yoz 6

任何想法为什么?

看过这条消息了吗?!

该服务已被关闭.有关详细信息,请参阅Deprecated Services博客文章 http://developer.yahoo.com/blogs/ydn/posts/2010/08/api_updates_and_changes

该网址说:

其他非BOSS搜索API(如Web搜索,图像搜索,新闻搜索,相关建议和Site Explorer API)将在YQL中不再提供支持而关闭.

所以...

那么,我怎样才能通过身份验证从twitter检索数据/状态?

https://dev.twitter.com/docs/auth