Quantcast
Channel: How can I parse an XML file from the command line (for GeekTool)? - Super User
Viewing all articles
Browse latest Browse all 2

Answer by u1686_grawity for How can I parse an XML file from the command line (for GeekTool)?

$
0
0

Perl's XML::Twig comes with...

xml_grep --nowrap --text_only /statuses/status/text

In XML::XPath you can do:

perl -MXML::XPath -E 'my $xp = XML::XPath->new(ioref => \*STDIN); say $xp->getNodeText("/statuses/status/text");'

or

perl -MXML::XPath -E 'my $xp = XML::XPath->new(ioref => \*STDIN); for my $node ($xp->find("/statuses/status/text")->get_nodelist) { say $node->string_value; }'

(Of course, there's Net::Twitter too.)


Viewing all articles
Browse latest Browse all 2

Trending Articles