HTTP::...dentify(3pm)
π HTTP::...dentify(3pm) β bestie edition π
okay so real talk, this is the User Contributed Perl Documentation page for HTTP::...dentify, and yes the title looks like someone's cat walked across the keyboard, we don't talk about it. it's giving "the file name got truncated mid-vibe-check" and honestly? iconic. anyway sit down, grab a strawberry π, we're learning today.
β¨ NAME β¨
HTTP::OAI::Identify β the lil module that hands you access to an OAI Identify response. no cap, that's the whole job. π
πΈ SYNOPSIS πΈ
here's the vibe, literally verbatim, do not touch:
use HTTP::OAI::Identify;
my $i = new HTTP::OAI::Identify(
adminEmail=>'billg@microsoft.com',
baseURL=>'http://www.myarchives.org/oai',
repositoryName=>'www.myarchives.org'
);
for( $i->adminEmail ) {
print $_, "\n";
}
see how we made one, then looped over the admin emails and printed each one with a newline? that's it. that's the whole flex. π¦
π METHODS π
π
$i = new HTTP::OAI::Identify(-baseURL=>'http://arXiv.org/oai1'[, adminEmail=>$email, protocolVersion=>'2.0', repositoryName=>'myarchive'])
this is the constructor method, aka the glow-up moment where a brand new instance of the OAI::Identify module gets born. π£ pass it what it needs and it returns you a fresh $i.
π $i->version
returns the original version of the OAI response, and it figures that out from the given XML namespace. so it's not guessing, it's reading the receipts. π
π§ $i->headers
returns an HTTP::Headers object. wanna peek at a field value? use $headers->header('headername') and boom, there it is. π
π«Ά $burl = $i->baseURL([$burl])
π«Ά $eds = $i->earliestDatestamp([$eds])
π«Ά $gran = $i->granularity([$gran])
π«Ά $version = $i->protocolVersion($version)
π«Ά $name = $i->repositoryName($name)
these bad boys return the relevant header, and if you feel like it, they optionally set it too. multi-tasking queens fr fr. π
β οΈ NOTE bestie, important one:protocolVersionwill always be'2.0'. like, always. don't fight it. if you actually wanna know what protocol version the repository is using, go use$i->versioninstead. iykyk. π
π @addys = $i->adminEmail([$email])
π @cmps = $i->compression([$cmp])
these ones return the multi-value headers, and yeah they can optionally add to them too. so they collect, they don't overwrite. generous behaviour honestly. π
π @dl = $i->description([$d])
returns the description list, and optionally appends a new description $d to it. what do you actually get back? an array ref of HTTP::OAI::Descriptions, or an empty ref if there are no description. (that's the original grammar, i'm just the messenger π«‘)
β $d = $i->next
returns the next description, or undef if there's no more description left. so you loop it till it runs out of things to say. relatable. π
π₯ $dom = $i->toDOM
returns an XML::DOM object that represents the Identify response. whole thing, in object form. slay.
and that's the page!! every flag, every method, every signature, untouched, just wrapped in glitter. β¨
kisses, this was perl v5.36.0, dated 2023-09-28, from the User Contributed Perl Documentation section. love u, bye π«Άππ
π¦ where this page comes from
- debian trixie: libhttp-oai-perl 4.13-1 Β· BSD-3-Clause
- ubuntu noble: libhttp-oai-perl 4.13-1 Β· BSD-3-Clause
- ubuntu resolute: libhttp-oai-perl 4.13-1 Β· BSD-3-Clause
- ubuntu stonking: libhttp-oai-perl 4.13-1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms