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


Url output help pls
#1
website :
http://cricketarchive.com/Archive/Scorec..._mini.html

Page Source

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Pragma" content="no-cache"></meta>
<meta content="60; url=?refresh$refresh" http-equiv="refresh" />
<LINK TYPE="text/css" REL="stylesheet" HREF="/includes/cricketarchive/bbb.css">
<script type="text/javascript">
document.title = "Sri Lanka v India in 2010";
</script>
</head>
<body  bgcolor=#ccffff>
<table style="width: 100%; text-align: left;" border="0" cellpadding="2" cellspacing="2">
<tr><td valign="top" width="30">115</td><td valign="top" width="30">b1</td><td valign="top" width="40">0</td><td valign="top"><span class="Ind-f">Ojha</span> to <span class="SL-f">Sangakkara</span><br>Flighted delivery just outside the off stump, tries to drive it gets inside edge to pads.</td></tr>

<tr><td valign="top" width="30">115</td><td valign="top" width="30">b2</td><td valign="top" width="40">0</td><td valign="top">Flighted delivery on the off, pushes down the ground for no run.</td></tr>
<tr><td valign="top" width="30">115</td><td valign="top" width="30">b3</td><td valign="top" width="40">0</td><td valign="top">Flighted delivery just outside the off stump, pushes towards cover for no run.</td></tr>
<tr><td valign="top" width="30">115</td><td valign="top" width="30">b4</td><td valign="top" width="40">0</td><td valign="top">Flighted delivery just outside the off stump, tries to push it gets inside edge to pads.</td></tr>
<tr><td valign="top" width="30">115</td><td valign="top" width="30">b5</td><td valign="top" width="40">0</td><td valign="top">Flighted delivery on the off, defends it down the ground for no run.</td></tr>

<tr><td valign="top" width="30">115</td><td valign="top" width="30">b6</td><td valign="top" width="40">0</td><td valign="top">Flighted delivery on the off, turns it to short mid-wicket for no run.</td></tr>
<tr><td width="100" colspan="3" valign="top">End of over 116:</td><td>(0 runs scored) Sri Lanka 449-2 (Sangakkara 209*, 320 balls, DPMD Jayawardene 68*, 118 balls)</td></tr>
<tr><td width="30"><hr></td><td width="30"><hr></td><td width="40"><hr></td><td><hr></td></tr>
<tr><td width="30"></td><td width="30"></td><td width="40"></td><td>This commentary is brought to you by <nobr>CricketArchive</nobr> - <nobr> http://cricketarchive.com</nobr></td></tr>
<tr><td width="30">Over</td><td width="30">Ball</td><td width="40">Runs</td><td><hr></td></tr>

<tr><td valign="top" width="30">116</td><td valign="top" width="30">b1</td><td valign="top" width="40">0</td><td valign="top"><span class="Ind-f">Sehwag</span> to <span class="SL-f">DPMD Jayawardene</span><br>Flighted delivery on the off, turns it towards mid-wicket for no run.</td></tr>
<tr><td valign="top" width="30">116</td><td valign="top" width="30">b2</td><td valign="top" width="40">0</td><td valign="top">Flighted delivery on the off, defends it towards mid-wicket for no run.</td></tr>
<tr><td valign="top" width="30">116</td><td valign="top" width="30">b3</td><td valign="top" width="40">0</td><td valign="top">Flighted delivery on the legs, turns it to leg gully for no run.</td></tr>

<tr><td valign="top" width="30">116</td><td valign="top" width="30">b4</td><td valign="top" width="40">1</td><td valign="top">Flighted delivery on the legs, turns it towards mid-wicket for a single.</td></tr>
<tr><td width="30"></td><td width="30"></td><td width="40"></td><td>CricketArchive Oracles say that the Sri Lanka 450 took 116.4 overs</td></tr>
<tr><td valign="top" width="30">116</td><td valign="top" width="30">b5</td><td valign="top" width="40">4</td><td valign="top"><span class="Ind-f">Sehwag</span> to <span class="SL-f">Sangakkara</span><br>Flatter delivery just outside the off stump, Sangakkara steers it wide of backward point for a FOUR!</td></tr>
<tr><td valign="top" width="30">116</td><td valign="top" width="30">b6</td><td valign="top" width="40">0</td><td valign="top">Flighted delivery on the off, pushes towards mid-on for no run.</td></tr>

