Barbie

NAME

WWW::UsePerl::Journal - A use.perl.org journal tool

SYNOPSIS

  use WWW::UsePerl::Journal;
  my $journal = WWW::UsePerl::Journal->new('russell')
  print $journal->entrytitled("Text::Echelon");
  my @entries = $journal->entrytitles();

DESCRIPTION

An all round journal tool for use.perl addicts. Will access journal entries for a specific user, or the latest 30 postings, or retrieve a specific journal entry. Can also post into a specific user's journal.

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.

INTERFACE

Constructor

  • new( [ $username | $userid ] )

      use WWW::UsePerl::Journal;
      my $j1 = WWW::UsePerl::Journal->new('russell');
      my $j2 = WWW::UsePerl::Journal->new(1413);

    Creates an instance for the specified user, using either a username or userid. Note that you must specify a name or id in order to instantiate the object.

Methods

  • error

    If an error message given, sets the current message and returns undef. If no message given returns that last error message.

  • connected

    Check whether use.perl is available.

  • user

    Returns the username

  • uid

    Returns the user ID

  • recentarray

    Returns an array of the 30 most recently posted WWW::UsePerl::Journal::Entry objects.

  • entryhash

    Returns a hash of WWW::UsePerl::Journal::Entry objects

  • entryids

    Returns an array of the entry IDs

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

  • entrytitles

    Returns an array of the entry titles

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

  • entry

    Returns the text of an entry, given an entry ID

  • entrytitled

    Returns an entry object given an entry title. To obtain the entry details use the underlying object methods:

      my $e = $j->entrytitled('My Journal');
      my $eid     = $e->id;
      my $title   = $e->title;
      my $content = $e->content;

    Note that prior to v0.21 this used a regular expression to match the user data against the title. Due to this being a potential security risk, as of v0.22 the title passed to this method is now required to be a string that will match all or part of the journal title you require.

  • refresh

    To save time, entries are cached. However, following a post or period of waiting, you may want to refresh the list. This functions allows you to clear the cache and start again.

  • debug

    Turns internal debugging on or off. Use a true or false expression to set value as appropriate. Returns current status.

  • log

    Used to record internal debugging messages. Call externally with no arguments to retrieve the current list of messages.

  • raw

    For debugging purposes.

TODO

As use.perl.org is now read only, this distribution only scrapes the temporary site. As such development of these modules will be limited. However, I now plan to add an interface which can use a local database.

More details coming soon ....

CAVEATS

Beware the stringification of WWW::UsePerl::Journal::Entry objects. They're still objects, they just happen to look the same as before when you're printing them. Use ->content instead.

The time on a journal entry is the localtime of the user that created the journal entry. If you aren't in the same timezone, that time can appear an hour out.

SEE ALSO

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

WWW::UsePerl::Journal::Server

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

AUTHOR

  Original author: Russell Matbouli
  <www-useperl-journal-spam@russell.matbouli.org>,
  <http://russell.matbouli.org/>

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

CONTRIBUTORS

Thanks to Iain Truskett, Richard Clamp, Simon Wilcox, Simon Wistow and Kate L Pugh for sending patches. 'jdavidb' also contributed two stats scripts.

COPYRIGHT AND LICENSE

  Copyright (C) 2002-2004 Russell Matbouli.
  Copyright (C) 2005-2015 Barbie for Miss Barbell Productions.

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