[Slogger] Trouble With Variable "$url"

mook at themook.net mook at themook.net
Thu Feb 16 15:22:16 EST 2006


Hi Ken,

Thanks for the quick turnaround  : )

The pages I have archived in the past were saved along the 
lines of:

Original Remote Site
http://www.site.com/article.html?id=001
http://www.site.com/article.html?id=002
http://www.site.com/article.html?id=003

Local Files
http _www.site.com_article.html id=001.html
http _www.site.com_article.html id=002.html
http _www.site.com_article.html id=003.html

Local Directories
http _www.site.com__article.html id=001_files
http _www.site.com__article.html id=002_files
http _www.site.com__article.html id=003_files

It looks like "/" became "_", and "?" became " ", etc.  I'm afraid I 
have no idea how to recreate that with a custom javascript 
though - I have just enough knowledge to break things, but not 
enough to actually be competent  : D

The part of the URL I'm really trying to retain is the "id=00X" 
part - without that I have no idea what the article actually is (I 
have a spreadsheet that lists the names of the articles and their 
corresponding numbers).  If I archive only based on a time-date 
stamp, it leaves me no way of knowing which article a particular 
file refers to. Is there another variable I might be able to use for 
that?  (I've tried "$filename" and "$path" with no luck).

Thanks!

Mook
http://www.themook.net

On 16 Feb 2006 at 15:08, Ken Schutte wrote:
> Hi,
> 
> I believe the problem is that it's generating invalid filenames.  The 
> $url variable holds the full url, which could be 
> "http://www.asdf.com/adsf?a=1;b=2" or something.  From saved pages in 
> the past, what would the final filename be for something like this?  Did 
> it escape some characters or just remove them?
> 
> Some of the old Slogger code used to have a copy of some of Mozilla's 
> code for saving pages.  In newer Slogger, some of these functions were 
> implemented differently, but I can try to find this part that cleaned up 
> the filename and put it back in there.
> 
> In the meantime, it might be possible in the current version if you 
> change $url variable in a custom javascript, although it's a bit 
> complicated... somthing like:
> 
> var a = sloggerGetVar("url");
> // modify a, replacing bad chars
> sloggerSetVar("url",a);
> 
> Ken




More information about the Slogger mailing list