谷歌设置API

发布于 2024-10-19 04:28:16 字数 1047 浏览 1 评论 0原文

正在寻找 Google Sets API。不幸的是谷歌没有提供这一服务。

最好是 PHP。

我正在使用这个脚本,但它今天停止工作了,我认为 Google 屏蔽了我的从我的机器访问 Google Sets 的 IP。尝试访问 Google Sets 时,它会返回以下警告消息:

Warning: fopen(http://labs.google.com/sets?hl=en&q1=java&btn=Small+Set+(15+items+or+fewer)): failed to open stream: HTTP request failed! HTTP/1.0 503 Service Unavailable

但奇怪的是,当我从浏览器打开 Google Sets 时,它会毫无问题地打开,并且我可以在其中执行查询。

问题出在哪里?

如何解决?

最后有谁知道从 PHP 获取 Google Sets 结果的最佳方法是什么?

太感谢了。

更新1 刚刚也找到了 this PHP 类,但错误消息是相同的:

Warning: file_get_contents(http://labs.google.com/sets?hl=es&q1=bmw&q2=ferrari): failed to open stream: HTTP request failed! HTTP/1.0 503 Service Unavailable

所以,我认为唯一的问题是 Google 管理员(代理)屏蔽了我的 IP。

Looking for a Google Sets API. Unfortunately Google doesn't provide one.

Preferably for PHP.

I was using this script but it stopped working today, I think Google blocked my IP to access to Google Sets from my machine. It returns following warning message when trying to access Google Sets:

Warning: fopen(http://labs.google.com/sets?hl=en&q1=java&btn=Small+Set+(15+items+or+fewer)): failed to open stream: HTTP request failed! HTTP/1.0 503 Service Unavailable

But strangely when I open Google Sets from the browser it opens up without any problem and I could perform query in it.

Where is the problem?

How to resolve it?

And finally does anyone know which is the best way to get results of Google Sets from PHP?

Thank you so much.

UPDATE 1
Have just found this PHP class also, but the error message is the same:

Warning: file_get_contents(http://labs.google.com/sets?hl=es&q1=bmw&q2=ferrari): failed to open stream: HTTP request failed! HTTP/1.0 503 Service Unavailable

So, I think the only problem is that Google Administrator (Agent) blocked my IP.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

缺⑴份安定 2024-10-26 04:28:16

根据 Google 实验室使用条款(集合所属)

<强>2。正确使用。本网站上的内容和软件是 Google 和/或其供应商的财产,并受美国和国际知识产权法的保护。因此,您同意不会复制、复制、更改、修改、创建衍生作品或公开展示本网站的任何内容(您个人的非商业用途除外)。您还同意,您不会使用任何机器人、蜘蛛、其他自动化设备或手动流程来监控或复制本网站的任何内容。此外,本网站仅供您个人使用,不得用于任何商业目的。例如,您不得进行以下任何行为: 使用本网站销售产品或服务;出于商业原因(例如广告销售)使用本网站来增加您网站的流量;从网站获取结果并重新格式化并显示它们,或在您的网站上镜像网站的任何部分;或“元搜索”网站。如果您希望将本网站的任何部分用于商业目的,请联系我们以获取更多信息。任何侵犯 Google 知识产权或出于商业目的使用本网站的行为都将受到调查,并且 Google 有权采取适当的民事和刑事法律行动。

除非您与他们有明确协议,否则当他们发现您使用不当时,他们可以检查并阻止您使用该服务。

According to Google Labs Terms of Use (in which Sets belongs):

2. Proper Use. The content and software on this Site is the property of Google and/or its suppliers and is protected by U.S. and international intellectual property laws. Accordingly, you agree that you will not copy, reproduce, alter, modify, create derivative works, or publicly display any content (except for your own personal, non-commercial use) from the Site. You also agree that you will not use any robot, spider, other automated device, or manual process to monitor or copy any content from the Site. Furthermore, the Site is provided to you for your own personal use, and it may not be used for any commercial purposes. For example, you may not do any of the following: use the Site to sell a product or service; use the Site to increase traffic to your Web site for commercial reasons, such as advertising sales; take the results from the Site and reformat and display them, or mirror any portion of the Site on your Web site; or "meta-search" the Site. If you wish to use any portion of the Site for commercial purposes, please contact us for more information. Any use of the Site that infringes upon Google's intellectual property rights or that is for commercial purposes will be investigated and Google shall have the right to take appropriate civil and criminal legal action.

Unless you have an explicit agreement with them, they can check and block your usage of the service when they notice you use it improperly.

橙幽之幻 2024-10-26 04:28:16

我的猜测是,谷歌正在检测到您的请求不是来自网络浏览器,从而阻止您。一般来说,谷歌会阻止对试图查询和抓取数据的脚本的访问。

我不推荐这样做,但您也许可以通过您的请求来欺骗用户代理(可能使用 cURL)。

My guess is that Google is detecting that your request is not coming from a web browser and thus blocking you. Generally Google will block access to scripts attempting to query and scrape data.

I don't recommend it, but you might be able to spoof a user-agent with your request (possibly using cURL).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文