Code: Select all
if {[catch {package require http} error]} { putlog "Failed loading error= $error" }
bind pub - getinfo info
proc info {nick uhost hand chan arg} {
if {![isop $nick $chan]} { putmsg $chan "No acces to use this script"; return }
if {$arg == ""} { putmsg $chan "Wrong syntax. \"GETINFO nick\""; return }
set url "http://www.somesite.com/somepage.php?login=$arg"
set tok [http::geturl $url]
set data [http::data $tok]
http::cleanup $tok
regexp -- {cPanel Login:(.+?)} $data -> login
regexp -- {Domain Name:(.+?)} $data -> domain
regexp -- {Hosting type:(.+?)} $data -> type
regexp -- {Account type:(.+?)} $data -> account
regexp -- {Suspended:(.+?)} $data -> suspended
regexp -- {Server ID:(.+?)} $data -> id
if {![info exists ::login]} { putmsg $chan "No info available"; return }
putmsg $nick "$login,$domain,$type,$account,$suspended,$id"
}
Code: Select all
bind pub - getinfo info
...snipped irrelevant parts...
proc getinfo {nick uhost hand chan arg} {
Code: Select all
bind pub - getinfo getinfo
Oopsie, i noticed it to late i guess :pspeechles wrote:see the problem? change the part below and it will properly bind getinfo to the proc getinfoCode: Select all
bind pub - getinfo info ...snipped irrelevant parts... proc getinfo {nick uhost hand chan arg} {
Code: Select all
bind pub - getinfo getinfo
Code: Select all
if {[catch {package require http} error]} { putlog "HTTP package required '$error'" }
bind pub - getinfo getinfo
# GET Info
# Grabs your server data, etc, etc
#
proc getinfo {nick uhost hand chan text} {
if {[isop $nick $chan]} {
if {$text == ""} {
putserv "privmsg $nick :Wrong syntax. "GETINFO <nick>""
} else {
set tok [http::geturl "http://www.somesite.com/somepage.php?login=[urlencode $text]"]
set html [http::data $tok]
http::cleanup $tok
regexp -nocase -- {cPanel Login:(.+?) Domain Name:(.+?) Hosting type:(.+?) Account type:(.+?) Suspended:(.+?) Server ID:(.+?)} $data -> login domain type account suspended id
if {![info exists $login]} {
putserv "privmsg $nick :No info available for $text."
) else {
putserv "privmsg $nick :[join [list $login $domain $type $account $suspended $id] ", "]"
}
}
}
}
# URL Encode
# Encodes anything not a-zA-Z0-9 into %00 strings...Pimp-Style
#
proc urlencode {text} {
set url ""
foreach byte [split [encoding convertto utf-8 $text] ""] {
scan $byte %c i
if {$i < 65 || $i > 122} {
append url [format %%%02X $i]
} else {
append url $byte
}
}
return [string map {%3A : %2D - %2E . %30 0 %31 1 %32 2 %33 3 %34 4 %35 5 %36 6 %37 7 %38 8 %39 9 \[ %5B \\ %5C \] %5D \^ %5E \_ %5F \` %60} $url]
}
##defeat-word-wrap####################################################################################################################################################################