makmukiper icon

TCL Gempa BMKG

makmukiper | PRO | 06/08/24 09:04:46 AM UTC | 0 ⭐ | 8443 👁️ | Never ⏰ | []
TCL |

860 B

|

None

|

0 👍

/

0 👎

bind cron - "* * * * *" cekgempa
set lastgempa "reset tiap rehash/restart"
proc cekgempa {1 2 3 4 5} {
 set chgempa "#Mojok"
 http::register https 443 [list ::tls::socket -autoservername 1]
 http::config -proxyhost "" -useragent ""
 if {[catch {set bmkgpage [http::geturl "https://data.bmkg.go.id/DataMKG/TEWS/autogempa.xml" -timeout 30000]} error]} { return $error }
 set bmkgdata [http::data $bmkgpage]
 http::cleanup $bmkgpage
 regexp -nocase {Tanggal>(.*?)<.*?Jam>(.*?)<.*?Lintang>(.*?)<.*?Bujur>(.*?)<.*?Magnitude>(.*?)<.*?Kedalaman>(.*?)<.*?Wilayah>(.*?)<.*?Shakemap>(.*?)<} $bmkgdata t tgl jam lt bj mag kdlm wlyh map
 set gempa "$tgl $jam # $lt/$bj # M$mag # Kedalaman $kdlm # $wlyh # https://static.bmkg.go.id/$map"
 if {$gempa != $::lastgempa} {
  foreach c $chgempa { putnow "privmsg $c :Gempa Terkini : $gempa" }
  set ::lastgempa $gempa
 }
 return
}
 

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