0

Flickr To YQL APIs Mapping

Hi to everybody I'm new to this forum and also to the YQL world.
I need to retrieve data from Flickr for analyzing places by tags for my thesis, I decided to go for the YQL instead of the Flickr API for two reasons:
1) It seemed easier
2) To learn new things
I have to say it wasn't like that! I'm finding very poor documentations and all around the web always and always the same examples how to use the YQL services.
I dont understand how the Flickr APIs are mapped in the YQL language, really I tried to figured it out but I couldn't! Besides those few commons queries usually showed in all the examples all around I couldnt find a way to use the Flickr "Tags" APIs.
For example how can I use the flickr.places.tagsForPlace or the flickr.tags.getRelated and similar?
I think NOT all the flickrs apis are mapped onto YQL, isn't it?

bye

by
9 Replies
  • Hi Leonard!

    As far as I know, taking a look to the console, seems those api functions are not implemented as YQL tables. I couldn't find anything in the official yahoo tables for flickr or in the open tables:

    http://github.com/yql/yql-tables

    But it should be really easy to implement following the YQL documentation:
    http://developer.yahoo.com/yql/guide/yql-c...es-chapter.html

    If you create those tables, sure will be added to the community tables.

    Cheers!
    Francisco

    QUOTE (LeonardG @ Sep 21 2010, 11:53 AM) <{POST_SNAPBACK}>
    Hi to everybody I'm new to this forum and also to the YQL world.
    I need to retrieve data from Flickr for analyzing places by tags for my thesis, I decided to go for the YQL instead of the Flickr API for two reasons:
    1) It seemed easier
    2) To learn new things
    I have to say it wasn't like that! I'm finding very poor documentations and all around the web always and always the same examples how to use the YQL services.
    I dont understand how the Flickr APIs are mapped in the YQL language, really I tried to figured it out but I couldn't! Besides those few commons queries usually showed in all the examples all around I couldnt find a way to use the Flickr "Tags" APIs.
    For example how can I use the flickr.places.tagsForPlace or the flickr.tags.getRelated and similar?
    I think NOT all the flickrs apis are mapped onto YQL, isn't it?

    bye
    0
  • QUOTE (arcturus @ Sep 21 2010, 01:51 PM) <{POST_SNAPBACK}>
    Hi Leonard!

    As far as I know, taking a look to the console, seems those api functions are not implemented as YQL tables. I couldn't find anything in the official yahoo tables for flickr or in the open tables:

    http://github.com/yql/yql-tables

    But it should be really easy to implement following the YQL documentation:
    http://developer.yahoo.com/yql/guide/yql-c...es-chapter.html

    If you create those tables, sure will be added to the community tables.

    Cheers!
    Francisco


    Hi Francisco, thanks for your reply.
    I tried to build my table, just now i didn't understand the last step: where am I going to put it?
    I mean, I know it should be somewhere online so i can link it but also I understood it should be in this repository: http://github.com/spullara/yql-tables
    Is that the official one? and if yes how to publish there my own open data table? I know these questions are very stupid but I'm newbie :)Bye, thank you again
    0
  • Hi again,

    once your table works, is a matter of using github, fork the project, add your table to your new project, and ask the original project owner to add your proposed changes.

    I guess is better if you read more detailed documentation on how works github, you can find it more info here:

    http://help.github.com/
    http://codeclimber.net.nz/archive/2009/03/...-gitgithub.aspx

    Cheers,
    Francisco.

    QUOTE (LeonardG @ Sep 22 2010, 03:33 PM) <{POST_SNAPBACK}>
    Hi Francisco, thanks for your reply.
    I tried to build my table, just now i didn't understand the last step: where am I going to put it?
    I mean, I know it should be somewhere online so i can link it but also I understood it should be in this repository: http://github.com/spullara/yql-tables
    Is that the official one? and if yes how to publish there my own open data table? I know these questions are very stupid but I'm newbie :)Bye, thank you again
    0
  • QUOTE (arcturus @ Sep 23 2010, 06:13 AM) <{POST_SNAPBACK}>
    Hi again,

    once your table works, is a matter of using github, fork the project, add your table to your new project, and ask the original project owner to add your proposed changes.

    I guess is better if you read more detailed documentation on how works github, you can find it more info here:

    http://help.github.com/
    http://codeclimber.net.nz/archive/2009/03/...-gitgithub.aspx

    Cheers,
    Francisco.

    Thank you very much!
    I'll try it right now
    Byee
    0
  • QUOTE (Groob @ Sep 23 2010, 07:54 AM) <{POST_SNAPBACK}>
    Thank you very much!
    I'll try it right now
    Byee

    For the moment i stored on my personal domain for testing. I'm calling it from the console, and the "desc" command describe it as i wrot the xml file.
    If I use a Select it doesn't return any result neighter any error. Could you please help me to debug it?
    CODE
    <?xml version="1.0" encoding="UTF-8"?>
    <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
    <meta>
    <author>Leonard G</author>
    <documentationURL>http://www.flickr.com/services/api/flickr.places.tagsForPlace.html</documentationURL>
    <sampleQuery>select * from {table} where woe_id='44418'"</sampleQuery>
    </meta>
    <bindings>
    <select itemPath="rsp.tags.tag" produces="XML">
    <urls>
    <url env="all">http://api.flickr.com/services/rest/?method=flickr.places.tagsForPlace</url>
    </urls>
    <paging model="page">
    <start id="page" default="1" />
    <pagesize id="per_page" max="500" />
    <total default="10" />
    </paging>
    <inputs>
    <key id="woe_id" type="xs:string" paramType="query" />
    <key id="place_id" type="xs:string" paramType="query" />
    <key id="min_upload_date" type="xs:string" paramType="query" />
    <key id="max_upload_date" type="xs:string" paramType="query" />
    <key id="min_taken_date" type="xs:string" paramType="query" />
    <key id="max_taken_date" type="xs:string" paramType="query" />
    </inputs>
    </select>
    </bindings>
    </table>


    Where do you think I made the mistake?
    byee
    0
  • Hi again,

    Almost!! You were pretty close, just missing one important field for flickr api, the api_id parameter, this is your table with the parameter:

    CODEBOX
    <?xml version="1.0" encoding="UTF-8"?>
    <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
    <meta>
    <author>Leonard G</author>
    <documentationURL>http://www.flickr.com/services/api/flickr.places.tagsForPlace.html</documentationURL>
    <sampleQuery>select * from {table} where woe_id='44418'"</sampleQuery>
    </meta>
    <bindings>
    <select itemPath="rsp.tags.tag" produces="XML">
    <urls>
    <url env="all">http://api.flickr.com/services/rest/?method=flickr.places.tagsForPlace</url>
    </urls>
    <paging model="page">
    <start id="page" default="1" />
    <pagesize id="per_page" max="500" />
    <total default="10" />
    </paging>
    <inputs>
    <key id="api_key" type="xs:string" paramType="query" required="true"/>
    <key id="woe_id" type="xs:string" paramType="query" />
    <key id="place_id" type="xs:string" paramType="query" />
    <key id="min_upload_date" type="xs:string" paramType="query" />
    <key id="max_upload_date" type="xs:string" paramType="query" />
    <key id="min_taken_date" type="xs:string" paramType="query" />
    <key id="max_taken_date" type="xs:string" paramType="query" />
    </inputs>
    </select>
    </bindings>
    </table>


    Cheers!
    F.
    0
  • QUOTE (arcturus @ Sep 23 2010, 10:02 AM) <{POST_SNAPBACK}>
    Hi again,

    Almost!! You were pretty close, just missing one important field for flickr api, the api_id parameter, this is your table with the parameter:


    You are very kind to answer me everytime, but still have another doubt :)2) Why can I use all the others YQL Flickr tables without passing them any api_key parameter? All the world is maybe using the default key of the creator of each yql table?
    0
  • Hi again,

    Let me answer your questions:


    1) For this table you don't need authentication means, you don't need to get an authentication token, cause you are not going to access user data. But you will always need to add your api key to all your calls.

    2) Related to the previous question, if you take a look to the open tables using flickr, the include the api key as a constant, already setup in the table, that means that you cannot modify that api key and will use the same one for everybody using that table.
    Personally I wouldn't recommend this, cause if that api get blocked or you exceed the limits, nobody can reuse the table, meanwhile if each user of the table specifies his/her api key you will be safe for this problems.

    Cheers,
    Francisco


    QUOTE (Groob @ Sep 23 2010, 11:31 AM) <{POST_SNAPBACK}>
    You are very kind to answer me everytime, but still have another doubt :)2) Why can I use all the others YQL Flickr tables without passing them any api_key parameter? All the world is maybe using the default key of the creator of each yql table?
    0
  • QUOTE (arcturus @ Sep 23 2010, 11:55 PM) <{POST_SNAPBACK}>
    Hi again,

    Let me answer your questions:


    1) For this table you don't need authentication means, you don't need to get an authentication token, cause you are not going to access user data. But you will always need to add your api key to all your calls.

    2) Related to the previous question, if you take a look to the open tables using flickr, the include the api key as a constant, already setup in the table, that means that you cannot modify that api key and will use the same one for everybody using that table.
    Personally I wouldn't recommend this, cause if that api get blocked or you exceed the limits, nobody can reuse the table, meanwhile if each user of the table specifies his/her api key you will be safe for this problems.

    Cheers,
    Francisco


    Thank you so much Francisco, You solved my week :)Leo
    0

Recent Posts

in YQL