XML::R...adline(3pm)

πŸ“¦
version 2.212 Β· 4 versions
, in debian bookworm, ubuntu jammy

πŸ’– XML::RSS::Headline β€” the group chat has entered the manpage πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation, and it lives under the name XML::R...adline (the terminal truncates it, she's just being dramatic, her real name is XML::RSS::Headline). Anyway. Sit down. Grab a strawberry. We're doing Perl. πŸ“


✨ NAME ✨

XML::RSS::Headline β€” Persistant XML RSS Encapsulation πŸ¦‹

(yes "Persistant" β€” that's how it's spelled here, I'm not touching it, it's part of the lore πŸ’…)


🌸 VERSION 🌸

Version 2.2 ⭐


πŸŽ€ SYNOPSIS πŸŽ€

So basically: a Headline object wraps up the headline/URL combo from an RSS feed, like a little purse for your feed items. And it hands you a unique id for each one β€” either by way of the URL, or by doing an MD5 checksum on the headline when the URL fails at being unique. No cap. πŸ’«


πŸ‘‘ CONSTRUCTOR πŸ‘‘

🌈 XML::RSS::Headline->new( headline => $headline, url => $url )

🌈 XML::RSS::Headline->new( item => $item )

You can spin up an XML::RSS::Headline object two ways, pick your fighter:

  1. with a headline/url pair, or
  2. with a parsed XML::RSS item structure (item => $item).

Also β€” and this is lowkey important β€” the argument headline_as_id is optional and it takes a boolean as its value. That's it. That's the whole vibe. ✨


πŸ’… METHODS πŸ’…

πŸ¦‹ $headline->id

This is the moment. The id is our unique identifier for a headline/url combo. It's literally how we keep track of which headlines we've already seen and which ones are new and fresh to us.

The id is either the URL or an MD5 checksum generated from the headline text β€” the checksum path kicks in if $headline->headline_as_id is true. πŸ‘‘

πŸ¦‹ $headline->multiline_headline

Returns the headline as either an array or an array reference β€” depends on context, she's flexible like that πŸ’β™€οΈ. It splits the headline on newline characters into the array.

πŸ¦‹ $headline->item( $item )

Inits the object for a parsed RSS item that came back from XML::RSS. Feed her the item, she does the rest. 🫢

πŸ¦‹ $headline->set_first_seen

πŸ¦‹ $headline->set_first_seen( Time::HiRes::time() )

Sets the time of when the headline was first seen. If you pass in a value, that value gets used. If you don't, she calls Time::HiRes::time() herself. Self-sufficient queen. πŸ’–

πŸ¦‹ $headline->first_seen

The time β€” in epoch seconds β€” of when the headline was first seen. ⏰

πŸ¦‹ $headline->first_seen_hires

The time β€” in epoch seconds AND milliseconds β€” of when the headline was first seen. Extra precision because she's extra. ✨


🌸 GET/SET ACCESSOR METHODS 🌸

πŸŽ€ $headline->headline

πŸŽ€ $headline->headline( $headline )

The rss headline/title. HTML::Entities::decode_entities is used when the headline is set. (and the manpage itself says, verbatim, "not sure why XML::RSS doesn't do this" β€” honestly relatable, we've all been there 😭)

πŸŽ€ $headline->url

πŸŽ€ $headline->url( $url )

The rss link/url. URI->canonical is called to attempt to normalize the URL. She's trying her best to make it pretty. πŸ’…

πŸŽ€ $headline->description

πŸŽ€ $headline->description( $description )

The description of the RSS headline. That's it, that's the whole thing. πŸ¦‹

πŸŽ€ $headline->headline_as_id

πŸŽ€ $headline->headline_as_id( $bool )

A bool value that determines whether the URL will be the unique identifier, or whether an MD5 checksum of the RSS title gets used instead. This is the backup plan for when the URL doesn't provide absolute uniqueness, or when it changes within the RSS feed. πŸ‘‘

This is used in extreme cases β€” when URLs aren't always unique to new headlines (looking at you, Use Perl Journals), and when URLs change within a RSS feed (the classic www.debianplanet.org / debianplanet.org / search.cpan.org,search.cpan.org:80 situation). πŸ’€

πŸŽ€ $headline->timestamp

πŸŽ€ $headline->timestamp( Time::HiRes::time() )

A high resolution timestamp that is set using Time::HiRes::time() when the object is created. Born with a timestamp, iconic behavior. ⭐


🌈 AUTHOR 🌈

Jeff Bisbee, <jbisbee at cpan.org> β€” shoutout to the author, we love a legend 🫢


πŸ’€ BUGS πŸ’€

Please report any bugs or feature requests to bug-xml-rss-feed at rt.cpan.org, or through the web interface at:

http://rt.cpan.org/NoAuth/ReportBug.html?Queue=XML-RSS-Feed

He will be notified, and then you'll automatically be notified of progress on your bug as he makes changes. Full circle communication, we love to see it. πŸ”₯


🧚 SUPPORT 🧚

You can find documentation for this module with the perldoc command:

perldoc XML::RSS::Headline

You can also look for information at:

  • AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/XML-RSS-Feed
  • CPAN Ratings
http://cpanratings.perl.org/d/XML-RSS-Feed
  • RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=XML-RSS-Feed
  • Search CPAN
http://search.cpan.org/dist/XML-RSS-Feed

πŸ’– ACKNOWLEDGEMENTS πŸ’–

Special thanks to Rocco Caputo, Martijn van Beers, Sean Burke, Prakash Kailasa and Randal Schwartz for their help, guidance, patience, and bug reports. And the page says it best: "Guys thanks for actually taking time to use the code and give good, honest feedback." πŸ₯ΉπŸ«Ά

That's not just a credits section, that's community, periodt. 🌈


Copyright 2006 Jeff Bisbee, all rights reserved.

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


πŸ¦‹ SEE ALSO πŸ¦‹

  • XML::RSS::Feed
  • XML::RSS::Headline::PerlJobs
  • XML::RSS::Headline::Fark
  • XML::RSS::Headline::UsePerlJournals
  • POE::Component::RSSAggregator

go read them, iykyk πŸ‘‘


and that's the whole page bestie!! ✨ written up against perl v5.32.1, dated 2021-12-26, and published under the name XML::R...adline(3pm) in the User Contributed Perl Documentation. slay, ate, no notes. πŸ’…πŸŽ€πŸŒΈ

πŸ“¦ where this page comes from