开发者

Get flickr photos with YQL with multiple parameters

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


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:

Get flickr photos with YQL with multiple parameters

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