URI::Title(3pm)

πŸ“¦
version 1.904 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

URI::Title β€” get the titles of things on the web in a sensible way πŸ¦‹


✨ VERSION ✨

version 1.904 β€” yes bestie, she's on 1.904 πŸ‘‘


🌸 SYNOPSIS 🌸

okay so literally the whole vibe is like three lines, watch:

use URI::Title qw( title );
my $title = title('http://microsoft.com');
print "Title is $title\n";

that's it. that's the whole thing. slay πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

so the author keeps needing to find the title of stuff on the web. and like, on paper? super simple request. just get() the object, parse for a title tag, done, right?

ha. I wish. 😭 there are several problems with that approach:

  • what if the resource is on a very slow server? do we wait for ever or what? πŸ™ˆ
  • what if the resource is a 900 gig file? bestie you do not want to download that πŸ’€
  • what if the page title isn't in a title tag at all, but is buried somewhere in the HTML? πŸ•΅οΈ
  • what if the resource is an MP3 file, or a word document or something? 🎧
  • ... and like, more. so many more.

so, the plan: let's solve these issues once. 🌈


πŸ’… METHODS πŸ’…

only one, bestie. the title(url) method. call it with an url, get the title if possible, undef if it wasn't. very simple. no notes. ✨


πŸ¦‹ SEE ALSO πŸ¦‹

  • WWW::GetPageTitle β€” similar this module, but just handles web pages. the author of that module suggests you should use URI::Title. so like, we ate πŸ‘‘

wait no that's the whole list, just the one. πŸ’€


πŸ“ NOTES πŸ“

embedded title metadata of png files can be extracted if you have installed either Image::ExifTool or Image::PNG::Libpng. cute png lore fr fr 🧚


😭 TODO 😭

many, many, many things. still unimplemented:

  • get titles of MP3 files, Word Docs, PDFs, etc. πŸ“„
  • configurable.. well, anything, in fact. Timeout would be a good start. ⏱️
  • better error reporting. πŸ™

πŸ’œ AUTHORS πŸ’œ

  • Tom Insam <tom@jerakeen.org>, original author, 2004-2012.
  • Philippe Bruhat (BooK) <book@cpan.org>, maintainer, 2014.

this software is copyright (c) 2004 Tom Insam.

this program 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, no cap πŸ“œ

🌈 CREDITS 🌈

invented because of a conversation with rjp, who contributed some eyeball-melting and as-yet-unused code to get titles from MP3s and PDFs πŸ‘€πŸ”₯, and hex, who has also solved the problem, and got bits done in a nicer way than I did. iconic behavior from both of them honestly 🫢


okay that's the whole page bestie, this was perl v5.36.0, dated 2023-02-12, and it's URI::Title(3pm) β€” user contributed perl documentation, main character energy only πŸ’–βœ¨πŸŽ€ bye!!

πŸ“¦ where this page comes from