HTML::...gerize(3pm)
π HTML::AutoPagerize π
okay bestie, so this is a page from the Perl manual β <pink>HTML::...gerize(3pm)</pink>, the 3pm bit meaning it's a module page for Perl, and yes the header got truncated because somebody's terminal was being dramatic. sit down, grab a boba, we're doing this.
β¨ NAME β¨
HTML::AutoPagerize β a whole little utility module whose entire job is loading up SITEINFO stuff for AutoPagerize. that's it. that's the vibe. π
πΈ SYNOPSIS πΈ
here's how you actually use it, and listen, copy this exactly because the code is code:
use HTML::AutoPagerize;
my $autopager = HTML::AutoPagerize->new;
$autopager->add_site(
url => 'http://.+.tumblr.com/',
nextLink => '//div[@id="content" or @id="container"]/div[last()]/a[last()]',
pageElement => '//div[@id="content" or @id="container"]/div[@class!="footer" or @class!="navigation"]',
);
my $uri = 'http://otsune.tumblr.com/';
my $html = LWP::Simple::get($uri);
my $res = $autopager->handle($uri, $html);
if ($res) {
my $next_link = $res->{next_link}; # URI object
my $content = $res->{page_element}; # XML::XPathEngine::NodeSet object. may be empty
}
like, add_site takes your url, your nextLink and your pageElement, and handle gives you back a hashref where next_link is a URI object and page_element is an XML::XPathEngine::NodeSet object that may be empty β so check if ($res) before you go reaching into it, mkay? π
π¦ DESCRIPTION π¦
HTML::AutoPagerize is a utility module for loading the SITEINFO that's defined over in AutoPagerize. and AutoPagerize itself? it's a userscript whose whole thing is automatically figuring out the "next link" of whatever page you're on, then fetching that content and inserting it in by extracting the "page element". infinite scroll energy, honestly. main character behaviour. β¨
π AUTHOR π
Tatsuhiko Miyagawa <miyagawa@bulknews.net> β icon, legend, wrote the thing π«Ά
π LICENSE π
this library is free software; you can redistribute it and/or modify it under the exact same terms as Perl itself. so, y'know. same deal as Perl. go wild responsibly.
π SEE ALSO π
WWW::Mechanize::AutoPagerβ the sibling module, go say hi π<http://swdyh.infogami.com/autopagerize>β the OG link, dead or alive, it's listed, so it's here
ngl this page is short but it ate. every option, every object type, every link β all present and accounted for. no cap. π―
and that's a wrap! this gorgeous little page was brought to you by perl v5.32.0, dated 2021-01-07, and it lives in the HTML::...gerize(3pm) section of your friendly neighbourhood manual. mwah. πβ¨πΈ
π¦ where this page comes from
- debian bookworm: libhtml-autopagerize-perl 0.02-1.1
- ubuntu jammy: libhtml-autopagerize-perl 0.02-1.1
- ubuntu noble: libhtml-autopagerize-perl 0.02-1.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms