Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
36
Task/Web-scraping/NetRexx/web-scraping.netrexx
Normal file
36
Task/Web-scraping/NetRexx/web-scraping.netrexx
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/* NetRexx */
|
||||
options replace format comments java crossref symbols binary
|
||||
|
||||
parse arg full_short .
|
||||
if 'FULL'.abbrev(full_short.upper(), 1) then
|
||||
dateFull = isTrue()
|
||||
else
|
||||
dateFull = isFalse()
|
||||
do
|
||||
timeURL = java.net.URL('http://tycho.usno.navy.mil/cgi-bin/timer.pl')
|
||||
conn = timeURL.openConnection()
|
||||
ibr = BufferedReader(InputStreamReader(conn.getInputStream()))
|
||||
line = Rexx
|
||||
loop label readLoop while ibr.ready()
|
||||
line = ibr.readLine()
|
||||
if line = null then leave readLoop
|
||||
line = line.translate(' ', '\t')
|
||||
if line.wordpos('UTC') > 0 then do
|
||||
parse line . '>' udatetime 'UTC' . -
|
||||
0 . '>' . ',' utime 'UTC' .
|
||||
if dateFull then
|
||||
say udatetime.strip() 'UTC'
|
||||
else
|
||||
say utime.strip()
|
||||
leave readLoop
|
||||
end
|
||||
end readLoop
|
||||
ibr.close()
|
||||
catch ex = IOException
|
||||
ex.printStackTrace()
|
||||
end
|
||||
|
||||
method isTrue() public constant returns boolean
|
||||
return 1 == 1
|
||||
method isFalse() public constant returns boolean
|
||||
return \isTrue()
|
||||
Loading…
Add table
Add a link
Reference in a new issue