HTTP::...istSets(3pm)

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

πŸ’– NAME πŸ’–

HTTP::OAI::ListSets β€” bestie, this is your golden ticket to an OAI ListSets response. That's it. That's the whole vibe. ✨


🌸 SYNOPSIS 🌸

okay so here's the whole flow, and honestly? it's giving effortless:

my $r = $h->ListSets();

while( my $rec = $r->next ) {
        print $rec->setSpec, "\n";
}

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

like. look at it. looping through records, printing the setSpec, and then dying dramatically if anything went wrong. main character behaviour fr fr. πŸ’…


πŸ¦‹ METHODS πŸ¦‹

  • $ls = new HTTP::OAI::ListSets β€” this constructor method hands you back a brand new OAI::ListSets object. yes, that's the whole job, and it ate. πŸ’–
  • $set = $ls->next β€” gives you either an HTTP::OAI::Set object, or undef if there are literally no more records left to hand out. you wanna know if something went sideways while grabbing the next record? test it with $set->is_error. πŸ‘‘
heads up bestie: if -resume was set to false in the Harvest Agent, next might come back with a string instead β€” and that string is the resumptionToken. not a Set object, a string. iykyk. 😭
  • @setl = $ls->set([$set]) β€” returns the set list, and optionally adds a new set or resumptionToken, $set. what you get back is an array ref of HTTP::OAI::Sets, with an optional resumptionToken string riding along. 🌈
  • $token = $ls->resumptionToken([$token]) β€” returns the HTTP::OAI::ResumptionToken, and optionally sets it too. two jobs, zero complaints, iconic. ✨
  • $dom = $ls->toDOM β€” returns an XML::DOM object that represents the ListSets response. look at your little structured tree go. πŸŽ€

🫢 SIGN-OFF 🫢

this page was brought to you by perl v5.36.0, dated 2023-09-28, and it's filed under HTTP::...istSets(3pm) in the User Contributed Perl Documentation. go forth and harvest those sets, bestie β€” no cap, you've got this. πŸ’œπŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from