0

Null result through YQL?

I have the following query:

CODE
use 'http://github.com/bkudria/yql-tables/raw/0d78d161409710e117f57027408dad167e0ab82d/nyt/nyt.people.newsfeed.xml' as z; select * from z where apikey='xxx' and user-id='yyy'


Which, according to that Open Table definition (and according to the diagnostics element) is supposed to call:

CODE
http://api.nytimes.com/svc/timespeople/api/v1/user/yyy/newsfeed.js?api-key=xxx


Executing this call manually, direct to the NYT, works fine, but through the YQL console, I get an empty results element. Any idea why?

by
2 Replies
  • Couple things. First YQL will handle conversions to and from XML and JSON so you only need to implement a single end point for each select. So in the case of newsfeed you can remove one or the other. Secondly, when we parse JSON sometimes in order to get a reasonable conversion we need to insert a 'json' root element in the results. For your news feed case if you remove the itemPath you'll see that the root element in this case is 'json' rather than 'results'. You can change the itemPath to 'json.results' to get what you are looking for. Another option is just use the XML API from the NYT which is the one that I used in most cases.

    I'd love to add your tables to the main community repository when you are finished.

    Sam
    0
  • Thanks for the advice, Sam! I will try changing things how toy requested, and I guess I'll get rid of the JSON selects to simplify things.

    And, yes, I'll send you a pull request on GH when I'm done!

    Ben
    0

Recent Posts

in YQL