Chris Nandor

NAME

Slash::Client::Journal - Write journal clients for Slash

SYNOPSIS

        my $client = Slash::Client::Journal->new({
                host => 'use.perl.org',
        });
        my $entry = $client->get_entry(10_000);

DESCRIPTION

Slash::Client::Journal provides an API for writing clients for Slash journals.

See Slash::Client for details on authentication and for more information.

Methods

add_entry(HASHREF)

Add an entry. Must be authenticated.

Pass key-value pairs for subject and body (both required). Other optional keys are discuss, posttype, and tid.

discuss is a boolean for turning on discussions. If false, comments are not turned on. If true, the user's prefs on the site are used (which is also the default).

posttype is an integer defining the post types. This is subject to change, but is currently: 1 = Plain Old Text, 2 = HTML Formatted, 3 = Extrans (html tags to text), 4 = Code. Again, default is to simply use the user's preferences.

tid is a topic ID. This varies widely between Slash sites. To get a list, view the source of the journal editing page and look for the "tid" form values.

In scalar context, returns the unique ID of the new entry, or false if failure.

In list context, on success, returns the URL to the new journal entry as the second list element.

modify_entry(ID, HASHREF)

Modify an existing entry. Must be authenticated.

Parameters are just like add_entry. (Note: discuss cannot be modified if a discussion had already been created for the entry.)

In scalar context, returns the unique ID of the modified entry, or false if failure.

In list context, on success, returns the URL to the modified journal entry as the second list element.

delete_entry(ID)

Deletes an existing entry. Must be authenticated.

Returns true on success, false on error.

get_entries(UID [, LIMIT])

Gets the entries for a given user. If LIMIT is not supplied, a site-defined LIMIT is used.

Returns an arrayref of hashrefs, where each hashref is an entry, with the keys being the entry's id, URL, and subject.

Returns false on error.

get_entry(ID)

Get an entry. Returns lots of information about the entry, including uid, nickname, date, subject, discussion ID, tid, body, URL, id, posttype, and discussion URL.

Returns false on error.

TODO

Work on error handling.

SEE ALSO

Slash::Client(3).

VERSION

$Id: Journal.pm,v 1.1 2005/11/21 17:31:47 pudge Exp $