Slash::Client::Journal - Write journal clients for Slash
my $client = Slash::Client::Journal->new({ host => 'use.perl.org', }); my $entry = $client->get_entry(10_000);
Slash::Client::Journal provides an API for writing clients for Slash journals.
See Slash::Client for details on authentication and for more information.
Add an entry. Must be authenticated.
Pass key-value pairs for subject and body (both required). Other optional keys are discuss, posttype, and tid.
subject
body
discuss
posttype
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 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.)
add_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.
Deletes an existing entry. Must be authenticated.
Returns true on success, false on error.
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 an entry. Returns lots of information about the entry, including uid, nickname, date, subject, discussion ID, tid, body, URL, id, posttype, and discussion URL.
Work on error handling.
Slash::Client(3).
$Id: Journal.pm,v 1.1 2005/11/21 17:31:47 pudge Exp $
To install Slash::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Slash::Client
CPAN shell
perl -MCPAN -e shell install Slash::Client
For more information on module installation, please visit the detailed CPAN module installation guide.