1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

javascript monitoring in html

Discussion in 'Web & Email' started by mrpeenut24, Jan 25, 2005.

Thread Status:
Not open for further replies.
Advertisement
  1. mrpeenut24

    mrpeenut24 Thread Starter

    Joined:
    Jan 25, 2005
    Messages:
    8
    Is there a tool that'll log all the pages' and files' locations loaded when browsing, or something like that? i.e. when pages have things written in JavaScript, is there a way to see what it's opening and where from, so that you can open them manually?

    (btw i use firefox and understand that many internet browser programs don't work for it. i can resort to IE when necessary, but would prefer if it were for ff.)
     
  2. mrpeenut24

    mrpeenut24 Thread Starter

    Joined:
    Jan 25, 2005
    Messages:
    8
    bump (hope thats ok...i really need help on this one)
     
  3. Heatsink

    Heatsink

    Joined:
    Dec 7, 2004
    Messages:
    98
    This is a total shot in the dark, but you might have some luck searching for web browsers for the visually impaired.

    I've heard of them, but never seen one. I understand that they load a webpage and then 'read' the links or something like that. I'm assuming that in order to 'read' the page, the links have to be parsed out somehow. The might be parsed out into some form you can use.

    Shrug...worth a try.

    Alternatively, you can 'web scrape' a site using an offline web browser such a WinHTTrack. You basically point it to a web page and it will download the entire thing for you. Maybe you can use that? Hard to tell because I don't really know what you want to do.

    HTH.
     
  4. mrpeenut24

    mrpeenut24 Thread Starter

    Joined:
    Jan 25, 2005
    Messages:
    8
  5. Heatsink

    Heatsink

    Joined:
    Dec 7, 2004
    Messages:
    98
    Doubtful, they've coded their site this way to prevent exactly what you're trying to do.

    Here's the overview of what's going on. The following code snippets were taken from the first link in your previous post.

    This javascript:

    Code:
    <script language="javascript" src="http://a1568.g.akamai.net/7/1568/1600/20041219043236/launch.yahoo.com/common/includes/js/common_playvideos_us.js"></script>
    imports a file called common_playvideos_us.js from the launch.yahoo.com domain. Presumably the imported code contains, amongst other things, at least a function entitled playVideos() which takes as an argument a number that presumably identifies a single video.

    Later on in the page, this code:

    Code:
    <a href="javascript:playVideos(2157472);"><img src="http://a1568.g.akamai.net/7/1568/1600/20040916171844/launch.yahoo.com/library/resources/us/en/artst_btn_watch.gif" border="0" height="17" width="19"></a>
    calls this playVideos() function and supplies the argument (in this case 2157472). To recap - this piece of code calls the function that plays videos and tells it (via the number) which video to play.

    So what, right?

    Well, the location of the video file is only known to the common_playvideos_us.js file, or some other file that it talks to...who knows. So, to have any chance at all of finding out where the actual vidoe file is, I think you're probably going to have to get at the common_playvideos_us.js file.

    This may or may not be hard. I believe that the common_playvideos_us.js file has to be downloaded to your computer in order for it to execute and therefore you might be able to find it in your temp files (but it will have some other name and therefore isn't going to be easy to find).

    This is somewhat a shot in the dark. If yahoo was actually stupid enough to put the actual URL or the video file in the common_playvideos_us.js file then you'll be able to get it assuming you can actually find the file in your temp files.

    I'd be willing to bet that Yahoo isn't that stupid though, and the common_playvideos_us.js file simply supplies some kind of variable to a server side script that knows the locations of the files. Since you won't have access to any of the server side scripts, you're pretty much SOL.

    Who knows though, screw around with it. You might get lucky...
     
  6. mrpeenut24

    mrpeenut24 Thread Starter

    Joined:
    Jan 25, 2005
    Messages:
    8
    ok, ive already done all of this, and to get to the common_playvideos_us.js file, all you have to do is insert the url and it takes you right there.
    the second code snippet you inserted is only a .gif button that you click on to take you to play the movie.
    i had already followed the common~.js file and got to the file. ive taken enough java to know what to do for the most part.
    they dont tell you the exact url of the file...but they give you enough in the common~.js file to find the java variable that directs you to the video. ill give you the command:
    Code:
    var videoWin = window.open("http://" + window.location.hostname + "/musicvideos/player/playvideo.asp?vid=" + videoID + "&" + params + "&redirectURL=" + escape(redirectURL), 'videoPlayerWindow', 'WIDTH=690,HEIGHT=520');
    the window.location.hostname refers to launch.yahoo.com
    the videoID for the video i want is 2158811
    the params is explained above in the code as such:
    Code:
    //var params = 'vid=' + videoID + '&tw=' + windowName;
            if ( pv_isBlank(clientID) ) clientID = 1;
    	if ( !isNaN(clientID) ) params += '&cid=' + clientID;
    	if ( !isNaN(playerSkin) ) params += '&ps=' + playerSkin;
    	if ( !pv_isBlank(showPath) ) params += '&sx=' + escape(showPath);
    	if ( !isNaN(bandwidth) ) params += '&bw=' + bandwidth;
    	if ( !pv_isBlank(vo) ) params += '&vo=' + vo;
    	if ( !isNaN(forceSplash) ) params += '&fs=' + forceSplash;
    it describes windowName as such:
    Code:
    var windowName = ( pv_isBlank(self.name) ) ? 'LaunchVideoTarget' : self.name;
    so the params without all the if statements are this:
    vid=2158811&tw=LaunchVideoTarget

    at the top of the common~.js file, it says if we don't know a value, we can call it undefined.
    so lets fill in what we know:
    set clientID = 1;
    add that to params:
    vid=2158811&tw=LaunchVideoTarget&cid=1
    then the player skin...undefined, not important:
    vid=2158811&tw=LaunchVideoTarget&cid=1&ps=undefined
    then the escape path (most likely where its going to go when the video is finished)...i wasnt too sure about this one, but if you put it as undefined, it tells you that it is an invalid path. and in the code it shows "p/m.xml" so we'll add that:
    vid=2158811&tw=LaunchVideoTarget&cid=1&ps=undefined&sx=p/m.xml
    next we need the bandwidth, being that im on broadband, we'll put 300:
    vid=2158811&tw=LaunchVideoTarget&cid=1&ps=undefined&sx=p/m.xml
    and i'm not too sure about the other two, and i've found i can just leave them out entirely, so let's just do that.
    it then says to add a referer, which i just put as undefined. and here's what we're left with:
    vid=2158811&tw=LaunchVideoTarget&cid=1&ps=undefined&sx=p/m.xml&referer=undefined
    so thats your params!!!

    so we combine all of this together and get:
    http://launch.yahoo.com/musicvideos...? perhaps any way to get the entire package?
     
  7. sekirt

    sekirt

    Joined:
    Mar 28, 2003
    Messages:
    3,998
    I don't feel like playing with this particular situation, but download either or both of these programs. They might get the location. Both freeware.

    Spider
    http://www.fsm.nl/ward/

    Super Winspy
    http://www.acesoft.net/winspy/

    At some point in your quest, you might cross the lines of this forum. Hacking would not be allowed. But if the info is on your computer somewhere, I don't see a problem.

    sekirt
     
  8. Heatsink

    Heatsink

    Joined:
    Dec 7, 2004
    Messages:
    98
    Heya

    It's true that the anchor tag is wrapped around a gif image, but the point of that code snippet was to show you where the javascript function is called - which is in that anchor tag.

    You've done a lot of work, nicely done. I still think the brick wall is the server side script playvideo.asp. If you can't derive the actual file name from the js file then in that asp script must be where the magic takes place. Without having access to that asp script....shrug. I don't know where to go from there.

    Good luck!
     
  9. mrpeenut24

    mrpeenut24 Thread Starter

    Joined:
    Jan 25, 2005
    Messages:
    8
    alright thanx to both of you.
    if anyone has any ideas lemme know. ill post back if i get something. :D
     
  10. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - javascript monitoring html
  1. Cetaceous
    Replies:
    4
    Views:
    859
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/323478

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice