Hmm, I was thinking any book available in that page turner format had the 
javascript search.  This isn't true though, there's no way to know if a book 
has the javascript search without first checking to see if it's available in 
page turner, and then actually fetching the page turner HTML and seeing if it 
has the javascript in it?

That seems really unfortunate. _Something_ server-side is deciding whether to 
include the javascript searching code, is it not?  If there were any way to use 
that same logic to give me some kind of API response revealing the same thing, 
that would be, for me, a very wanted feature. 

But okay, if I'm going to actually request the HTML and sniff it.... first I 
have to discover if a "page turner" version is available. Can you help suggest 
the quickest way for software to determine that, on an on-demand basis?

I actually _want_ to provide search inside an individual book, not search of 
the full corpus. So hopefully whatever new thing you are working on will still 
support that. 

Here are examples of how in my interface I provide direct search via 
HathiTrust, Google, or Amazon. I'd really like to be able to do the same thing 
with OL/IA: (You need to wait a bit for some AJAX loads to get the 'search 
inside' box)...

https://blacklight.mse.jhu.edu/demo/catalog/bib_2106099
https://blacklight.mse.jhu.edu/demo/catalog/bib_789314

________________________________________
From: [email protected] [[email protected]] On Behalf Of 
Michael Ang [[email protected]]
Sent: Monday, September 27, 2010 6:08 PM
To: [email protected]
Subject: Re: [ol-tech] discovering and linking to search inside functions for   
hosted text

  On 9/27/10 1:44 PM, Jonathan Rochkind wrote:
> I think I asked this question like two years ago, and the answer was
> "No, not yet, but we'd like that."  So I'm pinging again.
>
> Some Internet Archive/OL full text exists in a 'page turner' interface
> that also has 'search inside' functionality. For instance:
> http://www.archive.org/stream/thesetwain00bennrich#page/n5/mode/2up
>
> Using IA/OL APIs, I am already identifying internet archive ID's of
> interest, like say "thesetwain00bennrich".  Using that identifier, is
> there any way using IA/OL APIs for me to:
>
> 1) Discover if a book is available in that page-turner format (not
> everything is).
Unfortunately the logic to determine if a book can be displayed is a
little complicated and we don't have a proper API that exposes the result.

In the meantime this is a little cheesy but you could fetch
http://www.archive.org/stream/{itemid} and look for the string
"BookReader.js" in the returned HTML.  That should indicate that the
BookReader is being served.

That should work for all the books which we've scanned.  For user
uploaded text items it's a little more complicated since there is
usually an additional 'sub-prefix' that is also required.  Right now
there isn't a great way to find out the sub-prefix... we make that
determination by looking at the item files.xml for the files that the
BookReader needs (sorry).

2) Deep link into search results for a particular query in a particular
> book.
This already works by appending "search/{terms}" after the # in the
BookReader URL.

e.g.
http://www.archive.org/stream/nimrodofseaorame00davirich#page/18/mode/2up/search/albatross

This is documented here:
http://openlibrary.org/dev/docs/bookurls#searching

We're working on using an improved full-text search engine instead of
the current rudimentary search.  This should only give better results
and shouldn't affect the deep-linked search URLs!

   - mang
> If #1 can be taken care of, but #2 can't be because of limitations in
> the javascript reader, then I might try to find time to submit a patch
> to the javascript reader to make that possible, although I'm not sure
> when I'd find the time to do so.
>
> Jonathan
> _______________________________________________
> Ol-tech mailing list
> [email protected]
> http://mail.archive.org/cgi-bin/mailman/listinfo/ol-tech
> To unsubscribe from this mailing list, send email to 
> [email protected]

_______________________________________________
Ol-tech mailing list
[email protected]
http://mail.archive.org/cgi-bin/mailman/listinfo/ol-tech
To unsubscribe from this mailing list, send email to 
[email protected]
_______________________________________________
Ol-tech mailing list
[email protected]
http://mail.archive.org/cgi-bin/mailman/listinfo/ol-tech
To unsubscribe from this mailing list, send email to 
[email protected]

Reply via email to