【问题标题】:PHP cURL: retrieve search data from yahoo/ google api? [closed]PHP cURL:从 yahoo/google api 检索搜索数据? [关闭]
【发布时间】:2014-02-10 03:12:44
【问题描述】:

我尝试在 yahoo curl 服务上测试 php_curl,但我从 yahoo 收到错误消息。

// 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);

结果:

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
)

任何从雅虎检索搜索数据的示例因为该服务已被弃用?似乎需要他们的BOSS API 付款。

googel api 怎么样 - 如果我想从 google 获取搜索数据,我可以去哪里?

【问题讨论】:

    标签: php curl twitter


    【解决方案1】:

    知道为什么吗?

    阅读了邮件吗?!

    服务已关闭。有关详细信息,请参阅已弃用的服务博客文章http://developer.yahoo.com/blogs/ydn/posts/2010/08/api_updates_and_changes

    那个网址说:

    其他非 BOSS 搜索 API,例如网页搜索、图片搜索、新闻搜索、相关建议和站点资源管理器 API 将关闭,YQL 不再提供支持。

    所以...

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

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

    【讨论】:

      猜你喜欢
      • 2018-03-10
      • 2015-10-05
      • 2012-01-12
      • 2017-02-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多