LJ::Schedule::Post::Simple - The default LJ::Schedule posting component.


LJ-Schedule documentation Contained in the LJ-Schedule distribution.

Index


Code Index:

NAME

Top

LJ::Schedule::Post::Simple - The default LJ::Schedule posting component.

VERSION

Top

Version 0.6

SYNOPSIS

Top

This module is used internally by LJ::Schedule, and shouldn't need to be used directly.

AUTHOR

Top

Ben Evans, <ben at bpfh.net>

BUGS

Top

Please report any bugs or feature requests to bug-lj-schedule-post-simple at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=LJ-Schedule. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc LJ::Schedule

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/LJ-Schedule

* CPAN Ratings

http://cpanratings.perl.org/d/LJ-Schedule

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=LJ-Schedule

* Search CPAN

http://search.cpan.org/dist/LJ-Schedule

ACKNOWLEDGEMENTS

Top

COPYRIGHT & LICENSE

Top


LJ-Schedule documentation Contained in the LJ-Schedule distribution.
package LJ::Schedule::Post::Simple;

use warnings;
use strict;

use base qw(LJ::Schedule::Post);

use LJ::Simple;

our $VERSION = '0.6';

#
# Default constructor
#
sub new {
    my ($pkg, $params) = @_;
    my $self = {};

    $self = $params if (ref($params) eq 'HASH');
    bless $self, $pkg;

    return $self;
}

#
# Actually does the post
#
sub post_cal {
    my $self = shift;
    my $cal  = shift;

    my $post_content = $self->output_cal_for_lj($cal);

#    print STDERR "In post_cal(): \n-------\n", $post_content, "\n\n";

    my $rh_res = {};

    my %lj_params = (
                     user    =>      $LJ::Schedule::CONFIG->{'private.user'},
                     pass    =>      $LJ::Schedule::CONFIG->{'private.pass'},
                     entry   =>      $post_content,
                     subject =>      $LJ::Schedule::CONFIG->{'entry.subject'},
                     html    =>      1,
                     protect =>      $LJ::Schedule::CONFIG->{'entry.protect'},
                     results =>      $rh_res,
                     );

    if (scalar(@{$LJ::Schedule::TAGS}) > 0) {
        %lj_params = (%lj_params, 'tags' => $LJ::Schedule::TAGS);
    }

    my $post_ok = LJ::Simple::QuickPost(%lj_params) || die "$0: Failed to post entry: $LJ::Simple::error\n";

# Currently unimplemented - will do if wanted
#               mood    =>      Current mood
#               music   =>      Current music
#               groups  =>      Friends groups list


    return $post_ok;
}


1; # End of LJ::Schedule::Post::Simple