all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
27
Task/Web-scraping/REBOL/web-scraping.rebol
Normal file
27
Task/Web-scraping/REBOL/web-scraping.rebol
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
REBOL [
|
||||
Title: "Web Scraping"
|
||||
Author: oofoe
|
||||
Date: 2009-12-07
|
||||
URL: http://rosettacode.org/wiki/Web_Scraping
|
||||
]
|
||||
|
||||
; Notice that REBOL understands unquoted URL's:
|
||||
|
||||
service: http://tycho.usno.navy.mil/cgi-bin/timer.pl
|
||||
|
||||
; The 'read' function can read from any data scheme that REBOL knows
|
||||
; about, which includes web URLs. NOTE: Depending on your security
|
||||
; settings, REBOL may ask you for permission to contact the service.
|
||||
|
||||
html: read service
|
||||
|
||||
; I parse the HTML to find the first <br> (note the unquoted HTML tag
|
||||
; -- REBOL understands those too), then copy the current time from
|
||||
; there to the "UTC" terminator.
|
||||
|
||||
; I have the "to end" in the parse rule so the parse will succeed.
|
||||
; Not strictly necessary once I've got the time, but good practice.
|
||||
|
||||
parse html [thru <br> copy current thru "UTC" to end]
|
||||
|
||||
print ["Current UTC time:" current]
|
||||
Loading…
Add table
Add a link
Reference in a new issue