NAME

Bryar::Document - Represents a blog post

SYNOPSIS

	$self->new(...);

	$self->content();     # Get content
	$self->title();       # Get title

	$self->epoch();       # Get epoch
    $self->timepiece();   # Get the date as a Time::Piece object

	$self->category();    # Get category
	$self->author();      # Get author

	$self->keywords(...); # Return keywords relating to this document
    $self->id             # Unique identifier

    $self->comments();    # Get comments

DESCRIPTION

This encapsulates a blog post, as returned from a search on a data source.

METHODS

new

$self->new(%params)

Creates a new Bryar::Document instance.

content

$self->content();    # Get content

Gets the value of the document's content

title

$self->title();    # Get title

Gets the value of the document's title

epoch

$self->epoch();    # Get epoch

Gets the value of the document's epoch

timepiece

Returns the date of the document as a Time::Piece object.

datetime

Returns the date of the document as a DateTime object

category

$self->category();    # Get category

Gets the value of the document's category

author

$self->author();    # Get author

Gets the value of the document's author

keywords

$self->keywords

Returns the keywords for this blog entry, using Lingua::EN::Keywords if it's installed. May be computationally expensive!

id

$self->id();    # Get id

Returns a unique identifier for the document.

url

$self->url;

Returns the post url relative to $bryar->config->baseurl.

comments

@comments = $self->comments();

Returns a list of Bryar::Comment objects attached to this document.

excerpt

my $excerpt = $self->excerpt(20); # get a 20 word excerpt
my $excerpt = $self->excerpt( );  # get excerpt as long as the excerpt_words config variable

LICENSE

This module is free software, and may be distributed under the same terms as Perl itself.

AUTHOR

Copyright (C) 2003, Simon Cozens simon@kasei.com

SEE ALSO