| LJ-Schedule documentation | Contained in the LJ-Schedule distribution. |
LJ::Schedule::Post::Simple - The default LJ::Schedule posting component.
Version 0.6
This module is used internally by LJ::Schedule, and shouldn't need to be used directly.
Ben Evans, <ben at bpfh.net>
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.
You can find documentation for this module with the perldoc command.
perldoc LJ::Schedule
You can also look for information at:
Copyright 2006 Ben Evans, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| 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