line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package LJ::Schedule::Post::Simple; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use base qw(LJ::Schedule::Post); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1192
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
630
|
use LJ::Simple; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
LJ::Schedule::Post::Simple - The default LJ::Schedule posting component. |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 VERSION |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Version 0.6 |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=cut |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
our $VERSION = '0.6'; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 SYNOPSIS |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
This module is used internally by LJ::Schedule, and shouldn't need to be |
25
|
|
|
|
|
|
|
used directly. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 AUTHOR |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
Ben Evans, C<< >> |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 BUGS |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
34
|
|
|
|
|
|
|
C, or through the web interface at |
35
|
|
|
|
|
|
|
L. |
36
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress on |
37
|
|
|
|
|
|
|
your bug as I make changes. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 SUPPORT |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
perldoc LJ::Schedule |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
You can also look for information at: |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=over 4 |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
L |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=item * CPAN Ratings |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
L |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
L |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=item * Search CPAN |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
L |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=back |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Copyright 2006 Ben Evans, all rights reserved. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
74
|
|
|
|
|
|
|
under the same terms as Perl itself. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=cut |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
# |
79
|
|
|
|
|
|
|
# Default constructor |
80
|
|
|
|
|
|
|
# |
81
|
|
|
|
|
|
|
sub new { |
82
|
|
|
|
|
|
|
my ($pkg, $params) = @_; |
83
|
|
|
|
|
|
|
my $self = {}; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
$self = $params if (ref($params) eq 'HASH'); |
86
|
|
|
|
|
|
|
bless $self, $pkg; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
return $self; |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
# |
92
|
|
|
|
|
|
|
# Actually does the post |
93
|
|
|
|
|
|
|
# |
94
|
|
|
|
|
|
|
sub post_cal { |
95
|
|
|
|
|
|
|
my $self = shift; |
96
|
|
|
|
|
|
|
my $cal = shift; |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
my $post_content = $self->output_cal_for_lj($cal); |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
# print STDERR "In post_cal(): \n-------\n", $post_content, "\n\n"; |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
my $rh_res = {}; |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
my %lj_params = ( |
105
|
|
|
|
|
|
|
user => $LJ::Schedule::CONFIG->{'private.user'}, |
106
|
|
|
|
|
|
|
pass => $LJ::Schedule::CONFIG->{'private.pass'}, |
107
|
|
|
|
|
|
|
entry => $post_content, |
108
|
|
|
|
|
|
|
subject => $LJ::Schedule::CONFIG->{'entry.subject'}, |
109
|
|
|
|
|
|
|
html => 1, |
110
|
|
|
|
|
|
|
protect => $LJ::Schedule::CONFIG->{'entry.protect'}, |
111
|
|
|
|
|
|
|
results => $rh_res, |
112
|
|
|
|
|
|
|
); |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
if (scalar(@{$LJ::Schedule::TAGS}) > 0) { |
115
|
|
|
|
|
|
|
%lj_params = (%lj_params, 'tags' => $LJ::Schedule::TAGS); |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
my $post_ok = LJ::Simple::QuickPost(%lj_params) || die "$0: Failed to post entry: $LJ::Simple::error\n"; |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
# Currently unimplemented - will do if wanted |
121
|
|
|
|
|
|
|
# mood => Current mood |
122
|
|
|
|
|
|
|
# music => Current music |
123
|
|
|
|
|
|
|
# groups => Friends groups list |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
return $post_ok; |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
1; # End of LJ::Schedule::Post::Simple |