Barbie > WWW-UsePerl-Journal-Thread-0.12 > WWW::UsePerl::Journal::Thread

Download:
WWW-UsePerl-Journal-Thread-0.12.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.12   Source  

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(thread => $entries[0]);
  my @comments = $thread->commentids();
  foreach 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.

METHODS ^

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

  use WWW::UsePerl::Journal::Thread;
  my $j = WWW::UsePerl::Journal::Thread-E<gt>new(j => $journal, entry => $entryid);

  use WWW::UsePerl::Journal::Thread;
  my $j = WWW::UsePerl::Journal::Thread-E<gt>new(j => $journal, thread => $threadid);

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

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 dependant upon their severity and my availablity. 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 ^

WWW::UsePerl::Journal, LWP

http://use.perl.org/

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-2005 Barbie for Miss Barbell Productions

  Distributed under GPL v2. See F<COPYING> included with this distibution.