Posted to tcl by Dan39 at Tue Nov 23 22:09:42 GMT 2010view raw

  1. heres the HTML, i am trying to grab uplaoded, downloaded, and ratio amounts from, for specific user. this is from a forum page, so there are several of this repeated, which is why i need to use variable to specify which is the one i want to grab amounts from
  2.  
  3. <p id='para_654428' class=sub><table border=0 cellspacing=0 cellpadding=0><tr><td class=embedded width=99%>#654428 by <a href=userdetails.php?id=455050><b>Dan39</b></a> (Ride The Lightning) at 2010-11-13 07:16:33 (1 week ago) - [<a href=?action=quotepost&topicid=59551&postid=654428><b>Quote</b></a>] - [<a href=report.php?type=Post&id=654428&id_2=59551><b>Report this post</b></a>] - [<a href=?action=editpost&postid=654428><b>Edit</b></a>]</td><td class=embedded width=1%><a href=#top><img src=/pic/top.gif border=0 alt='Top'></a></td></tr></table>
  4. <table class=main width=100% border=1 cellspacing=0 cellpadding=5>
  5.  
  6. <tr valign=top><td width=150 align=center style='padding: 0px'><img class="lazy" lazy="yes" width=150 src="http://img63.imageshack.us/img63/4743/ridelightsmall.jpg"><p align=left>&nbsp;Joined: Fri, Sep 18 2009<br>&nbsp;Uploaded: 2.092 TB<br>&nbsp;Downloaded: 401.863 GB<br>&nbsp;Ratio: <font color=#0099FF>5.331</font><br>&nbsp;IPT Rep: +37<br> <img src="/pic/rep.gif"> <img src="/pic/rep.gif"> <img src="/pic/rep.gif"></p>
  7.  
  8.  
  9.  
  10. heres the code im trying to use
  11.  
  12. $iptuser would be set to Dan39
  13. $iptpostoutput is the http data of forum page
  14.  
  15. set pattern "<b>$iptuser</b></a>(?:<img src=/pic/star\.gif alt='Donor'>)?\(\[a-zA-Z0-9 /\]*\) at \d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d \(\d+ \w+ \w+\) - (?:\\\[<a href=\?action=quotepost&topicid=\d+&postid=\d+><b>Quote</b></a>] - )?\\\[<a href=report.php\?type=Post&id=\d+&id_2=\d+><b>Report this post</b></a>](?: - \\\[<a href=\?action=editpost&postid=\d+><b>Edit</b></a>])?</td><td class=embedded width=1%><a href=#top><img src=/pic/top\.gif border=0 alt='Top'></a></td></tr></table>\n*<table class=main width=100% border=1 cellspacing=0 cellpadding=5>\n*<tr valign=top><td width=150 align=center style='padding: 0px'><img class=\"lazy\" lazy=\"yes\" width=150 src=\"\[a-zA-Z0-9/ .\]+\"><p align=left>&nbsp;Joined: \[0-9 ,\]+<br>&nbsp;Uploaded: (\d+\.\d\d\d \w\w)<br>&nbsp;Downloaded: (\d+\.\d\d\d \w\w)<br>&nbsp;Ratio: <font color=#\w+>(\d+\.\d+)</font><br>"
  16. regexp -- $pattern $iptpostoutput iptmatch iptup iptdown iptratio
  17.  
  18.  
  19. nothing is being set to iptmatch, iptup, iptdown, or iptratio.. so my regexp must not be working