I've got working code now using jQuery and Javascript so I figured I'd share
that back to the list. Thanks everyone for the help.
Here's a demo page (which will not stay up for more than a few days)
http://www.sjpl.org/nytimes
*Here's the code:*
<script type="text/javascript" src="
http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script><script
type="text/javascript">
$(document).ready(function(){
//json request to new york times via proxy
$.getJSON('http://www.sjpl.org/otherscripts/callback.php?callback=?',
function(data){
for(var i = 0; i < 5; i++){
$.each(data.results[i].book_details, function(n,item){
var bookTitle = item.title;
var bookIsbn = item.primary_isbn13;
var bookAuthor = item.author;
var bookDescription = item.description;
$('#fiction').append('<div
style="display:block;width:80px;float:left;margin:8px 0 8px 0;"><a href="
http://catalog.sjlibrary.org/search~/a?searchtype=i&searcharg='+bookIsbn+'&SORT=D&searchscope=1"><img
src="
http://syndetics.com/index.php?isbn='+bookIsbn+'/SC.GIF&client=sjose&type=hw7"></a></div><div
style="display:block;width:880px;float:left;margin:8px 0 8px 0;"><a href="
http://catalog.sjlibrary.org/search~/a?searchtype=i&searcharg='+bookIsbn+'&SORT=D&searchscope=1"><h3
style="font-size:1.2em;color:#00C;margin:0px;">'+bookTitle+'</h3></a><br>By
'+bookAuthor+'<br><br>'+bookDescription+'</div><div
style="clear:both;"></div><hr>');
});
};
});
});
</script>
<div id="fiction">
<h1>
Hardcover Fiction</h1>
</div>
On Fri, Sep 30, 2011 at 9:14 AM, Tom Keays <[log in to unmask]> wrote:
> On Fri, Sep 30, 2011 at 11:52 AM, Doug Yancey <[log in to unmask]> 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 caching strategy into the php script itself, but
> > recently discovered that our webserver can do output caching. So I'm
> > exploring that right now and want it working before this little project
> > goes
> > live. I think it will improve performance, since these pages don't have
> to
> > be up-to-the-minute current, and keep us well away from the NYT api
> limits.
> >
>
> The Reading Radar caches pages too. I imagine they would have a real
> concern
> with API limits (unless the NY Times gives them a break).
>
>
> > My only lingering question is whether or not this setup compromises my
> > developer key. I don't think it does, since that key is included in the
> > php
> > file itself and isn't visible in the output. However, if others detect
> an
> > issue here, I'd be grateful to hear about it.
> >
>
> One never knows how an API "vendor" will react, but given that the NY Times
> features the Reading Radar in their API gallery, and it has had a lot of
> traffic since it went live in 2009, I can't imagine that would have any
> objection to yours or anybody else's.
>
> http://developer.nytimes.com/reading_radar_app
>
> Karen Coyle seems to have been involved with the bestseller API in the
> context of developing a WorldCat book ordering system.
>
>
> http://www.oclc.org/developer/news/building-new-york-times-bestsellers-application
>
> There are only screenshots provided; no working example or code. I don't
> know if this has progressed past the prototype stage, but it is a really
> nice idea.
>
> Tom
>
> Tom
>
--
Nate Hill
[log in to unmask]
http://www.natehill.net
|