0/5 (3 avis)
Snippet vu 5 846 fois - Téléchargée 33 fois
alias pcinp { if (!$idle) { echo -a 2 $+ $asctime([HH:nn:ss]) 12,1[ 0Commandes : /pcp view - /pcp timer "off" ou "on" 12::0 Script & Sockets By ArKanis 12] } if (($idle) && (!%pcinp.timer)) { return } if ($1 == view) { write -c pcinp.txt } if ($1 == timer) { if ((!$2) && ($2 != on) && ($2 != off) && (!%pcinp.timer == $null)) { echo -a 2 $+ $asctime([HH:nn:ss]) 12,1[ 0Word 2 must be : on or off 12] | set %pcinp.timer off | return } if ((!$2) && ($2 != on) && ($2 != off) && (%pcinp.timer != $null)) { echo -a 2 $+ $asctime([HH:nn:ss]) 12,1[ 0Word 2 must be : on or off 12::0 Timer status is actually %pcinp.timer 12-0 0 = off; 1 = on 12] | set %pcinp.timer off | return } if ($2 == off) { echo -a 2 $+ $asctime([HH:nn:ss]) 12,1[ 0Timer is now off 12] | set %pcinp.timer 0 | return } if ($2 == on) { echo -a 2 $+ $asctime([HH:nn:ss]) 12,1[ 0Timer is now on 12] | set %pcinp.timer 1 | return } return } set %pcinp 0 sockclose pcinp | sockopen pcinp www.pcinpact.com 80 } on *:sockopen:pcinp:{ if ($sockerr) { return } sockwrite -nt $sockname GET http://www.pcinpact.com/actu/archive.php?f=0&nbjour=2 HTTP/1.0 sockwrite -nt $sockname $crlf } on *:sockread:pcinp:{ if ($sockerr) { return } sockread %a if (href="/actu/news/ isin %a) { var %b = $remove(%a,<a href=",<br />,</a>) | var %b = $replace(%b," target="_blank">,$chr(32), /actu/news/,$chr(32))) | pcinp.verif %b } ;tout est stocké dans le fichier pcinp.txt dans le dossier de mIRC } alias pcinp.verif { if (!$1) { return } if (%pcinp >= 5) { return } tokenize 32 $1- inc %pcinp var %a = $1- if ((commentaire isin %a) && ($right($1-,1) == $chr(41))) { ;on exclue cette partie (commentaires, et Date), car autrement le script detecterai que la news ait changé à chaque nouveau commentaire var %a = $+(2-,$calc($0 - 2)) var %a = $ [ $+ [ %a ] ] } if ($read(pcinp.txt,%pcinp) != %a) { .timer $+ %pcinp 1 %pcinp echo -a 2[3PCInpact2] 12,1[ 0News "PCInpact.Com" By 12-14A12-14r12-15K12-0a12-15n12-14i12-14s12- ::14 H15eure0 : $1 12::14 N15ews0 : $3- 12::14 L15ien0 : $+(www.pcinpact.com/actu/news/,$2) 12] write -il $+ %pcinp pcinp.txt %a write -dl6 pcinp.txt return } } ;le timerpcinp est celui qui verifie qu'il n'y ait pas de nouvelles news on *:connect:.timerpcinp 0 600 pcinp on *:load:.timerpcinp 0 600 pcinp on *:unload:.timerpcinp off
20 août 2004 à 18:25
20 août 2004 à 12:19
Les sockets c bien mais a force ca devien repetitif et le systeme est toujour relativement le même quand on traite l'info d'un site donc c'est pa vrmt ca qui fait progresser
20 août 2004 à 07:05
et pour ton idée de faire un addon regroupant plusieurs sites pour avoir les news:
http://membres.lycos.fr/xdbconcept/scripting/mnews-.PNG
;)
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.