View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Daniel Bolton > WWW-Hackernews-Parser > Hackernews::Parser


Annotate this POD

View/Report Bugs


Hackernews::Parser - a Perl interface to Hackernews ( stories and data


    use WWW::Hackernews::Parser;
    my $top_hash_ref = hn_parse( 'top', '1' );
    # equivalent to:
    my $other_top_hash_ref = hn_parse();

    my $second_newest = hn_parse( 'new', '2' );



The only subroutine of WWW::Hackernews::Parser is hn_parse. It takes the following arguments:

1. target - This is what page to download the data from; is either top or new. Defaults to top.
2. number - This is the rank of the story. 1 is the top story, and so on. Defaults to 1.
3. datum - This is the name of the datum and hash key to be return (list follows. The default is all, which returns the hash ref as a scalar.

The subroutine stores data in an anonymous hash that may contain any of the following keys, depending on what the pattern was able to match:


perldoc, LWP::Simple


Copyright 2011 Daniel Bolton.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 3.0 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts.

syntax highlighting: