This 'Bogus URL..' comes from egghttp.tcl / proc egghttp:geturl :
Code: Select all
if {![regexp -nocase {^(http://)?([^:/]+)(:([0-9]+))?(/.*)?$} $url x protocol server y port path]} {
This Regex only works for http URLs ,
if you Replace it to :
Code: Select all
if {![regexp -nocase {^(http(s|)://)?([^:/]+)(:([0-9]+))?(/.*)?$} $url x protocol server y port path]} {
it can pass that 'Bogus ...' thing but
I see this egghttp using Eggdrop-Tcl's : connect <host> <port> command instead Tcl's http package or socket command
and I am not realy sure about does that method able to handle https connections.
I don't know why he'd prefer to use this instead but https links returns
net: connect! sock 11
net: eof!(read) socket 11
and if you try
http://pandorabots it return :
DNS lookup failed
Tcl: while executing
Tcl: "connect $server $port"
and doesn't give more useful information i can use for debuging what it is the problem.
so I am still testing things with my little test snippets and i see that it is still available to work as
https://pandora... and i've tried with using cookies or without it and i can get response.
I am gonna try to edit/re-write the whole fetching procedures with using http and tls packages instead egghttp.tcl but i have to make some more tests to figure out how works things.
it can takes some more time sorry for delay.
and Settore , I just tried once again and i didn't get any error , so i don't know what can i say but it is still working fine from here.
this is what my bot has.
Code: Select all
#Bot's Nickname to Respond to: ex. MyBot - Usage: MyBot, what's 1+1?
set pandoraNick "k-bot"
#Your Pandora Bot ID. (Feel free to use the existing one if you want, but the bot will think its name is AlphaBot
set botid "a5cd504e4e342614"
#STOP EDITING HERE
package require http
if {[catch {package require tls 1.6}]} {
putcmdlog "https links requires tcltls : https://core.tcl.tk/tcltls/wiki/Download"
set enabletls 0
} else {
set enabletls 1
tls::init -ssl3 0 -ssl2 0 -tls1 1
http::register https 443 [list ::tls::socket -require 0 -request 1]
}
bind pubm - "% ${pandoraNick}*" talkto
proc talkto {n u h c t} {
set query [::http::formatQuery botid $::botid custid $n input [join [lrange [split $t] 1 end]]]
if {[catch {set token [::http::geturl https://pandorabots.com/pandora/talk-xml -query $query -timeout 16000]} error]} {
putlog "[string map [list \n " ,"] $error] ,[::http::status $token]"
::http::cleanup $token
}
if {[string match -nocase "timeout" [::http::status $token]]} {
putlog "[::http::code $token]"
::http::cleanup $token
}
if {![string equal -nocase [::http::status $token] "ok"]} {
putlog "[::http::code $token] ,[::http::status $token]"
::http::cleanup $token
}
if {[::http::ncode $token] == "200" && [string equal -nocase [::http::status $token] "ok"]} {
set pandata [::http::data $token]
::http::cleanup $token
}
if {![regexp {<that>(.*?)</that>} $pandata -> responce]} {
putlog "This regex sucks!!! Source codes changed or what?!?"
return
} else {
puthelp "privmsg $c :[string map {" \"} $responce]"
}
return 0
}