[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Reading/Writing JavaScript Array in Perl (redux)



It's been almost a year since I last visited this subject.  For those of 
you who weren't here a year ago you may want to peruse the archive.

A quick refresher:

I have a JavaScript on my website which provides a nifty DHTML newsfader. 
 The script comes courtesy <http://www.webreference.com/>  and was very 
recently updated.  Version 2.01 includes some Mac-specific bug fixes (to 
which I humbly admit to having helped with).  Most of the bug-fixes 
revolve around simply getting it to function at all under IE4 on the Mac, 
but there was also a problem with the 'this' function not working 
correctly under NS version 4.05 and earlier.  You can find the newsfader 
at <http://www.dhtmlab.com/>, which is actually a redirect to the 
Webreference site.

What I'd wanted to do a year ago was to read from the file which contains 
the list of links the script uses, and generate an animated GIF to be 
used in place of the ticker on browsers which don't support DHTML 
(JavaScript 1.2 + CSS).  Although the code worked as advertised, I never 
actually deployed the solution.  Usage of 3.0 and earlier browsers seems 
to have fallen WAY off, and I'm no longer convinced that the 'solution' 
is needed.

However, NEW problem;

Updating the JavaScript array by hand every time I modify the site gets 
tedious.  Since I'm doing all my work in BBEdit anyway, my thinking is 
that I should be able to create a Perl script which looks for all the 
most recently modified pages in the local copy of the site's directory 
tree, and writes the relative URL and contents of the <TITLE> tag to the 
'news.js' file.

Problems:  The array format has changed with the new version.  Although 
the old version of the array will still work, I'd rather not switch back. 
 Also, this is almost the REVERSE of what I was trying to do before, 
since the JavaScript array is now the OUTPUT file rather than the input 
file.

Here's what the output file should look like:

<http://www.mycoinfo.com/news.js>

Any practical suggestions welcome.  Things like traversing directories 
and checking modification dates.  Once again I find myself completely 
clueless.

--B


# Brian McNett                                      Fungal Parataxonomy
# Webmaster, Staff Writer               Mycology Information (Mycoinfo)
#                              **The World's First Mycology E-Journal**   
# <mailto:webmaster@mycoinfo.com>            <http://www.mycoinfo.com/>
# First they ignore you. Then they laugh at you. Then they fight you.
# Then you win.                                     --Mohandas Gandhi


# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org