Mercurial > hg > egg-tcls
diff hae_saatiedot.tcl @ 69:df3230f8aa46
Translate some comments to english and cosmetic fixes.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 11 Sep 2011 17:43:32 +0300 |
parents | 7b03971c6d28 |
children | 593874678e45 |
line wrap: on
line diff
--- a/hae_saatiedot.tcl Sun Sep 11 16:48:48 2011 +0300 +++ b/hae_saatiedot.tcl Sun Sep 11 17:43:32 2011 +0300 @@ -1,19 +1,29 @@ #!/usr/bin/tclsh +# +# NOTICE! Change above path to correct tclsh binary path! +# +########################################################################## +# +# Improved weather data fetcher for Jedah's "saa.tcl" +# by ccr/TNSP <ccr@tnsp.org> +# (C) Copyright 2009-2011 Tecnic Software productions (TNSP) +# +# This script is freely distributable under GNU GPL (version 2) license. +# +########################################################################## -# Polku ja tiedosto mihin tiedot talletetaan +# Path and filename of the data file, MUST BE SAME as in "saa.tcl" set datafile "/home/niinuska/bot/saa.data" -# HTTP proxy -# 1 = kyllä -# 0 = ei +# Use a HTTP proxy? (1 = yes, 0 = no) set use_proxy 0 -# HTTP proxy osoite ja portti (jos ed. optio 1) +# HTTP proxy host address and port (only needed if use_proxy = 1) set http_proxy_host "cache.inet.fi" set http_proxy_port 800 -############################################################################## +########################################################################## package require http ::http::config -urlencoding iso8859-1 -useragent "Mozilla/4.0 (compatible; MSIE 6.0; MSIE 5.5; Windows NT 5.0) Opera 9.5" if {$use_proxy != 0} { @@ -21,7 +31,7 @@ } -############################################################################## +########################################################################## proc fetch_uri {uurl} { global ngot if {[catch {set utoken [::http::geturl $uurl -binary true -timeout 5000]} uerrmsg]} { @@ -35,7 +45,7 @@ } } -############################################################################## +########################################################################## set tmpfname "$datafile.tmp" if {[catch {set savefile [open $tmpfname w 0600]} uerrmsg]} { puts "Error opening $tmpfname: $uerrmsg"