Announcement

Collapse
No announcement yet.

downloading files using http object

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • downloading files using http object

    I am trying to download daily economic news from dailyfx website
    http://www.dailyfx.com/calendar/inde...urrencyFilter=|&importanceFilter=|

    The url of the csv format file is
    http://www.dailyfx.com/calendar/Dail...urrencyFilter=|&importanceFilter=|


    I put the following function in preMain(). However it seems it does not work. Can someone take a look and tell me what is wrong? Thanks in advance.

    function updateDailyFXEventFile()
    {
    var u = "http://www.dailyfx.com/calendar/Dailyfx_Global_Economic_Calendar.csv?currentWeek=/events-calendar/2008/0302/&direction=none&collector=allInFolderDateDesc&view =week&timezone=default&currencyFilter=|&importance Filter=|";
    var v = new HTTP(u);
    if ( v.open("rt") ) {
    debugPrintln("file is opened");
    while( !v.eof() ) {
    debugPrintln(v.readln());
    }
    }
    else {
    debugPrintln("file can not be opened");
    }
    v = null;
    }


    - Clearpicks

  • #2
    Re: downloading files using http object

    Hi Clearpicks,

    I took your efs and created a separate efs and without modification it worked well. Here is the partial output:

    PHP Code:
    file is opened
    Date
    ,Time,Time Zone,Currency,Description,Importance,Actual,Forecast,Previous
    Sun Mar 2
    ,5:30 PM,EST,AUD,AUD AiG Performance of Mfg Index (FEB),Low,51.4,,49.2
    Sun Mar 2
    ,6:30 PM,EST,AUD,AUD TD Securities Inflation (MoM) (FEB),Low,0.3,,0.3
    Sun Mar 2
    ,6:30 PM,EST,AUD,AUD TD Securities Inflation (YoY) (FEB),Low,4.0,,3.9
    Sun Mar 2
    ,7:30 PM,EST,AUD,AUD Company Operating Profit (QoQ) (4Q),Medium,3.9,2.0,-2.1

    Fri Mar 7
    ,3:00 PM,EST,USD,USD Consumer Credit (FEB),Low,,$7.0B,$4.5B
    Fri Mar 7
    ,9:45 PM,EST,USD,USD Treasury's Paulson Gives Keynote Address at Stanford,Low,,, 
    The efs is attached below. You'll see that I copied yours then called the function. No main or preMain functions added.

    Originally posted by clearpicks
    I am trying to download daily economic news from dailyfx website
    ...

    I put the following function in preMain(). However it seems it does not work. Can someone take a look and tell me what is wrong? Thanks in advance.

    ...

    - Clearpicks
    Attached Files

    Comment


    • #3
      Steve,

      Thank you.

      - Clearpicks

      Comment


      • #4
        Hi Clearpicks,

        Your most welcome.

        Originally posted by clearpicks
        Steve,

        Thank you.

        - Clearpicks

        Comment

        Working...
        X