Accueil > > > SOCKETS DU SITE PCINPACT.COM - AVEC VÉRIFICATIONS DES DERNIÈRES NEWS AJOUTÉES
SOCKETS DU SITE PCINPACT.COM - AVEC VÉRIFICATIONS DES DERNIÈRES NEWS AJOUTÉES
Information sur la source
Description
Pour les habitués de mes codes, c'est encore des sockets ... :)
Après LeMonde.fr, Clubic.com, Mcm.net, Vossey.fr, DoDnetwork.com, Athens2004.com, voilà www.pcinpact.com
le système est toujours le même, il faut taper /pcinp pour rafraichir les news (cela est fait automatiquement toutes les dix minutes pour vérifier si une nouvelle news est disponible).
Commandes :
- /pcinp view (pour voir toute la liste des 5 dernières news en entier)
- /pcinp help (pour voir toutes les commandes)
- /pcinp timer "on" ou "off" => /pcinp timer on fera activer la vérifications des nouvelles news
Format de la news donnée :
[PCInpact] [ News "PCInpact.Com" By -A-r-K-a-n-i-s- :: Heure : 14:38:52 :: News : Baladeur audio/vidéo 20Go Gmini400 d'Archos en France (39 commentaires) :: Lien : www.pcinpact.com/actu/news/Baladeur_audio_video_20 _Go_Gmini_400_dArchos.htm?vc=1 ]
Contrairement aux autre sockets que j'ai fait, il est ici impossible de faire un "say". Pour le faire, il faut remplacer le "echo -a" par "say" ou "msg #chan" sur ce début de ligne : .timer $+ %pcinp 1 %pcinp echo -a
Source
- 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
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
Conclusion
Toutes mes sockets sont sur mon script :
http://tafroxafond.free.fr/ftp//Script%20irc%20 By%20Arkanis/Script-ArKanis.zip
J'aimerai aussi savoir si c'est saoulant d'avoir un gars qui vous colle 10 000 sockets, 1 par page ... :)
Si c'est le cas, j'en ferai plusieurs sur la même page, ca doit bien faire un bon nombre de pages déjà a mon actif ... :)
Sources du même auteur
Sources de la même categorie
Commentaires et avis
|
Derniers Blogs
UNE JOLIE-HORLOGE ET PAS QU'UN PEU !UNE JOLIE-HORLOGE ET PAS QU'UN PEU ! par neodante
Pour les possesseurs d'iPhone, ça y est Bijin Tokei - qui se traduit littéralement en Français par " Jolie Horloge " - est arrivé et GRATUITEMENT s'il vous plaît ! Après la version Tokyo, Hokkaido, night club, racing, Gal, "pour les mademoiselles'", . voi...
Cliquez pour lire la suite de l'article par neodante TECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICESTECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICES par ROMELARD Fabrice
Animé par: Gaetan Bouveret et Julien Chomarat Business Connectivity Services (BCS) est dans SharePoint 2010 la version 2 de Business Data Catalog (BDC dans SharePoint 2007). Il s'agit de la solution permettant de visualiser des données provenan...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice [DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE[DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE par orion
Comme de nombreux geek, je suis un grand amateur de série TV et je rate régulièrement des épisodes de mes séries préférés. Une solution s'offre à vous avec ce merveilleux site : Tv Gorge - www.tvgorge.com Moteur de recherche à l'appui, vous pouvez ...
Cliquez pour lire la suite de l'article par orion TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010 par ROMELARD Fabrice
Animé par: Vincent Bellet et Baptiste Giraudier La BI dans SharePoint 2010, Les nouveaux services d'application dans SP2010 et SQL Server Reporting services 2008 R2. La BI dans SharePoint est généralisée pour tous afin de permettre à tous les coll...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Forum
RE : ON RAWMODERE : ON RAWMODE par WorldDMT
Cliquez pour lire la suite par WorldDMT AVERTISSMENT ET KIKKAVERTISSMENT ET KIKK par mouhcine951990
Cliquez pour lire la suite par mouhcine951990
Logiciels
DB-MAIN (9.1.0)DB-MAIN (9.1.0)DB-MAIN is a data-modeling and data-architecture tool. It is designed to help developers and anal... Cliquez pour télécharger DB-MAIN Xilisoft DPG Convertisseur (5.1.37.0120)XILISOFT DPG CONVERTISSEUR (5.1.37.0120)Xilisoft DPG Convertisseur offre aux fans de Nintendo DS une bonne solution leur permettant de dé... Cliquez pour télécharger Xilisoft DPG Convertisseur GraphicsGale (2.01.01)GRAPHICSGALE (2.01.01)GraphicsGale est un logiciel de PixelArt avec de nombreuse fonctionnalités permettant de réalisé ... Cliquez pour télécharger GraphicsGale Architecte 3D (Platinum 2010)ARCHITECTE 3D (PLATINUM 2010)Architecte 3D Platinium vous permet de concevoir facilement les plans votre future maison, de l'é... Cliquez pour télécharger Architecte 3D TeamViewer 5 (TeamViewer 5)TEAMVIEWER 5 (TEAMVIEWER 5)Dépanner un ami,expliquer une manipulation devient un jeu d'enfant.
Prise en main d'un autre ord... Cliquez pour télécharger TeamViewer 5
|