This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

world time tcl returning weird inacurate times

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

world time tcl returning weird inacurate times

Post by simo »

i was trying out this tcl not sure who the author is but it doesnt return accurate times not sure if anyone has a working version of this ?


Code: Select all


bind pub - !tz worldntime

proc worldntime {nick uhost hand chan text} {
  if {![throttled2021x $chan:$chan 10]} {  

   if {![llength $text]} { puthelp "privmsg $chan :Usage: $::lastbind <location>"; return 0 }
   set token [http::geturl http://localtimes.mobi/search/?s=[join $text +]&x=0&y=0 -timeout 9000]
   set data [http::data $token]
   ::http::cleanup $token
   if {[regexp -- {Home</a>(.+?)</span>.+?<div class="timeinfo">(.+?)</div>.+?<div class="tz_container">(.+?)</li>} $data - loc t1 t2]} {
      puthelp "privmsg $chan :\00304[cleanup $loc]\003: [cleanup $t1]"
      puthelp "privmsg $chan :[cleanup $t2]"
   } else { puthelp "privmsg $chan :No Information Found For \"$text\". Please, You Can Be More Specific!"; return }
}
   return 0
}
proc cleanup str {
   regsub -all -- {(?:<label>|</label>)} $str \002 str
   regsub -all -- "<.+?>" $str " " str
   regsub -all -- {»} $str \003\u00bb\00304 str
   regsub -all -- { } $str { } str
   regsub -all -- {\s+} $str { } str
   return $str
}


 

proc throttled2021x {id time} {
   global throttled
   if {[info exists throttled($id)]} {
      return 1
   } {
      set throttled($id) [utimer $time [list unset throttled($id)]]
      return 0
   }
}
User avatar
CrazyCat
Revered One
Posts: 1216
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Well, the website (in fact cloudflare) returns me error 1051 "You are being rate limited", that's the first time I go on it.
I think that http://localtimes.mobi can be forget...
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

i had the same CrazyCat , it seems there is no reliable source that can be used for tcl to get proper timezones
Post Reply