WebSer...rDrive(3pm)

πŸ“¦
version 0.18 Β· 2 versions
  • 0.18 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.18 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

okay so bestie, gather round β€” this is WebService::ILS::OverDrive, the WebService::ILS module for OverDrive services. yes, that OverDrive. the library one. the one with the ebooks. πŸ¦‹

(also, fun fact, the manual name is WebSer...rDrive(3pm) β€” section 3pm, Perl land, you know how it is πŸ’…)


✨ SYNOPSIS ✨

use WebService::ILS::OverDrive::Library;
or
use WebService::ILS::OverDrive::Patron;

like... pick your fighter. Library or Patron. it's giving choose-your-own-adventure. πŸŽ€


🌸 DESCRIPTION 🌸

okay so there's two whole vibes here and you need to know which one you are:

  • WebService::ILS::OverDrive::Library β€” anonymous discovery services. no individual user credentials required. no login, no drama, just vibes. 🧚
  • WebService::ILS::OverDrive::Patron β€” discovery and circulation services that require individual user credentials. so like, you gotta be somebody. bring your login. πŸ‘‘

also go look at WebService::ILS β€” that's the parent situation, iykyk.


🫢 CONSTRUCTOR 🫢

new (%params_hash or $params_hashref)

bestie it takes a hash or a hashref, either one, we're flexible like that. πŸ’œ

Additional constructor params, and yes this is the whole list:

  • "test" β€” if set to true, use OverDrive test API urls. test urls! so you don't go messing with the real ones. very demure, very mindful. πŸ™ˆ

πŸ”₯ DISCOVERY METHODS πŸ”₯

search ($params_hashref)

Additional input params β€” one (1) of them:

  • "no_details" β€” if true, no metadata calls will be made for result items. which means literally only id, title, rating and media will be available. that's it. that's the whole meal. if you wanted more, shoulda left no_details off. 😭

πŸ‘‘ NATIVE METHODS πŸ‘‘

native_search ($params_hashref)

go read <https://developer.overdrive.com/apis/search> β€” the docs are right there, not me making it up, periodt.

this is for iterating through search result pages, and it's lowkey the best part. each native_search_*() method accepts a record returned by any native_search*() method as input. any of them. mix and match. iconic. ✨

Example, since a demo says a thousand words:

my $res = $od->native_search({q => "Dogs"});
while ($res) {
    do_something($res);
    $res = $od->native_search_next($res);
}
or
my $res = $od->native_search({q => "Dogs"});
my $last = $od->native_search_last($res);
my $next_to_last = $od->native_search_prev($last);
my $first = $od->native_search_first($next_to_last)
# Same as $od->native_search_first($last)
# Same as $res

both of these eat an $item_data as returned by native_search*. yes, the same thing the other ones take. consistency, we love to see it. 🌈

Example:

my $res = $od->native_search({q => "Dogs"});
foreach (@{ $res->{products} }) {
    my $meta = $od->native_item_metadata($_);
    my $availability = $od->native_item_availability($_);
    ...
}

πŸŽ€ LICENSE πŸŽ€

Copyright (C) Catalyst IT NZ Ltd Copyright (C) Bywater Solutions

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. free software!! go off, redistribute, whatever, it's yours. πŸ’–


πŸ’œ AUTHOR πŸ’œ

Srdjan JankoviX <srdjan@catalyst.net.nz>


and that's the whole page bestie!! this one shipped as part of perl v5.36.0, dated 2022-11-29, in the WebSer...rDrive(3pm) manual β€” mwah, slay, go forth and search some Dogs. πŸΆπŸ’…β­

πŸ“¦ where this page comes from