[script] Re: Request for info via website
[1/2] from: gjones05::mail::orion::org at: 5-Feb-2001 13:14
Hi, William,
I'm no pro but this should get you started. if you are looking for a 'get
request. 'Post requires a slight modification.
a: b: c: d: 0
bump: func [
a-blk [block!]
] [
a: a + 1
if a > 9 [
a: 0
b: b + 1
if b > 9 [
b: 0
c: c + 1
if c > 9 [
c: 0 d: d + 1
]
]
]
]
e: copy ""
while [e <> "9999"] [
e: rejoin [
(to-string d)
(to-string c)
(to-string b)
(to-string a)
]
page: read rejoin [http://www.thesite.dom/cgi-bin/mycgi.cgi?value= e]
; parse page to get info you are looking for
bump [a b c d]
]
You will need to find the URL for the form and modify the line that starts
with 'page. There is a space after the equal sign and before the 'e.
I have little doubt that the real maestro's could do better in fewer lines,
but it should get you rolling.
-- Scott
----- Original Message -----
From: "William" <[new_asia8--hotmail--com]>
To: <[rebol-list--rebol--com]>
Sent: Sunday, February 04, 2001 8:43 AM
Subject: [REBOL] Request for info via website
> Dear everyone,
>
> I have just tried out Rebol and am amazed with the amazing stuff it can do
with just a few lines of programming. My intention is to programme a script
that can automatically retrieve information from a website without me having
to manually key in the query parameters. Basically, there is this web page
allows users to search the dates a 4-digit number has appeared in the past
draws. As I do not want to key in all 10000 permutations of 4-digit numbers.
I like Rebol to loop and submit search requests automatically on this web
page and save the returned results.
> I have browsed through the existing srcipts in the library but can't seem
to find/realise any that could help me with this. Anyone care to give your
comments or advice on how I should embark on this project? Any comments is
greatly appreciated.
[2/2] from: gjones05:mail:orion at: 5-Feb-2001 15:20
Duuuuhhhh. Sorry, crew...
I finally dawned on me how to shorten the script and always keep the value
to 4 places...
a: 0
while [a < 10000] [
page: read rejoin [http://www.thesite.dom/cgi-bin/mycgi.cgi?valuecopy/part "0000" 4 -
length? to-string a a]
; parse page to get info you are looking for
a: a + 1
]
Hopefully my last response on this message (assuming I didn't goof again
:-).
--Scott