Graham Ollis

NAME

WebService::LiveJournal::Event - LiveJournal event class

VERSION

version 0.07

SYNOPSIS

create an event

 use WebService::LiveJournal;
 my $client = WebService::LiveJournal::Client->new(
   username => $user,
   password => $password,
 );
 
 # $event is an instance of WS::LJ::Event
 my $event = $client->create_event;
 $event->subject("this is a subject");
 $event->event("this is the event content");
 # doesn't show up on the LiveJournal server
 # until you use the update method.
 $event->update;
 
 # save the itemid for later use
 $itemid = $event->itemid;

update an existing event

 use WebService::LiveJournal;
 my $client = WebService::LiveJournal::Client->new(
   username => $user,
   password => $password,
 );
 
 my $event = $client->get_event( $itemid );
 $event->subject('new subject');
 $event->update;

DESCRIPTION

This class represents an "event" on the LiveJournal server.

ATTRIBUTES

subject

Required.

The subject for the event.

event

Required.

The content of the event.

year

Year

month

Month

day

Day

hour

Hour

min

Minute

security

One of

public
private
friends
usemask

allowmask

Relevant when security is usemask. A 32-bit unsigned integer representing which of the user's groups of friends are allowed to view this post. Turn bit 0 on to allow any defined friend to read it. Otherwise, turn bit 1-30 on for every friend group that should be allowed to read it. Bit 31 is reserved.

picture

The picture tag to use for this entry. Each icon picture may have one or more tags, you can select it by using any one of those tags for this attribute.

itemid

Read only.

The LiveJournal item id

url

Read only.

URL for the LiveJournal event.

anum

Read only.

The authentication number generated for this entry Probably best ignored.

usejournal

If editing a shared journal entry, include this key and the username you wish to edit the entry in. By default, you edit the entry as if it were in user "user"'s journal, as specified above.

props

Property hash

METHODS

$event->update

Create a new (if it isn't on the LiveJournal server yet) or update the existing event on the LiveJournal server.

Returns true on success.

This method signals an error depending on the interface selected by throwing an exception or returning undef.

$event->save

An alias for update.

$event->delete

Remove the event on the LiveJournal server.

This method signals an error depending on the interface selected by throwing an exception or returning undef.

$event->get_prop( $key )

Get the property with the given key

$event->set_prop( $key => $value )

Set the property with the given key and value

$event->get_tags

Returns the tags for the event as a list.

$event->set_tags( @new_tags )

Set the tags for the event.

$event->set_access([ 'public' | 'private' | 'friends' ])

$event->set_access('group', @group_list)

Set the access for the event. The first argument is the type:

public

Entry will be readable by anyone

private

Entry will be readable only by the journal owner

friends

Entry will be readable only by the journal owner's friends

group

Entry will be readable only by the members of the given groups.

get_access

Returns the access information for the entry. It will always return the type as defined above in the set_access method. In addition for the group type the list of groups will also be returned:

 my($type, @groups) = $event-E<gt>get_access

SEE ALSO

WebService::LiveJournal

AUTHOR

Graham Ollis <plicease@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Graham Ollis.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.