can someone help me here is my full code
- Код: Выделить всё
package require http
bind pub -!- !testback testback
proc testback {nick uhost hand chan text} {
set t [::http::geturl http://www.espnfc.com/scores]
set data [::http::data $t]
set text [lindex [split $text] 0]
::http::cleanup $t
set l [regexp -all -inline -- {<div class="team-name">(.*?)</div>.*?<div class="team-name">(.*?)</div>.*?<div class="team-score">(.*?)</div>.*?<div class="team-score">(.*?)</div>.*?<div class="game-info">(.*?)</div>.*?name="&lpos=scoreboard:(\d+)"} $data]
foreach {black a b c d e f} $l {
if {$c == ""} {
set c "N/A"
}
if {$d == ""} {
set d "N/A"
}
set a [string trim [string map {{ } {} {\n} {}} $a]]
set b [string trim [string map {{ } {} {\n} {}} $b]]
set c [string trim [string map {{ } {} {\n} {}} $c]]
set d [string trim [string map {{ } {} {\n} {}} $d]]
set e [string trim [string map {{ } {} {\n} {}} $e]]
set f [string trim [string map {{ } {} {\n} {}} $f]]
regsub -all {<.*?>} $a {} a
regsub -all {<.*?>} $b {} b
regsub -all {<.*?>} $c {} c
regsub -all {<.*?>} $d {} d
regsub -all {<.*?>} $e {} e
putlog "~$e~$a~$c~$b~$d~$f~$text~"
putserv "PRIVMSG $chan :$e $a $c $b $d $f"
}
}
here is regexp output
- Код: Выделить всё
11:17:46pm / * <EvilHeart> !webby http://www.espnfc.com/scores --regexp <div class="team-name">(.*?)</div>.*?<div class="team-name">(.*?)</div>.*?<div class="team-score">(.*?)</div>.*?<div class="team-score">(.*?)</div>.*?<div class="game-info">(.*?)</div>.*?name="&lpos=scoreboard:(\d+)"--
11:17:47pm / * <ToWeR> regexp: capture1 ( Platense )
11:17:48pm / * <ToWeR> regexp: capture2 ( Temperley )
11:17:49pm / * <ToWeR> regexp: capture3 ( )
11:17:51pm / * <ToWeR> regexp: capture4 ( )
11:17:53pm / * <ToWeR> regexp: capture5 ( 11:00 PM GMT )
11:17:56pm / * <ToWeR> regexp: capture6 ( 379855 )