Re: [CODE4LIB] ny times best seller api

2011-10-03 Thread Karen Coombs
Some of OCLC's APIs do support JSONP or CORS: for example QuestionPoint API, the xIdentifier and MapFAST services. However, other services do not provide this support. This is because for these services we need to carefully ensure that the application making the request is actually owned by the ins

Re: [CODE4LIB] ny times best seller api

2011-10-03 Thread Ed Summers
On Wed, Sep 28, 2011 at 5:36 PM, Godmar Back wrote: > Closer to the code4lib community: OCLC and Serials Solutions don't support > JSONP in their webservices, either, even though doing so would allow cool > services and would likely not affect their business models adversely in a > significant way

Re: [CODE4LIB] ny times best seller api

2011-09-30 Thread Tom Keays
On Fri, Sep 30, 2011 at 11:52 AM, Doug Yancey wrote: > I've put an example of the php file (extension changed to .txt), along with > the stylesheet I'm using in the following directory on our webserver: > > http://nc.ccrls.org/code4lib/ Thank you. I'll take a look. > I was going to build a ca

Re: [CODE4LIB] ny times best seller api

2011-09-30 Thread Doug Yancey
Tom, Wasn't aware of the Reading Radar portal - thanks for sharing that. I've put an example of the php file (extension changed to .txt), along with the stylesheet I'm using in the following directory on our webserver: http://nc.ccrls.org/code4lib/ I was going to build a caching strategy into t

Re: [CODE4LIB] ny times best seller api

2011-09-29 Thread Tom Keays
On Wed, Sep 28, 2011 at 5:38 PM, Doug Yancey wrote: >I just got this set up on our site, using php to parse the json response. > You should be able to see the result on our staging port at: > >http://catalog.ccrls.org:2082 > >...under the 'Bestsellers' menu in the top nav bar. Nice. It reminds me

Re: [CODE4LIB] ny times best seller api

2011-09-29 Thread Nate Hill
Because a few people have asked me about this off list, and because I'm now struggling with a different related question, I'm bringing it back to the list for all. If it's TMI, just delete the email and move on... sorry to jam your inbox. But I'm determined to make this thing work. I have the proxy

Re: [CODE4LIB] ny times best seller api

2011-09-29 Thread Godmar Back
On Wed, Sep 28, 2011 at 5:02 PM, Michael B. Klein wrote: > > It's not NYTimes.com's fault; it's the cross-site scripting jerks who made > the security necessary in the first place. > > NYTimes could allow JSONP, but then developers would need to embed their API key in their web pages, which means

Re: [CODE4LIB] ny times best seller api

2011-09-29 Thread Doug Yancey
I just got this set up on our site, using php to parse the json response. You should be able to see the result on our staging port at: http://catalog.ccrls.org:2082 ...under the 'Bestsellers' menu in the top nav bar. We're having to host the actual php pages on a separate web server, since our

Re: [CODE4LIB] ny times best seller api

2011-09-28 Thread Michael B. Klein
You can pull data from their API into a server-side process and then pass it along (filtered or raw) to your browser. But browser security won't let you access JSON data from a different-origin server. It's not NYTimes.com's fault; it's the cross-site scripting jerks who made the security necessar

Re: [CODE4LIB] ny times best seller api

2011-09-28 Thread Nate Hill
Wait- what would be the point of their API if I couldn't run anything on a domain other than nytimes.com? Thanks everyone for the pointers. I'll get back to it! If I can pull the first 5 titles from the different best seller lists, and then using the ISBN build a link to those titles in the librar

Re: [CODE4LIB] ny times best seller api

2011-09-28 Thread Godmar Back
Are you trying to run this inside a webpage served from a domain other than nytimes.com? If so, you'd need to use JSONP, which a cursory examination of their API documentation reveals they do not support. So, you need to use a proxy. Here's one: $ cat hardcover.php http://api.nytimes.com/svc/books

Re: [CODE4LIB] ny times best seller api

2011-09-28 Thread Rob Casson
and nothing specific to this case, but i've taken to developing using .ajax() instead of the .getJSON(), etc. .ajax underlies all the others, but i've had better luck debugging/diagnosing with the lower-level function. On Wed, Sep 28, 2011 at 3:28 PM, Nate Hill wrote: > Anybody out there using

Re: [CODE4LIB] ny times best seller api

2011-09-28 Thread Ryan Eby
that said if you are hoping to get reviews i had very low results. i was hoping they included reviews for things that might not have made the best sellers but most of what i tried in some sample searches came up blank. haven't bothers doing much with the historical best seller data otherwise. eby

Re: [CODE4LIB] ny times best seller api

2011-09-28 Thread Gabriel Farrell
Looks like data.results is an array, so you'll have to loop through it. If you just want the first result, you could get at the book_details array with data.results[0].book_details. On Wed, Sep 28, 2011 at 3:28 PM, Nate Hill wrote: > Anybody out there using the NY times best seller API to do stuf

[CODE4LIB] ny times best seller api

2011-09-28 Thread Nate Hill
Anybody out there using the NY times best seller API to do stuff on their library websites? I can't figure out what's wrong with my code here. Data is returned as "null"; I can't seem to parse the response with jQuery. Any help would be supercool. I removed the API key - my code doesn't actually co