LJ::Simple - 0.15
A simple perl module to access LiveJournal
LJ::Simple is a relatively trival perl module which
shows an OOP API to the world and allows the caller to deal with LiveJournal
work.
Currently this module allows you to:
- Log into LiveJournal
- Post a journal entry
- Edit a journal entry
- Delete a journal entry
You can download version 0.15 of the code here:
LJ-Simple-0.15.tar.gz.
View the Changelog
Read the manual page
Example
The following example posts a simple message into the test LiveJournal using
the LJ::Simple::QuickPost method.
use LJ::Simple;
LJ::Simple::QuickPost(
user => "test",
pass => "test",
entry => "Just a simple entry",
) || die "$0: Failed to post entry: $LJ::Simple::error\n";
The next example shows how to post an entry into the test LiveJournal using
the complete, object-based, interface:
use LJ::Simple;
my $lj = new LJ::Simple ({
user => "test",
pass => "test",
});
(defined $lj)
|| die "$0: Failed to log into LiveJournal: $LJ::Simple::error\n";
my %Event=();
$lj->NewEntry(\%Event) ||
die "$0: Failed to create new entry: $LJ::Simple::error\n";
my $entry=<<EOF;
A simple entry made using <tt>LJ::Simple</tt> version $LJ::Simple::VERSION
EOF
$lj->SetEntry(\%Event,$entry)
|| die "$0: Failed to set entry: $LJ::Simple::error\n";
$lj->SetMood(\%Event,"happy")
|| die "$0: Failed to set mood: $LJ::Simple::error\n";
$lj->Setprop_nocomments(\%Event,1);
my ($item_id,$anum,$html_id)=$lj->PostEntry(\%Event);
(defined $item_id)
|| die "$0: Failed to post journal entry: $LJ::Simple::error\n";