Print

Print


On Thu, Jun 11, 2009 at 11:34 AM, Derik Badman<[log in to unmask]> wrote:
> Hello all,

> 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 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?

>
> 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?).
>

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