#!/usr/bin/perl -w =head1 parse the "Other Users XML Ticker" with C and C For real. Probably won't work if the "DTD" changes (not bloody likely). =cut use strict; use LWP::Simple; # other users xml ticker my $html = get('http://perlmonks.org/index.pl?node_id=15851'); die unless $html; warn $html; my $fh = [split "\n", $html]; while(@{$fh}) { parse_other_users(shift @{$fh}); } exit; sub parse_other_users { my $s = shift; # my $nX = index($s,'', $iX + 11); my ($name, $id); if( $iX >=0 and $nX >=0 ) { printf '(%s)(%s)(%s)(%s)(%s)(%s)'."\n", $iX, $nX, $IX, $iX - $nX - 14, $name = substr($s, $nX + 14 + 1, $iX -$nX - 14 - 1), $id = substr($s, $iX + 12, $IX - $iX - 12),; } return; } __END__ Rendered by the Other Users XML Ticker (130)(110)(145)(6)(22308)(dws) (20)(0)(38)(6)(83485)(blakem) (20)(0)(38)(6)(65703)(rob_au) (21)(0)(41)(7)(108447)(demerphq) (20)(0)(39)(6)(61798)(busunsl) (20)(0)(40)(6)(78196)(lestrrat) (21)(0)(40)(7)(103344)(Ryszard) (21)(0)(43)(7)(134513)(metadoktor) (21)(0)(45)(7)(141348)(Dog and Pony) (20)(0)(35)(6)(53018)(juo) (20)(0)(38)(6)(12012)(Malach) (21)(0)(42)(7)(107642)(podmaster) (21)(0)(45)(7)(103824)(perl::scribe) (21)(0)(38)(7)(143222)(gdnew) (21)(0)(40)(7)(134230)(tmiklas) (21)(0)(39)(7)(105312)(thepen)