Synopsis
use Web::HackerNews;
my $hn = Web::HackerNews->new ();
my @stories = $hn->parse_file ('hn.html');
for my $story (@story) {
if ($story->{title} =~ /Elon Musk|Google memo|James Damore|react.js/i) {
get ($story->{hide});
}
}
Description
Given a Hacker News page, scrape the HTML to extract the contents. For example, get the title and the "hide" URL, etc., so that one can automatically match the titles against a regular expression then "hide" stories about Elon Musk, James Damore, react.js, Google memos, or other tedious things and people.
This is an HTML scraper and not related to WebService::HackerNews by Neil Bower. Note that Hacker News uses tables and "center" tags for layout, with no particular logical subdivision.
Comments
Please sign up to post a review.