[ List Archives Home ] [ Thread index for 2008 ]
[ Date index for 2008 ]
[ Author index for 2008 ]
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
We don't use this LibraryThing function, but being a javascript hack,
the code is fairly easy to examine. I took a quick look and were I to
guess, I'd say that the extract ISBN function is where the problem lies.
There are two problems that I see with this function.
1) The function attempts to remove the previous and next links. See the
snippet below:
function extract_ISBNs() {
var isbns = [];
var search = /([\d]{13}|[\d]{10}|[\d]{9}[x])/gi ; // 13 digits, 10
digits, or 9 digits+x
var page = document.getElementsByTagName('html')[0].innerHTML;
page = page.replace(/\s/gi," ").replace(/-/gi,""); // strip hyphens
and whitespace
page = page.replace(/<select.*?<\/select>/gi,""); // strip <select>
elements
page = page.replace(/<a[^>]+>Next<\/a>/gi,""); // strip
'next' links
page = page.replace(/<a[^>]+>Prev<\/a>/gi,""); // strip
'prev' links
....[code snippet]....
}
Looking at your page source, the thing that initially jumps out at me is
the next and previous links themselves. Librarything's source indicates
a desire to strip away that data. However, from the snippet above, the
following lines:
page = page.replace(/<a[^>]+>Next<\/a>/gi,""); // strip
'next' links
page = page.replace(/<a[^>]+>Prev<\/a>/gi,""); // strip
'prev' links
wouldn't have the desired effect. You would need to change your code to
something more like:
page = page.replace(/<a.*?>Next.*<\/span><\/a>/gi,""); // strip
'next' links
page = page.replace(/<a.*?>Previous<\/span><\/a>/gi,""); // strip
'prev' links
The above is a little greedy, but will actually remove the data taking
into account the different formatting of your catalog. At least, this
should remove the next/prev links from the isbn list used by the
LibraryThing servers to build matches.
2. However, the larger problem is with how isbns are extracted.
Essentially, the ISBN extraction function is using a regular expression
to identify all values that may be an ISBN. The problem that you run
into here is that III includes numerous references to the original isbn
page visited using the scenario that you outlined. So, this extraction
process will capture the original isbn (and the actual isbn of the
requested piece) during the extraction process. Without knowing how
LibraryFind determines which ISBN to use I'd have to speculate as to
what's happening -- but from the look of the process, it appears that
LibraryThing is looking through the potential ISBN list and taking the
first good isbn to use to extract data about the text. This makes some
sense. Unfortunately, the first ISBN that will always be extracted, is
that of the old ISBN, where the value is encoded in every link within
the navigation bar (example: <a
href="/search/i1594200823/i1594200823/1,1,1,E/frameset&FF=i1594200947&1,
1,?save=b2105801"><img src="/screens/bibexport_1.gif" alt="Export"
border="0" /></a>). It would seem that LibraryThing's algorithm for
extracting ISBN data from a III html page will likely need to be updated
to take these references into account.
With that said, these are changes that will be need to be made on the
LibraryThing side -- as they are generated from their server-side
widget_logic.php file.
--TR
*******************************************
Terry Reese
Cataloger for Networked Resources
Digital Production Unit Head
Oregon State University Libraries
Corvallis, OR 97331
tel: 541-737-6384
email: terry dot reese at oregonstate dot edu
http:
http://oregonstate.edu/~reeset
*******************************************
> -----Original Message-----
> From: innopac-bounces at innopacusers dot org [
mailto:innopac-
> bounces at innopacusers dot org] On Behalf Of Jon Dillon
> Sent: Thursday, January 24, 2008 12:52 PM
> To: innopac at innopacusers dot org
> Subject: [IUG] LibraryThing content does not refresh when
> usingnext/previous buttons
>
> We just started to display LibraryThing content in our OPAC and so far
> feedback has been positive. However, we discovered a pretty major
> problem in the implementation. In fact, this might be a problem with
> all
> Innovative libraries who are using LibraryThing. I'm not sure if
others
> are aware of the issue so I will share it here.
>
> As you probably know, the LibraryThing Tag Browser uses an ISBN search
> to retreive records from the OPAC. If a record is retreived this way,
> and then you click on the next or previous record buttons, the
> LibraryThing content is not refreshed. The content from the first
> record
> stays in every record you go to.
>
> You can try it using this record:
http://lis.wwu.edu/record=b1883334
> and
> following the steps below. You can also try it in your own catalog to
> see if you are seeing the same results.
> *Click on any tag to open the LT Tag Browser and choose a title
> from the "Books tagged" list
> *Take note of the "Similar Books" and "Tags" for the record you
> chose
> *Now click on the "Next" button
> *You will see that the LibraryThing content does not change
>
> I have contacted LibraryThing about this but haven't heard back from
> them. I'm also wondering if anyone else has experienced this problem
> and
> possibly talked to someone about a fix?
>
> Thanks--Jon Dillon
>
> --
> This message was distributed through the Innovative Users Group
INNOPAC
> list
> Public replies: INNOPAC at innopacusers dot org
> Update your subscription options:
>
http://innopacusers.org/mailman/listinfo/innopac