This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Tcl help, just not quite eggdrop...

Old posts that have not been replied to for several years.
Locked
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Tcl help, just not quite eggdrop...

Post by ppslim »

Goood evening one and all. Yes it's me, I have returned, and what is more, it is me that needs your help this time folks.

I am now back in the Unemployment corner, but I am keeping myself active, mainly in the user support comunity, but just not dedicating my time to eggdrop any more.

Instead, I am now one of two lead developers on a popular UK site aimed at a UK ISPs customers base, but cateters for pretty much any UK ISP.

My problem is that I am trying to parse external content, using Perl, PHP or Tcl and now for the past 2 weeks, myself and the other developer have been having no luck.

The content in question is THIS page.

I need to get a Tcl list (hell, PHP or perl spitting back CSV data will do) of the content of the member name, join/retire, CPU time, points and units returned. This must be the contents of those columns as is.

Any help for an old hand would be excelent
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Code: Select all

package require http
set count 0
set t [::http::geturl $yourURL]
foreach line [split [::http::data $t] \n] {
  if {$count == 5} {set count 0; continue}
  if {[string match *compare.htm* $line] || $count} {
    regsub -all -- <\[^>\]*> $line "" stuff
    lappend yourlist [string trim $stuff]
    incr count
  }
}
::http::cleanup $t
welcome back
Locked