是否有一个 URL 可用于搜索图像并返回第一个找到的图像?

发布于 2024-10-10 08:10:59 字数 1537 浏览 4 评论 0原文

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

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

发布评论

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

评论(4

软糖 2024-10-17 08:10:59

我知道您提到雅虎不起作用,但是我们正在非常相似的环境中成功地利用雅虎 API。查看BOSS 图像搜索 API。我们最初选择 BOSS 的原因之一是它没有任何每日限制。图像搜索 API 还允许您进行过滤、指示大小等。 结果以 XML 形式返回

话虽如此,如果我们必须重来一次,我们会使用 Bing API 路线,因为 Bing 比 Yahoo 拥有更光明的未来,并且拥有非常相似(如果不是更好)的 API。看起来它可以返回 XML、JSON 和 SOAP 格式的结果。

编辑:

看到您只是在寻找 URL 后,我尝试了所有三个主要搜索引擎,以下 URL 是我能找到的最接近您所描述的内容: http://www.bing.com/images/search?q=car&view=detail&first=1

恐怕要获得 100% 客户端所需的唯一方法是使用带有 jsonp 结果的 Bing API,然后通过 Javascript 操作 DOM。 查看此代码示例以初步了解。

I know you mentioned Yahoo didn't work, however we are utilizing a Yahoo API in a very similar context successfully. Check out the BOSS image search API. One of the reasons we originally went with BOSS was that it does not have any daily limits. The image search API also lets you filter, indicate size, and more. The results are returned in XML.

With all that being said, if we had to do it over, we would go the Bing API route, as Bing has a brighter future than Yahoo and has very similar, if not better, API. It looks like it can return results in XML, JSON, and SOAP.

EDIT:

After seeing you were JUST looking for a URL, I tried all the three major search engines and the following URL was the closest I could come to what you decribed: http://www.bing.com/images/search?q=car&view=detail&first=1

I'm afraid the only way to get exactly what you are looking for 100% client side would to be to utilize the Bing API with a jsonp result and then manipulate the DOM via Javascript. Check out this code sample for a rough start.

雨巷深深 2024-10-17 08:10:59

获得相关图片(不等于 Google 上的热门图片)的一种方法是:

http://(在此处键入任何关键字).jpg.to

例如:

One way to obtain a relevant imagine (not equal to the top hit on Google), is:

http://( Type any keyword here ).jpg.to

For example:

信仰 2024-10-17 08:10:59

Bing 有一个非常易于使用的网络搜索 API。您可以向其传递带有各种参数的 URL,它将返回 XML 结果。您感兴趣的两个参数是 SourceType (=Image) 和 ImageRequest.Count (=1)。

但是,您需要解析 XML,因为它不仅仅返回图像数据。

Bing has a pretty easy to use web search API. You can pass it a URL with various parameters and it will return an XML result. The two parameters you would be interested in would be SourceType (=Image) and ImageRequest.Count (=1).

However, you would need to parse the XML because it won't just give you back the image data.

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