HTTP::...dentify(3pm)

πŸ“¦
version 4.13 Β· 5 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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: protocolVersion will 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->version instead. 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