Data::Microformat::hFeed - A module to parse and create hFeeds


    use Data::Microformat::hFeed;

    my $feed = Data::Microformat::hFeed->parse($a_web_page);

        print "Feed title is ".$feed->title;
        print "Feed author is ".$feed->author->fullname;        
        foreach my $entry ($feed->entries) {
                print $entry->title."\n";

        # Create a new feed from scratch
        my $feed = Data::Microformat::hFeed->new;
        $feed->title("A feedtitle");
        $feed->tagline("Some pithy tagline");
        $feed->description("Somebody did something");
        $feed->copyright({ href => $url, text => 'Some licence' });
        foreach my $category (qw(cat1 cat2 cat3)) {


An hFeed is a microformat used to contain hEntries.

This module exists both to parse existing hFeeds from web pages, and to create new hFeeds so that they can be put onto the Internet.

To use it to parse an existing hFeed (or hFeeds), simply give it the content of the page containing them (there is no need to first eliminate extraneous content, as the module will handle that itself):

    my $feed = Data::Microformat::hFeed->parse($content);

If you would like to get all the feeds on the webpage, simply ask using an array:

    my @feeds = Data::Microformat::hFeed->parse($content);

To create a new hFeed, first create the new object:

    my $feed = Data::Microformat::hFeed->new;

Then use the helper methods to add any data you would like. When you're ready to output in the hFeed HTML format, simply write

    my $output = $feed->to_html;

And $output will be filled with an hFeed representation, using <div> tags exclusively with the relevant class names.



The microformat class name for a feed; to wit, "hfeed"


This is a method to list all the fields on an address that can hold exactly one value.


This is a method to list all the fields on an address that can hold multiple values.

Data::Microformat::organization->from_tree($tree [, $source_url])

This method overrides but provides the same functionality as the method of the same name in Data::Microformat, with the optional addition of $source_url. If present, this latter term will set the link and the base of the feed automatically.


The id of this feed.


The title of this feed.


The base of this feed if available.

The permalink of this feed.


The language of this feed.


The tagline of this feed if available.


The description of this feed if available.


When this feed was modified - returns a DateTime object.

Returns a hash ref containing the copyright information for this feed.

The hash ref may have any or all of the following keys: text, href.


The name of the feed generator.


All the categories for this feed.


The author of this feed. Returns a Data::Microformat::hCard object.


The geo location information for this feed. Returns a Data::Microformat::geo object.


The entries for this feed. Returns Data::Microformat::hFeed::hEntry objects.


Return this hFeed as HTML


Please report any bugs or feature requests to bug-data-microformat at, or through the web interface at I will be notified,and then you'll automatically be notified of progress on your bug as I make changes.


Simon Wistow, <>


Copyright 2008, Six Apart Ltd. All rights reserved.


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

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.