petit soucis la recherche n'affiche jamais rien
#1
voila un petit script de recherche de film.tel qu il est la il ne marche pas du tout

tcl
set pubvcdt "!vcdquality"

 
 
#############################DO NOT EDIT UNDER HERE!###########################################
package require http
bind pub -|- $pubvcdt vcdqw
 
 
proc vcdqw {nick uh handle chan text} {
global pubvcdt
set option ""
set search ""
set target "$nick"
set num "3"
set kind "PRIVMSG"
if {$text == ""} {putserv "NOTICE $nick :Looks like u need $pubvcdt -help" ;return}
foreach word $text {if {[string match "*-*" "$word" ]} {append option "$word "} }
foreach word $text {if {![string match "*-*" "$word" ]} {append search "$word "} }
    foreach word $option {
       if {[string match "*-x*" $word]} {set num "[lindex [split $word x] 1]"}
       if {[string match "*-notice*" $word]} {set kind "NOTICE"}
       if {[string match "*-msg*" $word] || [string match "*-pub*" $word]} {set kind "PRIVMSG" }
       if {[string match "*-pub*" $word]} {set target "$chan"}
       if {[string match "*-help*" $word]} {homohelp $nick ;return}
    }
vqs $target $kind $num $option $search
}
 
proc vqs {target kind num option search} {
 regsub -all " " $search "+" search
 set url www.vcdquality.com/index.php?page=search&genre=1
 http::config -useragent "Mozilla/5.0"
 set conn [http::geturl $url -headers "Referer http://www.vcdquality.com/index.php?page=search&genre=1" -query query=$search&submit=search]
 set data [http::data $conn]
 set fdataz ""
 set count 0
 set vcdq "http://www.vcdquality.com"
 set vcdq1 "http://www.vcdquality.com"
  foreach line [split $data \n] {
    if {([string match "*cat-c*" $line]) && (![string match "*index.php?enddate=*" $line]) && (![string match "*align=\"center\">Next</td>*" $line]) } {append fdataz "$line \n"} 
  }
 set nrels "[expr ([llength [split $fdataz \n]] - 1) / 12]"
 
 
 if {![llength [split $fdataz \n]]} {putserv "PRIVMSG $target :No Results!" ;return}
 if {$nrels < $num} {set num "$nrels"}
 putserv "$kind $target :$nrels Results/$num Displayed:"
   foreach {date type tittle sample nfo imdb ncd group vscore ascore mscore comm} [split $fdataz \n] {  
    incr count
     if {$count == [expr $num + 1]} { break }
    regsub -all {<[^>]*|>| } $date "" date
    regsub -all {/} $date "-" date
    regsub -all {<[^>]*|>| } $type "" type
    regsub -all {<[^>]*|>|'} $tittle "" tittle
    regsub -all { } $tittle "." tittle
    regsub -all {\*} $tittle "" tittle
    regexp {a href="(.+?)"} $sample {} sample
    regsub {.} $sample {} sample
    regexp {a href="(.+?)"} $nfo {} nfo
    regexp {a href="(.+?)"} $imdb {} imdb
 
    regsub -all {<[^>]*|>| } $group "" group
    regsub -all {<[^>]*|>| } $vscore "" vscore
    set vscore "[lindex [split $vscore (] 0]"
    regsub -all {<[^>]*|>| } $ascore "" ascore
    set ascore "[lindex [split $ascore (] 0]"
    regsub -all {<[^>]*|>| } $mscore "" mscore
    set mscore "[lindex [split $mscore (] 0]"
    regsub -all {<[^>]*|>|\[view\]| } $comm "" posts
    regexp {a href=".+?".+?a href="(.+?)"} $comm {} comm
    regsub {.} $comm {} comm
    if {[string match "*http://www.vcdquality.com/images/spacer.gif*" $sample]} {set sample "No Sample" ;set vcdq ""}
    if {[string match "*http://www.vcdquality.com/images/spacer.gif*" $imdb]} {set imdb "No IMDB" }       
    if {[string match "*http://www.vcdquality.com/images/spacer.gif*" $comm]} {set comm "No Forum" ;set vcdq1 ""}
    set msgl "$date.$tittle$type-$group $vscore/$ascore/$mscore"
 
    if {[string match "*-sample*" $option] } {append msgl " $vcdq$sample"}
    if {[string match "*-imdb*" $option]} {append msgl " $imdb"}
    if {[string match "*-forum*" $option]} {append msgl " $vcdq1$comm $posts"}
 
 
    putserv "$kind $target :$msgl"
   } 
 
 
}
 
 
proc homohelp {victim} {
global pubvcdt
 
puthelp "NOTICE $victim :Y0 Moron Listen Up:"
puthelp "NOTICE $victim :$pubvcdt string \[options\]"
puthelp "NOTICE $victim :Options: -pub(msg to channel) -notice(notice) -msg(privmsg) -x#(limit resluts to #) -imdb -forum -sample"
puthelp "NOTICE $victim :Defaults: -msg -x3"
}
 
putlog "www.vcdquality.com search script by dreamss loaded =)"
#EOF



en modifiant la premiere proc la recherche se lance mais n'affiche rien, j'ai modifier comme cela

tcl
proc vqs {target kind num option search} {
 regsub -all " " $search "+" search
 set url http://www.vcdquality.com/index.php?page=search&genre=1
 http::config -useragent "Mozilla/5.0"
 set conn [http::geturl $url -headers "Referer http://www.vcdquality.com/index.php?genre=1" -query query=$search&submit=search]
 set data [http::data $conn]
 set fdataz ""
 set count 0
 set vcdq "http://www.vcdq.com"
 set vcdq1 "http://www.vcdq.com"
  foreach line [split $data \n] {
    if {([string match "*cat-c*" $line]) && (![string match "*index.php?enddate=*" $line]) && (![string match "*align=\"center\">Next</td>*" $line]) } {append fdataz "$line \n"} 
  }


www.irc-pacifique.com/ ou depuis un mirc client /server -m irc-pacifique.com server fun cool et tolerants
Répondre Avertir


Messages dans ce sujet
petit soucis la recherche n'affiche jamais rien - par caline012 - 14/11/2008, 06:02

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)
Tchat 100% gratuit -Discutez en toute liberté