<tr><td width="100" colspan="3" valign="top">End of over 117:</td><td>(5 runs scored) Sri Lanka 454-2 (Sangakkara 213*, 322 balls, DPMD Jayawardene 69*, 122 balls)</td></tr>
<tr><td width="30">Over</td><td width="30">Ball</td><td width="40">Runs</td><td><hr></td></tr>
<tr><td valign="top" width="30">117</td><td valign="top" width="30">b1</td><td valign="top" width="40">0</td><td valign="top"><span class="Ind-f">Ojha</span> to <span class="SL-f">DPMD Jayawardene</span><br>Flighted delivery just outside the off stump, tries to push it gets beaten.</td></tr>
<tr><td valign="top" width="30">117</td><td valign="top" width="30">b2</td><td valign="top" width="40">0</td><td valign="top">Flighted delivery just outside the off stump, drives it to cover for no run.</td></tr>

<tr><td valign="top" width="30">117</td><td valign="top" width="30">b3</td><td valign="top" width="40">0</td><td valign="top">Flighted delivery on the off, defends it down the ground for no run.</td></tr>
<tr><td valign="top" width="30">117</td><td valign="top" width="30">b4</td><td valign="top" width="40">0</td><td valign="top">Flighted delivery on the off, pushes back to bowler for no run.</td></tr>
<tr><td valign="top" width="30">117</td><td valign="top" width="30">b5</td><td valign="top" width="40">0</td><td valign="top">Flighted delivery on the off, pushes towards mid-off for no run.</td></tr>

<tr><td valign="top" width="30">117</td><td valign="top" width="30">b6</td><td valign="top" width="40">1</td><td valign="top">Flighted delivery just outside the off stump, drives it to deep point for a single.</td></tr>
<tr><td width="100" colspan="3" valign="top">End of over 118:</td><td>(1 run scored) Sri Lanka 455-2 (Sangakkara 213*, 322 balls, DPMD Jayawardene 70*, 128 balls)</td></tr>
<tr><td width="30">Over</td><td width="30">Ball</td><td width="40">Runs</td><td><hr></td></tr>
<tr><td valign="top" width="30">118</td><td valign="top" width="30">b1</td><td valign="top" width="40">0</td><td valign="top"><span class="Ind-f">Sehwag</span> to <span class="SL-f">DPMD Jayawardene</span><br>Flatter delivery on the off, defends it towards mid-wicket for no run.</td></tr>

<tr><td valign="top" width="30">118</td><td valign="top" width="30">b2</td><td valign="top" width="40">0</td><td valign="top">Flighted delivery on the off, defends it towards mid-on for no run.</td></tr>
<tr><td valign="top" width="30">118</td><td valign="top" width="30">b3</td><td valign="top" width="40">0</td><td valign="top">Flighted delivery just outside the off stump, steers it to backward point for no run.</td></tr>
<tr><td valign="top" width="30">118</td><td valign="top" width="30">b4</td><td valign="top" width="40">1</td><td valign="top">Flighted delivery just outside the off stump, drives it to long off for a single.</td></tr>
<tr><td valign="top" width="30">118</td><td valign="top" width="30">b5</td><td valign="top" width="40">1</td><td valign="top"><span class="Ind-f">Sehwag</span> to <span class="SL-f">Sangakkara</span><br>Low full toss on the off, drives it to long on for a single.</td></tr>

<tr><td valign="top" width="30">118</td><td valign="top" width="30">b6</td><td valign="top" width="40">0</td><td valign="top"><span class="Ind-f">Sehwag</span> to <span class="SL-f">DPMD Jayawardene</span><br>Flighted delivery on the legs, turns it to mid-wicket for no run.</td></tr>
<tr><td width="100" colspan="3" valign="top">End of over 119:</td><td>(2 runs scored) Sri Lanka 457-2 (Sangakkara 214*, 323 balls, DPMD Jayawardene 71*, 133 balls)</td></tr>
<tr><td width="30">Over</td><td width="30">Ball</td><td width="40">Runs</td><td><hr></td></tr>
<tr><td width="30"></td><td width="30"></td><td width="40"></td><td>06:30 GMT: End of the session's play</td></tr>

