[racket] read WebPage
Hi Racket users,
I'm trying to extract some information from a webpage.
First attempt is to read the complete page
Later i will try to filter the StockPrice and Volume at a certain time
The goal is to calculate what direction the StocPrice is moving in
multiplied by the number of Stocks that changed owner during vast amounts
of time.
Like if it was a moving/accelerating mass in fysics and you want to know
it's momentum
The value of this program is void.
It's just for fun.
The first problem I encounter is that reading the webpage stops at the
first curly bracket
#lang racket
(require net/url)
(define GLE (get-pure-port (string->url "
http://www.tijd.be/beurzen/Societe_Generale.360017048")))
(define readPage
(lambda (ticker)
(read/recursive ticker)))
(define readMore
(lambda ()
(let ([length (pipe-content-length GLE)])
(if (< (file-position* GLE) length) ((display (readPage GLE))
(readMore)) (print 'Finished)))))
(readMore)
error --> .....ascript>djConfig=. read: unexpected `}'
Sorry for the naive code, i'm just a beginner.
Thanks in advance
Frank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130612/0f1deb1f/attachment.html>