Страница 1 из 1

regexp output

СообщениеДобавлено: 05 июн 2014 21:19
EvilHeart
i make full code .. and regexp is ok.. but when i send command !testback no output show

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 {{&nbsp;} {} {\n} {}} $a]]
        set b [string trim [string map {{&nbsp;} {} {\n} {}} $b]]
        set c [string trim [string map {{&nbsp;} {} {\n} {}} $c]]
        set d [string trim [string map {{&nbsp;} {} {\n} {}} $d]]
        set e [string trim [string map {{&nbsp;} {} {\n} {}} $e]]
        set f [string trim [string map {{&nbsp;} {} {\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 )

Re: regexp output

СообщениеДобавлено: 08 июл 2014 23:24
EvilHeart
кто поможет исправить мой сценарий

Re: regexp output

СообщениеДобавлено: 09 июл 2014 19:00
tvrsh
You want to parse full page? What do need to post to channel?

Re: regexp output

СообщениеДобавлено: 02 авг 2014 21:07
EvilHeart
i need like !testback teamname
show temname and statistics like also

Re: regexp output

СообщениеДобавлено: 03 сен 2014 21:56
EvilHeart
no help?