egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

egghttp please help :)

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
NTHosts
Op


Joined: 10 Oct 2005
Posts: 100
Location: UK

PostPosted: Fri Jun 09, 2006 11:11 am    Post subject: egghttp please help :) Reply with quote

Ok I have written this...

Code:

set url "$ip:$port/admin.cgi?mode=viewxml"


set djtrigger "!dj"
set ip "lynxfm.com"
set port "9004"
set pass "whatever"
set channel "#botchan"


if {![info exists egghttp(version)]} {
  putlog "egghttp.tcl was NOT successfully loaded."
  putlog "shoutcast.tcl has not been loaded as a result."
} else {
  proc current_dj {sock} {

    global channel

    set headers [egghttp:headers $sock]
    set body [egghttp:data $sock]

    regexp { <SERVERTITLE>(.*)</SERVERTITLE> } $body - dj


    putquick "PRIVMSG $channel :\0032The current DJ is: \0034 $dj"

  }

  bind pub -|* $djtrigger top:djtrigger
  proc top:djtrigger {nick host hand chan text} {
    global url
    set sock [egghttp:geturl $url current_dj]
    return 1
  }
}


But.. I dont know how to log into the page to parse the onfo I need so not even sure if the

set url "whatitsaysupthere"

will work with the
set ip "bleah"
set port "bleahsomemore"

as you can see i have... set pass "whatever"
But how can I get egghttp use that in the http login form with also the username admin.

I have looked through the egghttp docs but dont see anything that tells you about login forms.

Any suggestions please ? Smile
_________________
www.NT-Hosts.Net - More than just a host
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
NTHosts
Op


Joined: 10 Oct 2005
Posts: 100
Location: UK

PostPosted: Fri Jun 09, 2006 4:18 pm    Post subject: ... Reply with quote

Ok I tried scrapping using egghttp and use sockets.. I came up with this...

Code:


bind pub -|- !dj curdj
set server "lynxfm.com"
set port "9004"
set pass "demo"

proc curdj {nick host handle chan text} {
   global server port pass
 if {[catch {set sock [socket $server $port] } sockerror]} {
 putlog "error: $sockerror"
 
return 0 } else {

   puts $sock "GET /admin.cgi?pass=$pass&mode=viewxml&page=0 HTTP/1.0"
   puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
   puts $sock "Host: $server"
   puts $sock "Connection: close"
   puts $sock ""
   flush $sock

while {[eof $sock] != 1} {
   
   regexp { <SERVERTITLE>(.*)</SERVERTITLE> } $body - dj
}
 putquick "PRIVMSG $channel :\0032The current DJ is: \0034 $dj"
close $sock
}}


But it cant open the connection for some reason Sad

Nick .set errorInfo

TCLTestBot [15:17] #Nick# set errorInfo
TCLTestBot Currently: couldn't open socket: host is unreachable
TCLTestBot Currently: while executing
TCLTestBot Currently: "socket $server $port"

My head hurts lol.. any help plz ? Sad
_________________
www.NT-Hosts.Net - More than just a host
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Fri Jun 09, 2006 8:23 pm    Post subject: Reply with quote

verify you can connect to that host from your shell. Maybe its firewalled.
_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Back to top
View user's profile Send private message MSN Messenger
NTHosts
Op


Joined: 10 Oct 2005
Posts: 100
Location: UK

PostPosted: Sat Jun 10, 2006 4:36 pm    Post subject: ... Reply with quote

Nope its all run from my own server, so no firewall Sad
_________________
www.NT-Hosts.Net - More than just a host
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Tue Jun 13, 2006 6:48 am    Post subject: Reply with quote

then maybe your routing table is improper? Just beeing it your server doesnt exclude the reason of failure to be an iptables/ipchain setting... or simply refered as "firewall and routing rules". All you can do is making sure that the IP it tries to connect is valid. Try to set debug code to show you to what it actually tries to connect and verify it can connect to it outside of the bot, because only then it would be an issue with eggdrop ^.^.
Maybe socket binds to the wrong interface(s), try using the -myaddr option.
_________________
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber