View previous topic :: View next topic |
Author |
Message |
simo Owner
Joined: 22 Mar 2015 Posts: 859
|
Posted: Fri Apr 23, 2021 3:46 pm Post subject: world time tcl returning weird inacurate times |
|
|
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 -- {»} $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
}
}
|
|
|
Back to top |
|
 |
CrazyCat Owner

Joined: 13 Jan 2002 Posts: 972 Location: France
|
Posted: Fri Apr 23, 2021 5:58 pm Post subject: |
|
|
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 |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 859
|
Posted: Fri Apr 23, 2021 9:41 pm Post subject: |
|
|
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 |
|
 |
|