<tr><td width="30"></td><td width="30"></td><td width="40"></td><td>06:31 GMT: It's time for lunch, join us in 40 minutes for the post lunch session. Sri Lanka's session all the way.</td></tr>
</table>
<a id="latest" name="latest">
<!-- Begin Analytic Include --><script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-3344464-1");
pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);
pageTracker._trackPageview();
var pageTracker1 = _gat._getTracker("UA-8190544-1");
pageTracker1._setDomainName("none");
pageTracker1._setAllowLinker(true);
pageTracker1._trackPageview();
} catch(err) {}</script><!-- End Analytic Include -->
</body>
</html>
i need output link this >


Code:
60 b1  Shahzad to Tamim Iqbal From round the wicket, fuller length delivery on the off, drives it to mid-off for no run.
60 b2  Short of good length delivery on the off, pushes towards backward point for no run.
60 b3  Good length delivery on the legs, tries to flick it misses, hit him on pads and deflects to second slip for no run.
60 b4  Fuller length delivery just outside the off stump, leans forward to drive it misses.
60 b5  Good length delivery just outside the off stump, Tamim leans forward and punches it wide of cover for a FOUR!
60 b6  Good length delivery on the off, pushes towards mid-on and takes a quick single.
End of over 1  (5 runs scored) Bangladesh 5-0 (Tamim Iqbal 5*, 6 balls, Imrul Kayes 0*, 0 balls)
TT Bresnan comes on to bowl
61 b1  Bresnan to Tamim Iqbal From over the wicket, fuller length delivery just outside the off stump, drives it to cover for no run.
61 b2  Good length delivery on the off, defends it down the ground for no run.
61 b3  Good length delivery on the off, punches it down the ground for no run.
61 b4  Fuller length delivery just outside the off stump, Tamim leans forward and drives it through point for a FOUR!
61 b5  Good length delivery just outside the off stump, punches it towards mid-off for a single.
61 b6  Bresnan to Imrul Kayes Good length delivery just outside the off stump, Kayes drives it through point for a FOUR!
End of over 2  (9 runs scored) Bangladesh 14-0 (Tamim Iqbal 10*, 11 balls, Imrul Kayes 4*, 1 balls)
62 b1  Shahzad to Tamim Iqbal Fuller length delivery on the off, drives it gets inside edge towards mid-wicket for no run.
plss help mee
Thanks
#2
Tout d'abord, il s'agit d'un forum francophone, la réponse sera donc en français.
Il faut voir du côté des regexp, la plus simple étant:

tcl
proc unhtml { text } {
   regsub -all -- text <[^>]+> $text
   return $text
}


Ensuite, ça peut s'améliorer pour récupérer toutes les informations et les remettre en forme.
irc.zeolia.net - Offrez-moi un café
Merci de ne pas demander d'aide en MP
Away
#3
English pls
#4
sorry im new tcl

not work


Code:
package require http 2.4
bind pub -!- !bsscore bsscore
proc bscore {nick uhost hand chan text} {
   set t [::http://cricketarchive.com/Archive/Scorecards/292/292365/292365_mini.html/]
   set data [::http::data $t]
#   ::ccs::SaveFile test.html $data
   ::http::cleanup $t
  
   proc unhtml { text } {
      regsub -all -- text <[^>]+> $text
      return $text
  }
      
   foreach {black a1 a2 a3 a4 a5} $l {
        putserv "PRIVMSG $chan :$a1 $a2 $a3 $a4 $a5"
   }
  
}
#5
This is a french-speaking forum, we won't use english here.
Try http://forum.egghelp.org , thanks.
irc.zeolia.net - Offrez-moi un café
Merci de ne pas demander d'aide en MP
Away


Forum Jump:


Users browsing this thread: 1 Guest(s)