Mise en forme de code: pensez à utiliser les balises [ tcl ] et [ /tcl ] (sans les espaces bien sûr) autour de vos codes tcl afin d'avoir un meilleur rendu et une coloration syntaxique. x


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"} 
  }

Away
#2
Petite note: le forum remplace les urls par des liens, donc quand vous voyez:

Code:
<a href="http://www.vcdquality.com/index.php?page=search&genre=1" target="_blank">http://www.vcdquality.com/index.php?page=search&genre=1</a>
il y a en fait dans la source:

Code:
http://www.vcdquality.com/index.php?page=search&genre=1
Sinon, pour répondre au non fonctionnement: essaye de rajouter un:

tcl
putlog $line

après la ligne
tcl
foreach line [split $data \n] {

pour voir si au moins tu récupères du contenu.
Si oui, le problème est peut-être dans le string match
irc.zeolia.net - Offrez-moi un café
Merci de ne pas demander d'aide en MP
Away
#3
jai ca en party line de l'eggdrop

[10:47] <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
[10:47] <HTML><HEAD>
[10:47] <TITLE>302 Found</TITLE>
[10:47] </HEAD><BODY>
[10:47] <H1>Found</H1>
[10:47] The document has moved <A HREF="http://www.vcdq.com/index.php?page=search&amp;genre=1">here</A>.<P>
[10:47] </BODY></HTML>


et toujours pareil sur le chan

No Results!

le script est comme ceci maintenant :


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 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] {
putlog $line
    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

Away
#4
Quote:[10:47] The document has moved <A HREF="http://www.vcdq.com/index.php?page=search&amp;genre=1">here</A>.<P>
Ton url n'est plus bonne, il faut utiliser celle-là
irc.zeolia.net - Offrez-moi un café
Merci de ne pas demander d'aide en MP
Away
#5
crazycat merci il y a deja du mieu il ne me dis pas qu il n'y pas de resultat il m'affiche une erreur en partyline :

Tcl error [vcdqw]: invalid command name "genre=1"

je pense que jai du faire une erreur en changeant l' url quoique elle est tout indiquer en partyline et je me suis pas mal pris la tete dessus javais meme pas vu l'url et le 1 je ne voi spas trop a quoi il renvois
Away
#6
Oui, en fait:

tcl
set conn [http::geturl $url -headers "Referer http://www.vcdq.com/index.php -query genre=1&searchstring=$search]

devrait aller mieux

remplace

Code:
<a href="http://www.vcdq.com/index.php" target="_blank">http://www.vcdq.com/index.php</a>
par

Code:
http://www.vcdq.com/index.php
(il faut vraiment que je modifie mon plugin)
irc.zeolia.net - Offrez-moi un café
Merci de ne pas demander d'aide en MP
Away
#7
erf jai tjr un soucis moi en partyline :

Tcl error [vcdqw]: extra characters after close-quote


tcl
set pubvcdt "!dupe"
 
 
 
#############################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 http://www.vcdq.com/index.php?page=search&amp;genre=1
 http::config -useragent "Mozilla/5.0"
set conn [http::geturl $url -headers "Referer <a href="http://www.vcdq.com/index.php" target="_blank">http://www.vcdq.com/index.php</a> -query genre=1&searchstring=$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


voila a quoi ressemble le tcl tel que je l'est modifier si bien jai fait une erreur et que tout seule je ne m'en apercois pas
Away
#8
re bonjour alors jai rechercher et remodifier encore ce script

Tcl error [vcdqw]: extra characters after close-quote
par rapport a cette erreur jai modifier ca :

tcl
set conn [http::geturl $url -headers Referer <a href="http://www.vcdq.com/index.php" target="_blank">http://www.vcdq.com/index.php</a> -query genre=1&searchstring=$search]


il y avait un " en trop devant referer

et apres en remplacant comme tu mavais dit ne change rien crazycat jai toujours droit a
Tcl error [vcdqw]: invalid command name "genre=1" en partyline
Away


Possibly Related Threads…
Thread Author Replies Views Last Post
  Petit soucis avec un script d'annonce de la saint du jour, etc... loulou7593 3 5,956 19/11/2011, 14:53
Last Post: CrazyCat
  petit soucis avec logger lesny 54 33,451 12/08/2011, 18:52
Last Post: lesny
  eggdrop le bot ne fait rien mamouth 35 19,381 23/05/2011, 08:51
Last Post: CrazyCat
  petit soucis Meribre 2 3,416 24/03/2010, 12:01
Last Post: CrazyCat

Forum Jump:


Users browsing this thread: 1 Guest(s)