<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/19837" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2015-01-21T23:52:41-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/19837</id>

		<entry>
		<author><name><![CDATA[LOQUILLO]]></name></author>
		<updated>2015-01-21T23:52:41-04:00</updated>

		<published>2015-01-21T23:52:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103441#p103441</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103441#p103441"/>
		<title type="html"><![CDATA[helpme please with worldtime.tcl thanks :D]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103441#p103441"><![CDATA[
If you have free time can to modify this scripts:<br><a href="http://forum.egghelp.org/viewtopic.php?t=9255&amp;highlight=worldtime" class="postlink">http://forum.egghelp.org/viewtopic.php? ... =worldtime</a><br><a href="http://forum.egghelp.org/viewtopic.php?t=13586&amp;postdays=0&amp;postorder=asc&amp;highlight=worldtime&amp;start=0" class="postlink">http://forum.egghelp.org/viewtopic.php? ... me&amp;start=0</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5227">LOQUILLO</a> — Wed Jan 21, 2015 11:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Arnold_X-P]]></name></author>
		<updated>2014-12-18T17:25:47-04:00</updated>

		<published>2014-12-18T17:25:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103376#p103376</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103376#p103376"/>
		<title type="html"><![CDATA[helpme please with worldtime.tcl thanks :D]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103376#p103376"><![CDATA[
this tcl is very good she gives the world hour I stop working 6 months ago behind<br>apparently the proprietors of google changed something into the central connection and for that reason<br>the tcl already does not read and goes out a mistake.<br><br>before six months behind the tcl works to the perfection it could see the hour of several countries<br>please that someone helps me one would be grateful for it very much it is an excellent tcl<br><br><strong class="text-strong">the error that goes out for me in partyline is</strong><br>[17:31] &lt;(Kantuta&gt; [21:31:43] Tcl error [pub:tz]: can't use empty string as operand of "+"<br><br><br><div class="codebox"><p>Code: </p><pre><code># worldtime.tcl -- 2.3.3 *BETA*##   Returns the current time for anywhere in the world.## Copyright (c) 2010 HM2K## Name: WorldTime Lookup# Author: HM2K &lt;irc@hm2k.org&gt;# License: http://www.opensource.org/licenses/bsd-license.php BSD License# Link: http://www.hm2k.com/posts/worldtime-tcl# Tags: time, world, lookup# Updated: 30-Nov-2010####Usage# &gt; .tz london# &lt;Bot&gt; HM2K, The time in Westminster, London, UK is Fri Feb 13 23:31:30 2009#       (GMT+1000)####Revisions# 2.3.3 - improved header and formatting# 2.3.2 - expanded GMT offset; added curly braces for expr# 2.3.1 - fixed memory leaks; fixed unmatched results# 2.3   - uses Google to retrieve geo and timezone information;#         instead of the system zoneinfo database, which was unreliable.#         more portable, works on any platform, including Windows.# 2.2.3 - added timezone offset to output string# 2.2.2 - added time offset, for a bizarre situation# 2.2.1 - a few bug fixes, now finds correct zoneinfo dir# 2.2   - replaced old TIME method with HTP method# 2.1   - now uses the TIME protocol to get accurate unixtime# 2.0   - new and improved, using system zoneinfo# 1.3   - based on a script by Murf, using worldtimeserver.com### Settingsset tz(ver) "2.3.3 *BETA*"; # current version of this fileset tz(cmd) ".tz"; # public command triggerset tz(dcccmd) "tz"; # dcc command triggerset tz(output) "The time in \002%s\002 is %s (%s)"; # format for the outputset tz(dateformat) "%a %b %d %I:%M:%S %p %Y"; # format for the clock (wiki.tcl.tk/1810)set tz(usage) "Usage: $tz(cmd) &lt;location&gt;"; # usage resultset tz(noresult) "Unable to find a match."; # no result resultset tz(gettime) 1; # when on, will get time from time server, instead of systemset tz(timeserver) "www.google.com"; # should be any good remote web serverset tz(offset) 0; # seconds, eg: 3600 for plus 1 hour or -3600 for minusset tz(utc) "GMT"; # name given to UTCset tz(geourl) "http://maps.google.com/maps/api/geocode/xml"; # url for Google GeoCode lookupset tz(tzurl) "http://www.google.com/ig/timezone"; # url for Google's TimeZone lookup### Package Definitionpackage require eggdrop 1.6;  #see http://geteggdrop.com/package require Tcl 8.2.3;    #see http://tinyurl.com/6kvu2nif {[catch {package require http 2.0} err]} {  putlog "[info script] error: $err";  putlog "http 2.0 package or above is required, see http://wiki.tcl.tk/1475";}if {[catch {package require htmlparse} err]} {  putlog "[info script] error: $err";  putlog "Tcllib is required, see http://wiki.tcl.tk/12099";}### Bindsbind pub - $tz(cmd) pub:tz;bind dcc -|- $tz(dcccmd) dcc:tz;### Proceduresproc pub:tz { nick uhost handle channel arg } {global tz;if {[llength $arg]==0} { putserv "NOTICE $nick :$tz(usage)"; return; }set result [tz:get $arg];if {[llength $result]==0} { set result $tz(noresult); }putserv "PRIVMSG $channel :$nick, $result";}proc dcc:tz {ha idx arg} {  global tz;if {[llength $arg]==0} { putdcc $idx $tz(usage); return; }set result [tz:get $arg];if {[llength $result]==0} { set result $tz(noresult); }  putdcc $idx $result; }proc tz:get { arg } {  global tz;  #set the time  set time "";  if {$tz(gettime)} { set time [tz:gethtp $tz(timeserver)]; }  if {$time eq ""} { set time [clock seconds]; }  #offset place holder  set offset 0;  #set geo location info  set geoinfo [tz:getgeo $arg];  #no results  if {$geoinfo eq {}} { return; }  #set timezone name  set arg [lrange $geoinfo 2 end];  #set timezone info  set tzinfo [tz:gettz [lrange $geoinfo 0 1]];  #no results  if {$tzinfo eq {}} { return; }  #get gmt offset in seconds (including dst)  set offset [expr {[lindex $tzinfo 0]+[lindex $tzinfo 1]}];  #add timezone data to current gmt time (+offset)  set time [expr {$time+$offset/1000+$tz(offset)}];  #format the unixtime seconds to human readable time  set time [clock format $time -format $tz(dateformat)];  #make offset human readable  set offset [expr {$offset/3600}];  if {$offset == 0} { set offset "$tz(utc)";  } elseif {$offset &gt; 0} { set offset "$tz(utc)+$offset";  } else { set offset "$tz(utc)$offset"; }  #format and return  return [format $tz(output) $arg $time $offset];}proc tz:gethtp {args} { #?server? ?port?  set server [expr ([llength $args]&gt;0)?"[lindex $args 0]":"www.google.com"];  set port [expr ([llength $args]&gt;1)?"[lindex $args 1]":80];  set s [socket $server $port];  puts $s "HEAD / HTTP/1.0\n";  flush $s;  while {[gets $s l] &gt;= 0} {    if {[regexp {Date: (.+?) GMT$} $l -&gt; date]} {      close $s;      return [clock scan $date];    }  }}proc tz:getdata { arg } {  if {[string length $arg]&lt;1} { return; }  set http [::http::geturl $arg];  set data [::http::data $http];  #set data [::htmlparse::mapEscapes $data];  set data [string trim $data];  set data [join $data " "];  ::http::cleanup $http;  return $data;}proc tz:xmlparse { data arg } {  if {[string length $arg]&lt;1} { return; }  set arg [string tolower $arg];  set matched "";  set result "";  regexp "&lt;$arg&gt;(.+?)&lt;/$arg&gt;" $data matched result;  return $result;}proc tz:jsonparse { data arg } {  if {[string length $arg]&lt;1} { return; }  set matched "";  set result "";  regexp "'$arg':(\[^,\}\]+)" $data matched result;  return $result;}proc tz:getgeo { arg } {  global tz;  set arg [::http::formatQuery address $arg sensor "false"];  set data [tz:getdata $tz(geourl)?$arg];  if {[regexp "&lt;html&gt;.+" $data]} { return; }  if {$data eq {}} { return; }  #parse info  set info(lat) [tz:xmlparse $data "lat"];  set info(lng) [tz:xmlparse $data "lng"];  set info(addr) [tz:xmlparse $data "formatted_address"];  return "$info(lat) $info(lng) $info(addr)";}proc tz:gettz { arg } {  global tz;  if {[string length $arg]&lt;1} { return; }  set arg [::http::formatQuery lat [lindex $arg 0] lng [lindex $arg 1]];  set data [tz:getdata $tz(tzurl)?$arg];  if {[regexp "&lt;html&gt;.+" $data]} { return; }  if {$data eq {}} { return; }  set info(offset) [tz:jsonparse $data "rawOffset"];  set info(dst) [tz:jsonparse $data "dstOffset"];  return "$info(offset) $info(dst)";}### Loadedputlog "worldtime.tcl $tz(ver) loaded";#EOF</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8327">Arnold_X-P</a> — Thu Dec 18, 2014 5:25 pm</p><hr />
]]></content>
	</entry>
	</feed>
