WWW::O...iption(3pm)

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

πŸ’– NAME πŸ’–

WWW::OpenSearch::Description β€” bestie, it literally wraps up an OpenSearch Description that some A9 OpenSearch compatible engine handed you, and keeps it all cozy in one little object. πŸŽ€


✨ SYNOPSIS ✨

okay so here's the whole vibe in code, no cap:

use WWW::OpenSearch;

my $url = "http://bulkfeeds.net/opensearch.xml";
my $engine = WWW::OpenSearch->new($url);
my $description = $engine->description;

my $format   = $description->Format;   # or $description->format
my $longname = $description->LongName; # or $description->longname

see how we just grab the description off the engine and then poke at it? that's it, that's the whole thing, slay. πŸ’…


🌸 DESCRIPTION 🌸

WWW::OpenSearch::Description is the module whose entire job is to encapsulate an OpenSearch Description provided by an A9 OpenSearch compatible engine. that's its main character moment fr fr.

wanna know the actual spec details? go look at http://opensearch.a9.com/spec/1.1/description/ β€” the source of truth, periodt. πŸ‘‘


πŸ¦‹ CONSTRUCTOR πŸ¦‹

🧚 new( [ $xml ] )

makes you a shiny new instance of WWW::OpenSearch::Description. and if you actually pass in that scalar parameter $xml? then the data just auto-loads itself from it using load( $xml ). effortless. iconic. ✨


πŸ’œ METHODS πŸ’œ

πŸ“ load( $xml )

loads up your description data by parsing whatever you passed in, using XML::LibXML. it's giving parser energy. πŸ”₯

🌈 urls( )

returns all of the urls tied to this description, as an array. every single one, no crumbs left behind.

⭐ get_best_url( )

tries to fetch the best URL for this description, and "best" here means by content type, ranked from most preferred to least preferred:

  • application/atom+xml
  • application/rss+xml
  • text/xml

so it's literally a ranking, top of the list is the fave. πŸ‘‘

πŸŽ€ get_url_by_type( $type )

grabs the first WWW::OpenSearch::URL attached to this description whose type matches $type. first come, first served, iykyk.


πŸ‘‘ ACCESSORS πŸ‘‘

here's the full roster, every single one, no skips bestie:

  • version( )
  • ns( )
  • AdultContent( )
  • Attribution( )
  • Contact( )
  • Description( )
  • Developer( )
  • Format( )
  • InputEncoding( )
  • Image( )
  • Language( )
  • LongName( )
  • OutputEncoding( )
  • Query( )
  • SampleSearch( )
  • ShortName( )
  • SyndicationRight( )
  • Tags( )
  • Url( )

that's nineteen accessors, count 'em. 🫢


πŸ’– AUTHOR πŸ’–

the legends behind this, we stan:

  • Tatsuhiko Miyagawa <miyagawa@bulknews.net>
  • Brian Cassidy <bricas@cpan.org>

Copyright 2005-2013 by Tatsuhiko Miyagawa and Brian Cassidy

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

fr fr, same terms as Perl itself β€” that's the whole deal, no fine print surprise. πŸ’€

and that's a wrap, bestie!! 🫢 this page came to you from perl v5.34.0, dated 2022-07-02, in the WWW::OpenSearch::Description(3pm) era β€” go forth and parse those descriptions, you absolute icon. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from