WWW::Plurk::Message - A plurk message


WWW-Plurk documentation Contained in the WWW-Plurk distribution.

Index


Code Index:

NAME

Top

WWW::Plurk::Message - A plurk message

VERSION

Top

This document describes WWW::Plurk::Message version 0.02

SYNOPSIS

Top

    use WWW::Plurk;
    my $plurk = WWW::Plurk->new( 'username', 'password' );
    my @plurks = $plurk->plurks;

DESCRIPTION

Top

Represents an individual Plurk or response.

Based on Ryan Lim's unofficial PHP API: http://code.google.com/p/rlplurkapi/

INTERFACE

Top

new

Called internally.

responses

Get the responses for this Plurk. If called on an object that already represents a response gets the peers of that response (i.e. the other responses to the same Plurk).

respond

Respond to a Plurk. See WWW::Plurk#respond_to_plurk for details of arguments.

    $msg->respond( content => "I'm free!" );

Returns the newly created response.

Accessors

The following accessors provide access to the content of this Plurk:

* author
* content
* content_raw
* id
* is_mute
* is_unread
* lang
* limited_to
* no_comments
* owner_id
* plurk_id
* posted
* qualifier
* response_count
* responses_seen
* source
* user_id
* plurk

CONFIGURATION AND ENVIRONMENT

Top

WWW::Plurk requires no configuration files or environment variables.

DEPENDENCIES

Top

None.

INCOMPATIBILITIES

Top

None reported.

BUGS AND LIMITATIONS

Top

No bugs have been reported.

Please report any bugs or feature requests to bug-www-plurk@rt.cpan.org, or through the web interface at http://rt.cpan.org.

AUTHOR

Top

Andy Armstrong <andy.armstrong@messagesystems.com>

http://www.plurk.com/user/AndyArmstrong

LICENCE AND COPYRIGHT

Top


WWW-Plurk documentation Contained in the WWW-Plurk distribution.
package WWW::Plurk::Message;

use warnings;
use strict;
use Carp;
use Math::Base36 qw( encode_base36 );

our $VERSION = '0.02';

BEGIN {
    my @INFO = qw(
      author
      content
      content_raw
      id
      is_mute
      is_unread
      lang
      limited_to
      no_comments
      owner_id
      plurk_id
      posted
      qualifier
      response_count
      responses_seen
      source
      user_id
      plurk
    );

    for my $info ( @INFO ) {
        no strict 'refs';
        *{$info} = sub { shift->{$info} };
    }
}

sub new {
    my ( $class, $plurk, $detail, $author ) = @_;
    return bless {
        plurk  => $plurk,
        author => $author,
        %$detail,
    }, $class;
}

sub responses {
    my $self = shift;
    return $self->plurk->responses_for( $self->plurk_id, @_ );
}

sub respond {
    my $self = shift;
    return $self->plurk->respond_to_plurk( $self->plurk_id, @_ );
}

sub permalink {
    my $self = shift;
    return $self->plurk->_base_uri . '/p/'
      . encode_base36( $self->plurk_id );
}

1;
__END__