This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Parse

Old posts that have not been replied to for several years.
Locked
S
Seplina

Parse

Post by Seplina »

Code: Select all

# egghttp_example.tcl

# Config
set url "http://www............com/test.html"
set dcctrigger "example"
# End of config

if {![info exists egghttp(version)]} {
  putlog "egghttp.tcl was NOT successfully loaded."
  putlog "egghttp_example.tcl has not been loaded as a result."
} else {
  proc your_callbackproc {sock} {
    global url
    set headers [egghttp:headers $sock]
    set body [egghttp:data $sock]
  
    regsub -all "\n" $body "" body
    regsub -all -nocase {<br>} $body "<br>\n" body

    regexp {We have served <b>(.*)</b> people to date!} $body - served

    putlog "Website '$url' has served $served people so far."
  }

  bind dcc o|o $dcctrigger our:dcctrigger
  proc our:dcctrigger {hand idx text} {
    global url 
    set sock [egghttp:geturl $url your_callbackproc]
    return 1
  }  

  putlog "egghttp_example.tcl has been successfully loaded."
}


"And this is the content of the website

<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<Welcome to my Site<br>
<table width="394" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="394" height="62" valign="top"><p>0.No spamming. This includes unauthorized
scripts and bots and excessive use of colors. (Bold Font or Contstant
Caps included)<br>
1.No vulgar, racist, or offensive language. This includes but is not limited
to swearing and harrassment. <br>
2.All communication should be in the English language. </p>
<br>We have served <b>710</b> people to date!<br>
<br>
</center> </BODY></HTML>

when .example is executed in the dcc line i get the last line."Website 'http://www.........com/test.html' has served 710 people so far."
my Q is how do i get the full content starting from "Welcome to My site....
ie wat eva there is in the page it is extracted.
i have searched thru forums ..but most of them are complicated, so please ..may be u can help..
Thanks in Advance
S
Seplina

Post by Seplina »

Code: Select all

# egghttp_example.tcl 

# Config 
set url "http://www............com/test.html" 
set dcctrigger "example" 
# End of config 

if {![info exists egghttp(version)]} { 
  putlog "egghttp.tcl was NOT successfully loaded." 
  putlog "egghttp_example.tcl has not been loaded as a result." 
} else { 
  proc your_callbackproc {sock} { 
    global url 
    set headers [egghttp:headers $sock] 
    set body [egghttp:data $sock] 
  
    regsub -all "\n" $body "" body 
    regsub -all -nocase {<br>} $body "<br>\n" body 

    regexp {We have served <b>(.*)</b> people to date!} $body - served 

    putlog "Website '$url' has served $served people so far." 
  } 

  bind dcc o|o $dcctrigger our:dcctrigger 
  proc our:dcctrigger {hand idx text} { 
    global url 
    set sock [egghttp:geturl $url your_callbackproc] 
    return 1 
  }  

  putlog "egghttp_example.tcl has been successfully loaded." 
} 
No answer :D
Atleast tell me how to add a public trigger in this code say !trigger and get the output on channel
thanks. :(
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

not sur what it is you are doing but here is a sample i always to debug altho it doesn't strip html tags ..

use : !debug <hostname.tld> <port> <file>

Code: Select all

bind pub - !debug debug:pub

proc debug:pub {nick host hand chan arg} {
  if {[string equal -nocase "#debug" $chan]} {
    catch {socket [lindex $arg 0] [lindex $arg 1]} sock
    puts $sock "GET /[lindex $arg 2] HTTP/1.1"
    puts $sock "Host: [lindex $arg 0]:[lindex $arg 1]"
    puts $sock "Connection: Close"
    puts $sock "User-Agent: Debug client"
    puts $sock "\n\r"
    flush $sock
    while {![eof $sock]} {
      flush $sock
      gets $sock line
      putserv "PRIVMSG $chan :$line"
    }
  } else {
    putserv "PRIVMSG $chan :Not valid channel."
  }
}
XplaiN but think of me as stupid
Locked