使用具有多个参数的 YQL 获取 flickr 照片

发布于 2024-12-01 18:47:37 字数 322 浏览 8 评论 0原文

我正在尝试创建一个 Flex 应用程序,以从 flickr(使用 YQL)获取给定邮政编码附近的“某物”的照片,并按兴趣排序。

我不知道怎么办。我在 http://developer.yahoo.com/yql/console/ 并且我看到有不同的表:flickr.photos.search、flickr.photos.interestigness 等。我想我必须进行 sql 连接才能过滤照片,但我不知道它们包含哪些列。

你能帮我吗?

谢谢

I'm trying to create a Flex app to get photos from flickr(using YQL) of "something" near a given ZIPCODE and ordered by interestigness.

I can't figure out how. I'm on http://developer.yahoo.com/yql/console/ and i see that there are different tables: flickr.photos.search, flickr.photos.interestigness etc.I guess i have to make an sql join in order to filter the photos but i dpn't know what columns they contain.

Can you please help me?

Thanks

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

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

发布评论

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

评论(1

挽清梦 2024-12-08 18:47:37

搜索的关键表是 flickr.photos.search,它允许您使用多种过滤器搜索照片,并根据需要按兴趣程度对结果进行排序。

一个简单的查询,在美国加利福尼亚州比佛利山庄 20 公里半径范围内的照片中搜索单词“hill”,并按兴趣度对结果进行排序,可能如下所示。

select * from flickr.photos.search where 
    has_geo="true" and text="hill" and sort="interestingness-desc" 
    and radius="20" and radius_units="km" and place_id in (
        select place_id from flickr.places(1) where query="90210, USA"
    )

» 在控制台中尝试此操作


我不知道它们包含哪些列。

使用控制台时,每个表应该有一个关联的 URL,指向该表提供的服务的文档。该链接以及有关表的其他信息(例如所需参数)可以通过执行 desc 形式的查询来找到。例如,YQL 控制台中的查询 desc flickr.photos.search 显示:

XML 结果: desc flickr.photos.search;

那个 documentationURL (此处)会将您带到 flickr.photos.search API 方法的 Flickr 文档页面,其中显示了可以使用的所有可用参数。您将看到我们用于搜索比佛利山庄附近照片的 YQL 查询中的 where 子句参数的说明。

The key table to search on is flickr.photos.search, which allows you to search photos with numerous filters and to sort the results by interestingness as you want.

A simple query which searches photos within a 20km radius of Beverly Hills, CA, USA for the word "hill" and orders the results by interestingness might look like the following.

select * from flickr.photos.search where 
    has_geo="true" and text="hill" and sort="interestingness-desc" 
    and radius="20" and radius_units="km" and place_id in (
        select place_id from flickr.places(1) where query="90210, USA"
    )

» Try this in the console


i dpn't know what columns they contain.

When using the console, each table should have an associated URL pointing to the documentation for the service that that table provides. That link, and other information about the table (e.g. required parameters), can be found by executing a query of the form desc <table name>. For example, the query desc flickr.photos.search in the YQL console shows:

XML result for: desc flickr.photos.search;

That documentationURL (here) takes you to Flickr's documentation page for the flickr.photos.search API method, which shows all of the available parameters that can be used. You'll see descriptions for the where clause parameters from the YQL query we used to search for photos near Beverly Hills.

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