[Slogger] Trouble With Variable "$url"

mook at themook.net mook at themook.net
Thu Feb 16 21:56:49 EST 2006


Unfortunately I'm not sure this is workaround-able...I put in the 
code you posted, hit "OK", hit the Slogger Button 1 (which is set 
to run this profile) ... and nothing saved.

I went back to the profile, checked the 'Custom Script' tab, and 
as you said the code had removed the doubleslashes - so I 
recopied and repasted your code, and added an 'alert(a);' line so 
I could test the code.  When I clicked 'Test' the alert box 
appeared, AND the URL looked perfect - no "?", no ":", and no 
"/".  

So, it seems to work when testing from the Custom Scripts tab - 
but when actually archiving a page, it still doesn't fire, no joy.  

Mook
http://www.themook.net

On 16 Feb 2006 at 21:36, Ken Schutte wrote:
> Ahh, yeah you picked up on a couple mistakes,  the "a.replace()" returns 
> the new string, instead of modifying "a".  The other problem is with 
> escaping special characters, and is pretty confusing.  Put this as the 
> script:
> 
> var a = sloggerGetVar("url");
> a = a.replace(/\\\:/g, "_");
> a = a.replace(/\\\?/g, "_");
> a = a.replace(/\\\//g, "_");
> sloggerSetVar("url",a);
> 
> This should work, ... BUT if you ever modify that profile again (i.e. 
> Edit Profile and hit OK), it you'll notice the extra pair "\\" missing 
> in each line, and you'd have to add them back again.  Yeah, this is a 
> delicate hack, but should work for now...
> 
> Ken





More information about the Slogger mailing list