Capturing a data stream

NastyItch

Member
Messages
78
Likes
0
Does anyone know of a way, using HTML and Javascript only, to capture a data stream and save it to a file.

From this URL you get a lovely CSV ascii data string (IE only). How can this be saved to a file?

uk.fintest.yahoo.com/d/quotes.txt?s=aal&m=L&f=snd1t1b2b3c1ghov

Looking forward to some innovative responses :cheesy:
 
I don't know how to make IE save it automatically - every time I need to retrieve a file automatically, I use wget.

Hope this helps,

-svengali
 
If you have excel, you could try the following.
Open a new worksheet and go to the tools menu where you should see MACRO. From there open the Visual Basic Editor and
create a new form. Place a button on the form and also the Microsoft Inet control.
The following code is setup to retrive the line of data into a comma delimited file.
If you put a timer on it, you will save this data every 10 seconds or every minute, whichever you fancy.


Private Sub CommandButton1_Click()

Inet1.AccessType = icUseDefault
Dim strURL As String
Dim fnum As Integer
Dim Textline As String

fnum = FreeFile
' Assign URL
strURL = "http://uk.fintest.yahoo.com/d/quotes.txt?s=aal&m=L&f=snd1t1b2b3c1ghov"
'Name file to save data too
FTSEFile = "D:\Trading\Data\AAL.csv"
' Retrieve the data into Textline
Textline = Inet1.OpenURL(strURL, icString)
Open FTSEFile For Append As #fnum
Print #fnum, Textline
Close #fnum

End Sub
 
Thanks to both of you.

Svengali, wget did not seem to recognise this as a 'virtual' file that is created by you using the URL to retrieve data. But its useful anyhow for other applications. Many thanks

X-ray, this worked quite well. Now for the automation which I should be able to do
Thanks again
 
Top