开发者

Google Sets API

开发者 https://www.devze.com 2023-02-13 04:36 出处:网络
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

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=Sma开发者_运维百科ll+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.


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.


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消