[Linux-disciples] Evaluating a Javascript function

Adam Rosi-Kessel adam at rosi-kessel.org
Fri Oct 8 09:30:56 EDT 2004


You probably need to save the .js file from NPR locally, and edit it to
display the ultimate URL to the screen, e.g., with a document.write()
function call.  You will then be able to see the URL and copy it into
your grabber.

You should also be able to see the URL of the current stream *from*
realplayer.

This isn't really scriptable as it is now, since wget et al. won't be
able to parse the JavaScript.  To do that, you'd have to rewrite the NPR
JavaScript file as PHP/Perl or whatever.  It's kind of a pain.

Another option is capturing the output from RealPlayer, or using mplayer
as your RealPlayer plugin and having *that* record to file.

On Thu, Oct 07, 2004 at 09:12:15PM -0400, Stephen R Laniel wrote:
> I'm trying to download media from NPR's site, specifically
> the RealAudio or Windows Media file here:
> http://shorl.com/hirugovafemu
> 
> The media file is in one of those irritating-to-pierce
> Javascript obfuscators, namely
> 
> javascript:getMedia('ATC', '05-Oct-2004', '7', 'RM,WM');
> 
> getMedia is defined here:
> 
> http://shorl.com/fomutirabrigri
> 
> I'd like to be able to write a script that could just
> evaluate getMedia() with the given arguments and return for
> me the bloody URL that it refers to, which I could then pass
> to wget and retrieve.
> 
> I tried to figure out what the JavaScript Console in Firefox
> was all about, to no avail. I thought if I just added the
> getMedia() function call above into the 'evaluate' line,
> that I'd get what I wanted. That didn't work.
> 
> In any case, I'd like to be able to script this, so the
> Javascript Console probably isn't what I want. What would I
> use?
> 

> -- 
> ``I am all about the delivery of *justice* to
>   parking, people. That is all.''
>  -Jon Sung, 27 September 2004
> 
> _______________________________________________
> Linux-disciples mailing list
> Linux-disciples at lists.bostoncoop.net
> http://lists.bostoncoop.net/mailman/listinfo/linux-disciples

-- 
Adam Rosi-Kessel
http://adam.rosi-kessel.org


More information about the Linux-disciples mailing list