Hackernews::Parser - a Perl interface to Hackernews (http://news.ycombinator.com/) 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' );
perl - version 5.10 or above
LWP::Simple - Debian package: libwww-perl
The only subroutine of WWW::Hackernews::Parser is hn_parse. It takes the following arguments:
top
new
1
all
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:
age_qty - the numercal value of the age
age_unit - either hour(s) or minute(s)
hour(s)
minute(s)
age_sec - age in seconds calculated by the above
comments - number of comments
desc - description
domain - the domain on which the link is hosted
id - the unique numerical identification number of the link
score - the "karma" level of the link, or number of points
user - the name of the user who posted the link
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.
To install WWW::Hackernews::Parser, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Hackernews::Parser
CPAN shell
perl -MCPAN -e shell install WWW::Hackernews::Parser
For more information on module installation, please visit the detailed CPAN module installation guide.