WWW::P...:Utils(3pm)

πŸ“¦ version 0.5.3, in alpine 3.24

πŸ’– NAME πŸ’–

okay bestie, this is WWW::PipeViewer::Utils β€” the WWW::P...:Utils(3pm) page from User Contributed Perl Documentation 🫢. It's literally Various utils. no cap ✨.

🌈 SYNOPSIS 🌈

use WWW::PipeViewer::Utils;

my $yv_utils = WWW::PipeViewer::Utils->new(%opts);

print $yv_utils->format_time(3600);

πŸ’… SUBROUTINES/METHODS πŸ’…

here's the whole method lineup, no skips, no crumbs πŸ”₯

🌸 new(%opts) 🌸

the options are:

  • thousand_separator => "" β€” character used as thousand separator πŸ’Έ
  • months => [] β€” month names for format_date() πŸ“…
  • youtube_video_url_format => "" β€” a video YouTube URL format for sprintf(format, videoID) 🎬
  • youtube_channel_url_format => "" β€” a channel YouTube URL format for sprintf(format, channelID) πŸ“Ί
  • youtube_playlist_url_format => "" β€” a playlist YouTube URL format for sprintf(format, playlistID) 🎢

πŸ¦‹ extension($type) πŸ¦‹

returns the extension format from a given type. feed it something like 'video/webm;+codecs="vp9"' and it returns 'webm' ✨.

⏰ format_time($sec) ⏰

returns time from seconds ⏳.

πŸ•°οΈ format_duration($duration) πŸ•°οΈ

returns seconds from duration (PT1H20M10S) β€” yes, the other direction, slay πŸ’….

πŸ“… format_date($date) πŸ“…

returns the string "04 May 2010" from "2010-05-04T00:25:55.000Z" πŸŽ€.

πŸ§“ date_to_age($date) πŸ§“

returns the (approximated) age for a given date of the form "2010-05-04T00:25:55.000Z" 😌.

πŸ“₯ get_entries($result) πŸ“₯

returns the entries for a given result 🫢.

βœ… has_entries($result) βœ…

returns true if a given result has entries πŸ‘‘.

🧼 normalize_filename($title, $fat32safe) 🧼

replaces file-unsafe characters and trims spaces 🧚.

πŸ“ format_text(%opt) πŸ“

formats a text with information from streaming and video info. the structure of %opt is:

(
    streaming => HASH,
    info      => HASH,
    text      => STRING,
    escape    => BOOL,
    fat32safe => BOOL,
)

πŸ”’ set_thousands($num) πŸ”’

returns the number with thousand separators πŸ’―.

πŸŽ₯ get_video_id($info) πŸŽ₯

gets videoID 🎬.

πŸ“œ get_description($info) πŸ“œ

gets description πŸ“.

🏷️ get_title($info) 🏷️

gets title 🏷️.

πŸ–ΌοΈ get_thumbnail($info;$xsize,$ysize) πŸ–ΌοΈ

gets the smallest thumbnail of at least ${xsize}x${ysize} 🌸. the signature literally has that semicolon, iykyk πŸ’….


🫢 AUTHOR 🫢

Trizen, "<echo dHJpemVuQHByb3Rvbm1haWwuY29tCg== | base64 -d>" β€” yes, the contact line is literally that command, iconic πŸŽ€.

πŸ’¬ SUPPORT πŸ’¬

you can find documentation for this module with the perldoc command 🫢:

perldoc WWW::PipeViewer::Utils

Copyright 2012-2020 Trizen.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See <https://dev.perl.org/licenses/> for more information.


okay bestie that's the whole page πŸ’– β€” source/version vibes: perl v5.42.2, dated 2024-09-28, footer manual WWW::P...:Utils(3pm) πŸŽ€πŸ’…

πŸ“¦ where this page comes from