Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

More tasty XML goodness

by vroom (Pope)
on Sep 16, 2000 at 00:13 UTC ( #32737=monkdiscuss: print w/replies, xml ) Need Help??

Now you can grab User nodes info xml generator to find out all the reputation, node_id, title, and createtime information for all of your nodes.

vroom | Tim Vroom | vroom@cs.hope.edu

Replies are listed 'Best First'.
RE: More tasty XML goodness
by mirod (Canon) on Sep 16, 2000 at 00:41 UTC

    And of course you can also use XML::Twig to get the same result:

    #!/bin/perl -w use strict; use XML::Twig; my $posts= 0; my $rep=0; my $twig= new XML::Twig( TwigRoots => { NODE => sub { my( $t, $node)= @_; $posts++; $rep +=$_[1]->att( 'reputation'); $t->purge; } }); $twig->parsefile( $ARGV[0]); print "$posts posts, $rep rep, ", sprintf( "%5.2f", $rep/$posts), " a +verage\n";
RE: More tasty XML goodness
by mirod (Canon) on Sep 16, 2000 at 00:24 UTC

    If you have XML::PYX installed you can then run this:

    pyx pm.xml | perl -n -e 'if( /^Areputation (\d+)/) { $rep+=$1;$posts++ +;} \ END { print "$posts posts, $rep rep, ", sprintf( "%5.2f", $rep/$posts) +, " average\n";}'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: monkdiscuss [id://32737]
Approved by root
help
Chatterbox?
[james28909]: i figured it out
[james28909]: upon trying various solutions, i was forgetting to package up the script into an executable
[marto]: that'll do it
[james28909]: im glad im not in charge of anything important, like filling up peanut butter jars
marto grins

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2017-07-28 14:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (431 votes). Check out past polls.