HTTP::...ifiers(3pm)

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

πŸ’– HTTP::OAI::ListIdentifiers β€” the whole vibe πŸ’–

okay so bestie, you're holding the manual page for HTTP::OAI::ListIdentifiers, which is part of the User Contributed Perl Documentation (aka the perl peeps made this one, not the core crew, and honestly? iconic of them 🫢). It's your lil gateway to an OAI ListIdentifiers response, and it's giving very much "let me hand you the receipts, one record at a time." ✨


🌸 NAME 🌸

HTTP::OAI::ListIdentifiers β€” provides access to an OAI ListIdentifiers response. that's it, that's the job, no cap πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

my $r = $h->ListIdentifiers;

while(my $rec = $r->next) {
    print "identifier => ", $rec->identifier, "\n",
    print "datestamp => ", $rec->datestamp, "\n" if $rec->datestamp;
    print "status => ", ($rec->status || 'undef'), "\n";
}

die $r->message if $r->is_error;

yes bestie, that loop is the whole mood β€” grab a record, spill its identifier, optionally its datestamp, print the status (or 'undef' if there's nothing there, we don't lie in this house), and then yeet out with die $r->message if $r->is_error says something went wrong. 🌈


πŸŽ€ METHODS πŸŽ€

πŸ’œ $li = new OAI::ListIdentifiers

This constructor method returns a new OAI::ListIdentifiers object. Fresh object, fresh start, main character energy only. ✨


πŸ’œ $rec = $li->next

Returns either an HTTP::OAI::Header object, or undef, if there are no more records. Use $rec->is_error to test whether there was an error getting the next record (otherwise things will break). Like, genuinely break bestie, don't skip the vibe check 😭

If -resume was set to false in the Harvest Agent, next may return a string (the resumptionToken). So heads up: it's not always a Header, sometimes it's just a lil string token sliding through. πŸ“


πŸ’œ @il = $li->identifier([$idobj])

Returns the identifier list and optionally adds an identifier or resumptionToken, $idobj. Returns an array ref of HTTP::OAI::Headers. Look at you, getting a whole array ref of headers, obsessed. πŸ’…


πŸ’œ $dom = $li->toDOM

Returns a XML::DOM object representing the ListIdentifiers response. DOM time, no notes. πŸ”₯


πŸ’œ $token = $li->resumptionToken([$token])

Returns and optionally sets the HTTP::OAI::ResumptionToken. Get it, set it, slay. πŸ‘‘


ngl bestie, the one thing you truly cannot skip: always check $rec->is_error after next, because the docs literally say things will break otherwise and we do not want that for you. πŸ™ˆ

and that's a wrap on the tea β˜• β€” this lil page is from perl v5.36.0, dated 2023-09-28, so she's got a lil vintage moment going on but she still eats. bye bestie, go parse some records πŸ’–πŸŒΈβœ¨

πŸ“¦ where this page comes from