- Katılım
- 4 Şub 2020
- Mesajlar
- 395
- Tepkime puanı
- 143
- Puanları
- 43
- Konum
- ircland
- Web sitesi
- www.ircalem.net
Tcl-TLS 1.7 Sürümlerden Birine, En Azından Tcl 8.5 Veya Üstü Sürüme, tcllib/JSON Paketine İhtiyacınız Olacak!
Kod sahibi: Heartbroken
Kullanımı;
[font=Monaco, Consolas, Courier, monospace][size=small][font=Monaco, Consolas, Courier, monospace]set covidKnl "#Kanal" bilgileri verecek kanal adını yazın.[/font][/font][/size]
[font=Monaco, Consolas, Courier, monospace][size=small][font=Monaco, Consolas, Courier, monospace].cov komutuyla botu kullanabilirsiniz.[/font][/font][/size]
[font=Monaco, Consolas, Courier, monospace][size=small][font=Monaco, Consolas, Courier, monospace]
[/font][/font][/size]
Kod:
set url {https://testsite2.saglik.gov.tr/covid19/covid19api?getir=liste}
set vaccine {https://covid19asi.saglik.gov.tr/}
setudef flag korona
package require http
package require tls 1.7
package require json
package present Tcl 8.5
::http::register https 443 [list tls::socket -autoservername 1]
bind pub - .cov covid_pubs
proc covid_pubs {nick uhost hand chan text} {
if {![channel get $chan korona]} { return 0 }
set ashi [Got_C19 $::vaccine]
set data [json::json2dict [Got_C19 $::url]]
set cov [lindex $data 0]
regexp -- {asiyapilankisisayisi = (.+?);} $ashi "" SayAshi
dict with cov {
puthelp "privmsg $chan :\00312$tarih\003 \00314T?rkiye'deki G?ncel Durum\003 \00303T?RK?YE G?NL?K KORONAV?R?S TABLOSU\003 :"
puthelp "privmsg $chan :\00302\002BUG?N\002\003 \002TEST SAYISI\002 : \00304$gunluk_test\003 \002VAKA SAYISI\002 : \00304$gunluk_vaka\003 \002HASTA SAYISI\002 :\
\00304$gunluk_hasta\003 \002VEFAT SAYISI\002 : \00304$gunluk_vefat\003 \002?Y?LE?EN SAYISI\002 : \00304$gunluk_iyilesen\003"
puthelp "privmsg $chan :\00302\002BU HAFTA\002\003 \002HASTALARDA ZAT?RRE ORANI\002 : \00304%$hastalarda_zaturre_oran\003 \002YATAK DOLULUK ORANI\002 : \00304%$yatak_doluluk_orani\003\
\002ER??K?N YO?UN BAKIM DOLULUK ORANI\002 : \00304%$eriskin_yogun_bakim_doluluk_orani\003 \002VENT?LAT?R DOLULUK ORANI\002 :\
\00304%$ventilator_doluluk_orani\003 \002ORTALAMA TEMASLI TESP?T S?RES?\002 : \00304$ortalama_temasli_tespit_suresi Saat\003 \002F?LYASYON ORANI\002 : \00304%$filyasyon_orani\003"
puthelp "privmsg $chan :\00302\002TOPLAM\002\003 \002TEST SAYISI\002 : \00304$toplam_test\003 \002VAKA SAYISI\002 : \00304$toplam_hasta\003\
\002VEFAT SAYISI\002 : \00304$toplam_vefat\003 \002A?IR HASTA SAYISI\002 : \00304$agir_hasta_sayisi\003 \002?Y?LE?EN HASTA SAYISI\002 : \00304$toplam_iyilesen\003\
\002A?ILANAN K??? SAYISI\002 : \00304[regsub -all -- {\d(?=(\d{3})+($|\.))} $SayAshi {\0.}]\003"
}
return 0
}
proc Got_C19 Linkin {
set token [http::geturl $Linkin]
set data [http::data $token]
::http::cleanup $token
return $data
}
Kod sahibi: Heartbroken
Kullanımı;
[font=Monaco, Consolas, Courier, monospace][size=small][font=Monaco, Consolas, Courier, monospace]set covidKnl "#Kanal" bilgileri verecek kanal adını yazın.[/font][/font][/size]
[font=Monaco, Consolas, Courier, monospace][size=small][font=Monaco, Consolas, Courier, monospace].cov komutuyla botu kullanabilirsiniz.[/font][/font][/size]
[font=Monaco, Consolas, Courier, monospace][size=small][font=Monaco, Consolas, Courier, monospace]