Subject: [CODE4LIB] Newbie asking for some suggestions with javascript

From: Derik Badman <[email-masked]>
Date: Thu, 11 Jun 2009 12:34:09 -0400

Hello all,

Just joined the list, and I'm hoping to get a suggestion or two.

I'm working on using the ticTOCs ( http://www.tictocs.ac.uk/ ) text file of
rss feed urls for journals to insert links to those feeds in our Serials
Solution Journal Finder.

I've got it working using a bit of jQuery.

Demo here: http://155.247.22.22/badman/toc/demo.html
The javascript is here: http://155.247.22.22/badman/toc/toc-rss.js

Getting that working wasn't too hard, but I'm a bit concerned about
efficiency and caching.

I'm not sure the way I'm checking isbns against the text file is the most
efficient way to go. Basically I'm making an ajax call to the file that
takes the data and makes an array of objects. I then query the isbn of each
journal on the page against the array of objects. If there's a match I pull
the data and put it on the page. I'm wondering if there's a better way to do
this, especially since the text file is over 1mb. I'm not looking for code,
just ideas.

I'm also looking for any pointers about using the file itself and somehow
auto-downloading it to my server on a regular basis. Right now I just saved
a copy to my server, but in the future it'd be good to automate grabbing the
file from ticTOCs server on a regular basis and updating the one on my
server (perhaps I'd need to use a cron job to do that?).

Thanks for much for any suggestions or pointers. (For what it's worth, I can
manage with javascript or php.)

-- 
Derik A. Badman
Digital Services Librarian
Reference Librarian for Education and Social Work
Temple University Libraries
Paley Library 209
Philadelphia, PA
Phone: 215-204-5250
Email: [email-masked]
AIM: derikbad

"Research makes times march forward, it makes time march backward, and it
also makes time stand still." -Greil Marcus

---

From: Jon Gorman <[email-masked]>
Date: Thu, 11 Jun 2009 13:03:56 -0500

> this, especially since the text file is over 1mb. I'm not looking for code,

I guess the first question is if it is really necessary to use a text
file?  I'm not entirely clear on this process, but perhaps the text
file could be imported into a database.  You could attempt to use some
sort of function that cleans up ISBNs and use that as the lookup.  You
might run into occasional issues such as ISBNs not being unique, but
it sounds like you could run into that issue in any case.

Then of course perhaps there's some way to add this to the Serials
Solution database directly?  Then you don't need another javascript at
all?

> server (perhaps I'd need to use a cron job to do that?).

cron + wget/curl would be a good first step it would seem.  You might
want some sort of script that monitors changes or the like.  (Maybe
send you an email if there's no updates in x days or something like
that).

Jon Gorman

---

From: Tom Pasley <[email-masked]>
Date: Fri, 12 Jun 2009 06:46:59 +1200

Hi Derik,

This looks good... I suppose the question to some of your questions is
what's in your toolbox?

Specifically:

- Are you running on windows or unix on the server?
- Are you able to install anything on the server - are you an admin or
similar?
- Are you able to run a scripting language like PHP on the server?
- Do you have access to a database such as MySQL or MSSQL, etc?

I agree with Jon - it'd be much more efficient to store this in a database,
and your looking at a simple table to store the ticTocs data.

Answers to these questions will help listserv members come up with suitable
suggestions - it seems you're comfortable with javascript, so I think you'd
be fine with something like Perl of PHP.

cheers,

Tom

---

From: Derik Badman <[email-masked]>
Date: Thu, 11 Jun 2009 15:36:13 -0400

On Thu, Jun 11, 2009 at 2:03 PM, Jon Gorman <[email-masked]>wrote:

> file could be imported into a database.

At this point the text file is a stop-gap api that ticTOCs is offering
(supposedly working an actual api), so this will probably be a temporary
situation. I could put all the data into mysql, though then I'd have to
figure out how to check the text file for changes and then update the
database accordingly.

> Solution database directly?  Then you don't need another javascript at

I'm so disillusioned with them, that I didn't even consider that...

> send you an email if there's no updates in x days or something like

Thanks, I'll look into that.

---

From: Derik Badman <[email-masked]>
Date: Thu, 11 Jun 2009 15:37:47 -0400

> -Are you able to install anything on the server - are you an admin or
>
similar?
> - Do you have access to a database such as MySQL or MSSQL, etc?

Its unix with php and mysql working on it. I'm not an admin though.

> it seems you're comfortable with javascript, so I think you'd

I can get by with php, probably moreso than with javascript at this point.

---

From: Annette Bailey <[email-masked]>
Date: Thu, 11 Jun 2009 16:08:20 -0400

Godmar Back wrote a web service in python for ticTOC with an eye to
incorporating links into III's Millennium catalog.

http://code.google.com/p/tictoclookup/

http://tictoclookup.appspot.com/

Annette

---

From: Roy Tennant <[email-masked]>
Date: Thu, 11 Jun 2009 13:48:10 -0700

This data (the Tic-Tocs RSS URLs) is also available via xISSN. For example:

<http://xissn.worldcat.org/webservices/xid/issn/1095-9203?method=getMetadata
&format=xml&fl=*>

Look for the "rssurl" attribute. For information on xISSN see:

<http://xissn.worldcat.org/xissnadmin/>

Roy

--

---

From: Annette Bailey <[email-masked]>
Date: Thu, 11 Jun 2009 16:55:57 -0400

Roy,

Just to clarify, you have to be an OCLC cataloging member to use this
beyond 100 uses per day, correct?

Thanks,
Annette

---

From: Godmar Back <[email-masked]>
Date: Thu, 11 Jun 2009 23:55:11 -0400

Yes - see this email
http://serials.infomotions.com/code4lib/archive/2009/200905/0909.html

If you can host yourself, the stand-alone version is efficient and easy to
keep up to date - just run a cronjob that downloads the text file from JISC.
My WSGI script will automatically pick up if it has changed on disk.

 - Godmar

---

From: "Boheemen, Peter van" <[email-masked]>
Date: Fri, 12 Jun 2009 09:22:50 +0200

Or use the modified xissn service of OCLC: http://xissn.worldcat.org/webservices/xid/issn/1095-9203?method=getMetadata&fl=issnl,rssurl
 
Peter
 
Drs. P.J.C. van Boheemen
Hoofd Applicatieontwikkeling en beheer - Bibliotheek Wageningen UR
Head of Application Development and Management - Wageningen University and Research Library
tel. +31 317 48 25 17                                                                                    http://library.wur.nl <http://library.wur.nl/> 
P Please consider the environment before printing this e-mail

________________________________

From: Code for Libraries on behalf of Godmar Back
Sent: Fri 12-6-2009 5:55
To: [email-masked]
Subject: Re: [CODE4LIB] Newbie asking for some suggestions with javascript

Yes - see this email

 - Godmar

---

From: Derik Badman <[email-masked]>
Date: Mon, 15 Jun 2009 10:59:45 -0400

Thanks for the suggestions and links, everyone.

I'll check them out and see what will work for me.