egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

world time tcl returning weird inacurate times

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
simo
Owner


Joined: 22 Mar 2015
Posts: 859

PostPosted: Fri Apr 23, 2021 3:46 pm    Post subject: world time tcl returning weird inacurate times Reply with quote

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:


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 -- {&raquo;} $str \003\u00bb\00304 str
   regsub -all -- {&nbsp;} $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
   }
}
Back to top
View user's profile Send private message
CrazyCat
Owner


Joined: 13 Jan 2002
Posts: 972
Location: France

PostPosted: Fri Apr 23, 2021 5:58 pm    Post subject: Reply with quote

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...
_________________
https://www.eggdrop.fr
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 859

PostPosted: Fri Apr 23, 2021 9:41 pm    Post subject: Reply with quote

i had the same CrazyCat , it seems there is no reliable source that can be used for tcl to get proper timezones
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber