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

时间:2021-08-31 19:29:18

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.

我正在尝试创建一个Flex应用程序,以便从flickr(使用YQL)获取给定ZIPCODE附近的“某物”并通过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.

我无法弄清楚如何。我在http://developer.yahoo.com/yql/console/,我看到有不同的表:flickr.photos.search,flickr.photos.interestigness等。我想我必须在sql中加入为了过滤照片,但我不知道它们包含哪些列。

Can you please help me?

你能帮我么?

Thanks

谢谢

1 个解决方案

#1


1  

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.

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

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.

一个简单的查询,在美国加利福尼亚州比佛利山的20公里半径范围内搜索“山丘”这个词并按照趣味性排序结果可能如下所示。

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:

使用控制台时,每个表都应该有一个关联的URL,指向该表提供的服务的文档。可以通过执行形式desc

的查询来找到该链接以及关于该表的其他信息(例如,所需参数)。例如,YQL控制台中的查询desc flickr.photos.search显示:

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

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.

那个documentationURL(这里)将您带到Flickr的flickr.photos.search API方法的文档页面,该方法显示了可以使用的所有可用参数。您将看到我们用于在Beverly Hills附近搜索照片的YQL查询中where子句参数的描述。

#1


1  

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.

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

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.

一个简单的查询,在美国加利福尼亚州比佛利山的20公里半径范围内搜索“山丘”这个词并按照趣味性排序结果可能如下所示。

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:

使用控制台时,每个表都应该有一个关联的URL,指向该表提供的服务的文档。可以通过执行形式desc

的查询来找到该链接以及关于该表的其他信息(例如,所需参数)。例如,YQL控制台中的查询desc flickr.photos.search显示:

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

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.

那个documentationURL(这里)将您带到Flickr的flickr.photos.search API方法的文档页面,该方法显示了可以使用的所有可用参数。您将看到我们用于在Beverly Hills附近搜索照片的YQL查询中where子句参数的描述。