NAME

WWW::UsePerl::Journal::Thread - Handles the retrieval of UsePerl journal comment threads

SYNOPSIS

  use WWW::UsePerl::Journal;
  use WWW::UsePerl::Journal::Thread;

  my $journal = WWW::UsePerl::Journal->new('barbie');
  my @entries = $journal->entryids();

  my $thread = WWW::UsePerl::Journal::Thread->new(
        j       => $journal, 
        thread  => $entries[0]
  );

  my @comments = $thread->commentids();
  for my $id (@comments) {
    printf "\n----\n%s [%d %s %d] %s",
	  $thread->comment($id)->subject(),
	  $thread->comment($id)->score(),
	  $thread->comment($id)->user(),
	  $thread->comment($id)->uid(),
	  $thread->comment($id)->date(),
	  $thread->comment($id)->content();
  }

  my $threadid = $thread->thread();

DESCRIPTION

A collection of routines to handle the retrieval of threads from a UsePerl (http://use.perl.org/) journal entry.

Using WWW::UsePerl::Journal, journal entry ids can be obtain. Each entry id can be used to obtain a comment thread. Each comment property is accessed via a comment object from within the thread.

Note that as on late 2010 use.perl was decommissioned. A read-only version of the site now exists on the perl.org servers, and a full database backup is also available if you wish to host your own use.perl archive.

A future edition of this distribution will allow a DBI interface to a local database to retrieve journal entries.

PUBLIC INTERFACE

The Constructor

new
use WWW::UsePerl::Journal;
my $journal = WWW::UsePerl::Journal->new('barbie');

use WWW::UsePerl::Journal::Thread;
my $j = WWW::UsePerl::Journal::Thread->new(
          j       => $journal, 
          eid     => $entryid,
);

Creates an thread instance for the specified journal entry. An entry ID returned from $journal->entryids() must use the entry => $entryid form to obtain the correct thread.

Methods

thread()

Returns the current thread id.

comment($commentid)

Returns a comment object of the given comment ID

commentids()

Returns an ascending array of the comment IDs.

Can take an optional hash containing; {descending=>1} to return a descending list of comment IDs, {ascending=>1} to return an ascending list or {threaded=>1} to return a thread ordered list. 'ascending' being the default.

SUPPORT

There are no known bugs at the time of this release. However, if you spot a bug or are experiencing difficulties that are not explained within the POD documentation, please submit a bug to the RT system (see link below). However, it would help greatly if you are able to pinpoint problems or even supply a patch.

Fixes are dependent upon their severity and my availability. Should a fix not be forthcoming, please feel free to (politely) remind me by sending an email to barbie@cpan.org .

RT: http://rt.cpan.org/Public/Dist/Display.html?Name=WWW-UsePerl-Journal-Thread

SEE ALSO

http://use.perl.org/use.perl.org

WWW::UsePerl::Journal, WWW::UsePerl::Journal::Server

AUTHOR

Barbie, <barbie@cpan.org> for Miss Barbell Productions http://www.missbarbell.co.uk.

CREDITS

Russell Matbouli, for creating WWW::UsePerl::Journal in the first place and giving me the idea to extend it further.

COPYRIGHT AND LICENSE

Copyright (C) 2003-2015 Barbie for Miss Barbell Productions

This distribution is free software; you can redistribute it and/or modify it under the Artistic Licence v2.