Anonymous user
Web scraping: Difference between revisions
Add an alternative Tcl solution
Thundergnat (talk | contribs) m (Move Peloton example to correct position) |
(Add an alternative Tcl solution) |
||
Line 1,635:
=={{header|Tcl}}==
===<tt>http</tt> and regular expressions===
<lang tcl>package require http
Line 1,641 ⟶ 1,642:
puts $utc
}</lang>
===curl(1) and list operations===
Considering the web resource returns tabular data wrapped in a <tt><PRE></tt> tag, you can use Tcl's list processing commands to process its contents.
<lang tcl>set data [exec curl -s http://tycho.usno.navy.mil/cgi-bin/timer.pl]
puts [lrange [lsearch -glob -inline [split $data <BR>] *UTC*] 0 3]</lang>
=={{header|TUSCRIPT}}==
<lang tuscript>
|