HTML to auto update webpage AND SCROLL ?

Discussion in 'Trading Software' started by Funster, Jan 26, 2004.

  1. Funster

    Funster

    Hi,

    The following HTML code will automatically refresh a webpage. Handy for free real time index updates on Yahoo for instance when you can't be bothered to log in to your normal quote provider.

    However I would also like it to scroll down the page a little bit so that I can see the whole chart rather than a great big advertising banner at the top on each refresh.

    Anyone with "The Knowledge" care to update it for me?

    Thanks

    Funster

    <!--Internet Real Time Quote Auto-updating

    Please follow the instructions below in order to create a page that will automatically refresh any Internet page (view sample page). There is nothing sophisticated about this page. It uses very basic HTML to update the required page in a single frame.

    This has only been tested on Internet Explorer. It does not work reliably in Netscape. However, as soon as we have determined what the problem is we will upload a page that will do the same thing on Netscape.

    The instructions below refer to Windows. Details may differ for other operating systems.

    Select and copy (Ctrl+c) the following HTML code (beginning with the first < and ending with the last >.-->

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD><TITLE>Real Time Price Page Auto Refresh</TITLE>
    <META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
    <!-- The following tag determines how frequently the page will update.
    The default is 30 seconds.
    This can be adjusted by changing the value of CONTENT="30".
    E.g. CONTENT="45" would make the refresh time 45 seconds. -->

    <META HTTP-EQUIV="refresh" CONTENT="30">

    </HEAD><FRAMESET cols=* rows=*>

    <!-- The following source will automatically refresh the content of any URL.
    The default page below will automatically refresh the delayed quote for Scoot at DLJ.
    To change the web page put the full address of the page you want to refresh
    in between the quote marks. -->

    <FRAME src="http://uk.finance.yahoo.com/q?s=^DJI
    &d=c&t=5d&l=on&z=b&q=l">
    </FRAMESET></HTML>

    <!--Open Windows Notepad.
    Paste (Ctrl+v) the code into Notepad.
    Read the comments between the <!-- --> tags and edit the source as required.
    Save the edited file as rt_page_refresh.htm
    Open rt_page_refresh.htm in Internet Explorer
    The page should now work but note the following:

    You will probably need to log onto your RT quote provider in the normal way first.
    If using a service like Freequotes it might work better if you break the frame. To do this, right click on the browser window and then click Open Frame in New Window. You will then have the URL of the frame you are wanting to refresh.-->
     
  2. gms

    gms

    Might as well simply use a web query in excel to download the same data and have that refresh at whatever rate you deem.

    Plus, the excel query can download data for multiple tickers in one query.
     
  3. What you want to have is called web content scrapping. You can analyse the html structure returned from the URL and write a simple JavaScript code to manuplate the html content using DHTML DOM. With enough code, you can show the chart image only without seeing any other contents.

    The latest Excel does this scrapping for you automatically.

     
  4. I think you may mean scraping, as it's a descendant of the old technique of screen-scraping from mainframe and DOS apps.
     
  5. Funster

    Funster

    I have really been trying to find the solution to this and http code just does not seem to make sense to me (and I used to program 6502 machine code in the 1980s!).

    I do not want it in excel !!! - it is easier to use in individual files for each index I want to follow.

    So boiling down the original working code to:

    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <meta http-equiv="refresh" content="3">
    </head>

    <frameset cols="*">
    <frame src="http://uk.finance.yahoo.com/q?s=^STOXX50E&amp;d=c&amp;t=5d&amp;l=on&amp;z=b&amp;q=l">
    </frameset>




    I have tried adding the line

    <body onload="self.scrollTo(0,100)">

    at every junction in the above code but it refuses to work. However it will work in the following code:



    <head>
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    </head>

    <body onload="self.scrollTo(0,100)">

    <ilayer id="x">

    <p>Copy and paste this bit several times so that you actually have a page to
    scroll down.</p>

    </ilayer>

    </body>



    So c'mon someone - help me put the two functions together !
    :)
     
  6. I haven't tried this, but if you name the frame and set the scrollto on that name instead of self, it may work.

    Code:
    <FRAME NAME=leftframe SRC="contents.htm">
    
    <body onload="leftframe.scrollTo(0,100)">
    
     
  7. After I posted that, I looked in google.

    If you search for scrollto html frame, you will get a ton of hits, many of which look like they will help you.

    Good luck.