| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
1
|
|
|
1
|
|
1706
|
use strict; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
70
|
|
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Net::Delicious::Export::Post::XBEL; |
|
4
|
1
|
|
|
1
|
|
7
|
use base qw (Net::Delicious::Export); |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
663
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# $Id: XBEL.pm,v 1.10 2005/12/11 19:17:00 asc Exp $ |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Net::Delicious::Export::Post::XBEL - export your del.icio.us posts as |
|
11
|
|
|
|
|
|
|
XBEL SAX events |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use Net::Delicious; |
|
16
|
|
|
|
|
|
|
use Net::Delicious::Export::Post::XBEL; |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
use IO::AtomicFile; |
|
19
|
|
|
|
|
|
|
use XML::SAX::Writer; |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my $fh = IO::AtomicFile->open("/my/posts.xbel","w"); |
|
22
|
|
|
|
|
|
|
my $writer = XML::SAX::Writer->new(Output=>$fh); |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my $del = Net::Delicious->new({...}); |
|
25
|
|
|
|
|
|
|
my $exp = Net::Delicious::Export::Post::XBEL->new(Handler=>$writer); |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $it = $del->posts(); |
|
28
|
|
|
|
|
|
|
$exp->by_date($it); |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Export your del.icio.us posts as XBEL SAX events. |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
This package subclasses I. |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=cut |
|
37
|
|
|
|
|
|
|
|
|
38
|
1
|
|
|
1
|
|
23
|
use vars qw ($VERSION); |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
70
|
|
|
39
|
|
|
|
|
|
|
$VERSION = '1.4'; |
|
40
|
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
use Net::Delicious::Export::Post qw (group_by_tag |
|
42
|
1
|
|
|
1
|
|
499
|
mk_bookmarkid); |
|
|
0
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
use String::Random qw (random_string); |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 PACKAGE METHODS |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 __PACKAGE__->new(\%args) |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Valid arguments are : |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=over 4 |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=item * |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
B |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
A valid handler for I, which is really just |
|
61
|
|
|
|
|
|
|
a thin wrapper around I |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=back |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Returns a I object. Woot! |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=cut |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
# Inherited from Net::Delicious::Export |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 OBJECT METHODS |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head2 $obj->by_date(\%args) |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Valid args are |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=over 4 |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=item * |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
B I |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
A I object containing the posts you |
|
86
|
|
|
|
|
|
|
want to export. |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=item * |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
B |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
String. |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=back |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Returns whatever the handler passed to the object |
|
97
|
|
|
|
|
|
|
contructor sends back. |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=cut |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub by_date { |
|
102
|
|
|
|
|
|
|
my $self = shift; |
|
103
|
|
|
|
|
|
|
my $args = shift; |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
$self->start_document($args->{title}); |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
# |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
my $last_date = undef; |
|
110
|
|
|
|
|
|
|
my $folder = 0; |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
while (my $bm = $args->{posts}->next()) { |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
$bm->time() =~ /(\d{4}-\d{2}-\d{2})T/; |
|
115
|
|
|
|
|
|
|
my $this_date = $1; |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
# |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
if ($this_date ne $last_date) { |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
if ($folder) { |
|
122
|
|
|
|
|
|
|
$self->end_folder(); |
|
123
|
|
|
|
|
|
|
$folder = 0; |
|
124
|
|
|
|
|
|
|
} |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
$self->start_folder($this_date); |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
$last_date = $this_date; |
|
129
|
|
|
|
|
|
|
$folder = 1; |
|
130
|
|
|
|
|
|
|
} |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
# |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
$self->bookmark($bm); |
|
135
|
|
|
|
|
|
|
} |
|
136
|
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
# |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
$self->end_folder(); |
|
140
|
|
|
|
|
|
|
$self->end_document(); |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
return 1; |
|
143
|
|
|
|
|
|
|
} |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=head2 $obj->by_tag(\%args) |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
Valid args are |
|
148
|
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=over 4 |
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=item * |
|
152
|
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
B I |
|
154
|
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
A I object containing the posts you |
|
156
|
|
|
|
|
|
|
want to export. |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=item * |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
B |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
String. |
|
163
|
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=item * |
|
165
|
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
B |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
Code reference, used as an argument for passing to |
|
169
|
|
|
|
|
|
|
Perl's I function. |
|
170
|
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
The default behaviour is to sort tags alphabetically. |
|
172
|
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=back |
|
174
|
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
Bookmarks with multiple tags will be added once; subsequent |
|
176
|
|
|
|
|
|
|
instances of the same bookmark will use XBEL's element |
|
177
|
|
|
|
|
|
|
to refer back to the first URL. |
|
178
|
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
Bookmarks for any given tag set will be ordered by their |
|
180
|
|
|
|
|
|
|
timestamp. |
|
181
|
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
Tags which use del.icio.us' "hierarchical tag" structure will |
|
183
|
|
|
|
|
|
|
be rendered as nested elements. |
|
184
|
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
Multiple tags for a bookmark will be ordered alphabetically or |
|
186
|
|
|
|
|
|
|
using the same I argument passed to the method. |
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
Returns whatever the handler passed to the object |
|
189
|
|
|
|
|
|
|
contructor sends back. |
|
190
|
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=cut |
|
192
|
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
sub by_tag { |
|
194
|
|
|
|
|
|
|
my $self = shift; |
|
195
|
|
|
|
|
|
|
my $args = shift; |
|
196
|
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
my $sort = sub {$a cmp $b}; |
|
198
|
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
if (ref($args->{sort}) eq "CODE") { |
|
200
|
|
|
|
|
|
|
$sort = $args->{sort}; |
|
201
|
|
|
|
|
|
|
} |
|
202
|
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
# use Data::Denter; |
|
204
|
|
|
|
|
|
|
# print Indent(&group_by_tag($args->{posts},$sort)); |
|
205
|
|
|
|
|
|
|
# exit; |
|
206
|
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
# |
|
208
|
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
$self->start_document($args->{title}); |
|
210
|
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
$self->tags(&group_by_tag($args->{posts},$sort),$sort); |
|
212
|
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
$self->end_document(); |
|
214
|
|
|
|
|
|
|
return 1; |
|
215
|
|
|
|
|
|
|
} |
|
216
|
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
sub tags { |
|
218
|
|
|
|
|
|
|
my $self = shift; |
|
219
|
|
|
|
|
|
|
my $dict = shift; |
|
220
|
|
|
|
|
|
|
my $sort = shift; |
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
foreach my $tag (sort $sort keys %$dict) { |
|
223
|
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
$self->start_folder($tag); |
|
225
|
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
my $item = $dict->{$tag}; |
|
227
|
|
|
|
|
|
|
my $ref = ref($item); |
|
228
|
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
if ($ref eq "ARRAY") { |
|
230
|
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
map { |
|
232
|
|
|
|
|
|
|
if (ref($_) eq "Net::Delicious::Post") { |
|
233
|
|
|
|
|
|
|
$self->bookmark($_); |
|
234
|
|
|
|
|
|
|
} |
|
235
|
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
elsif (ref($_) eq "Net::Delicious::Export::Post::Bookmarkid") { |
|
237
|
|
|
|
|
|
|
$self->alias($_); |
|
238
|
|
|
|
|
|
|
} |
|
239
|
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
else {} |
|
241
|
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
} @$item; |
|
243
|
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
} |
|
245
|
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
elsif ($ref eq "HASH") { |
|
247
|
|
|
|
|
|
|
$self->tags($item,$sort); |
|
248
|
|
|
|
|
|
|
} |
|
249
|
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
else {} |
|
251
|
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
$self->end_folder(); |
|
253
|
|
|
|
|
|
|
} |
|
254
|
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
return 1; |
|
256
|
|
|
|
|
|
|
} |
|
257
|
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
sub start_folder { |
|
259
|
|
|
|
|
|
|
my $self = shift; |
|
260
|
|
|
|
|
|
|
my $title = shift; |
|
261
|
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
$self->start_element({Name => "folder", |
|
263
|
|
|
|
|
|
|
Attributes => {"{}id" => {Name => "id", |
|
264
|
|
|
|
|
|
|
LocalName => "id", |
|
265
|
|
|
|
|
|
|
Prefix => "", |
|
266
|
|
|
|
|
|
|
NamespaceURI => "", |
|
267
|
|
|
|
|
|
|
Value => $self->_folderid($title)},}}); |
|
268
|
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
$self->start_element({Name => "title"}); |
|
270
|
|
|
|
|
|
|
$self->characters({Data=>$title}); |
|
271
|
|
|
|
|
|
|
$self->end_element({Name => "title"}); |
|
272
|
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
return 1; |
|
274
|
|
|
|
|
|
|
} |
|
275
|
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
sub end_folder { |
|
277
|
|
|
|
|
|
|
my $self = shift; |
|
278
|
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
$self->end_element({Name => "folder"}); |
|
280
|
|
|
|
|
|
|
return 1; |
|
281
|
|
|
|
|
|
|
} |
|
282
|
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
sub bookmark { |
|
284
|
|
|
|
|
|
|
my $self = shift; |
|
285
|
|
|
|
|
|
|
my $bm = shift; |
|
286
|
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
$self->start_element({Name => "bookmark", |
|
288
|
|
|
|
|
|
|
Attributes => { "{}id" => {Name => "id", |
|
289
|
|
|
|
|
|
|
LocalName => "id", |
|
290
|
|
|
|
|
|
|
Prefix => "", |
|
291
|
|
|
|
|
|
|
NamespaceURI => "", |
|
292
|
|
|
|
|
|
|
Value => &mk_bookmarkid($bm)}, |
|
293
|
|
|
|
|
|
|
"{}href" => {Name => "href", |
|
294
|
|
|
|
|
|
|
LocalName => "href", |
|
295
|
|
|
|
|
|
|
Prefix => "", |
|
296
|
|
|
|
|
|
|
NamespaceURI => "", |
|
297
|
|
|
|
|
|
|
Value => $bm->href() } , |
|
298
|
|
|
|
|
|
|
"{}visited" => {Name => "visited", |
|
299
|
|
|
|
|
|
|
LocalName => "visited", |
|
300
|
|
|
|
|
|
|
Prefix => "", |
|
301
|
|
|
|
|
|
|
NamespaceURI => "", |
|
302
|
|
|
|
|
|
|
Value => $bm->time() } }}); |
|
303
|
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
if (my $txt = $bm->description()) { |
|
305
|
|
|
|
|
|
|
$self->start_element({Name => "title"}); |
|
306
|
|
|
|
|
|
|
$self->characters({Data=> $txt}); |
|
307
|
|
|
|
|
|
|
$self->end_element({Name => "title"}); |
|
308
|
|
|
|
|
|
|
} |
|
309
|
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
if (my $txt = $bm->extended()) { |
|
311
|
|
|
|
|
|
|
$self->start_element({Name => "desc"}); |
|
312
|
|
|
|
|
|
|
$self->characters({Data=> $txt}); |
|
313
|
|
|
|
|
|
|
$self->end_element({Name => "desc"}); |
|
314
|
|
|
|
|
|
|
} |
|
315
|
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
$self->end_element({Name => "bookmark"}); |
|
317
|
|
|
|
|
|
|
return 1; |
|
318
|
|
|
|
|
|
|
} |
|
319
|
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
sub alias { |
|
321
|
|
|
|
|
|
|
my $self = shift; |
|
322
|
|
|
|
|
|
|
my $ref = shift; |
|
323
|
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
$self->start_element({Name => "alias", |
|
325
|
|
|
|
|
|
|
Attributes => { "{}ref" => {Name => "ref", |
|
326
|
|
|
|
|
|
|
LocalName => "ref", |
|
327
|
|
|
|
|
|
|
Prefix => "", |
|
328
|
|
|
|
|
|
|
NamespaceURI => "", |
|
329
|
|
|
|
|
|
|
Value => $ref}}}); |
|
330
|
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
$self->end_element({Name => "alias"}); |
|
332
|
|
|
|
|
|
|
return 1; |
|
333
|
|
|
|
|
|
|
} |
|
334
|
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
sub start_document { |
|
337
|
|
|
|
|
|
|
my $self = shift; |
|
338
|
|
|
|
|
|
|
my $title = shift; |
|
339
|
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
$title ||= "del.icio.us posts"; |
|
341
|
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
$self->SUPER::start_document(); |
|
343
|
|
|
|
|
|
|
$self->SUPER::xml_decl({Version=>"1.0",Encoding=>"UTF-8"}); |
|
344
|
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
$self->start_element({Name => "xbel"}); |
|
346
|
|
|
|
|
|
|
$self->start_element({Name => "title"}); |
|
347
|
|
|
|
|
|
|
$self->characters({Data=>$title}); |
|
348
|
|
|
|
|
|
|
$self->end_element({Name => "title"}); |
|
349
|
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
$self->start_element({Name => "desc"}); |
|
351
|
|
|
|
|
|
|
$self->characters({Data=>"Created by ".__PACKAGE__.", $VERSION"}); |
|
352
|
|
|
|
|
|
|
$self->end_element({Name => "desc"}); |
|
353
|
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
return 1; |
|
355
|
|
|
|
|
|
|
} |
|
356
|
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
sub end_document { |
|
358
|
|
|
|
|
|
|
my $self = shift; |
|
359
|
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
# |
|
361
|
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
$self->end_element({Name => "xbel"}); |
|
363
|
|
|
|
|
|
|
$self->SUPER::end_document(); |
|
364
|
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
return 1; |
|
366
|
|
|
|
|
|
|
} |
|
367
|
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
sub _folderid { |
|
369
|
|
|
|
|
|
|
my $self = shift; |
|
370
|
|
|
|
|
|
|
my $title = shift; |
|
371
|
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
if (! $self->_hasfolderid($title)) { |
|
373
|
|
|
|
|
|
|
push @{$self->{"__folders"}}, $title; |
|
374
|
|
|
|
|
|
|
return $title; |
|
375
|
|
|
|
|
|
|
} |
|
376
|
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
$self->_folderid(join(":","GENID",&random_string("ccccccccccccc"))); |
|
378
|
|
|
|
|
|
|
} |
|
379
|
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
sub _hasfolderid { |
|
381
|
|
|
|
|
|
|
my $self = shift; |
|
382
|
|
|
|
|
|
|
my $id = shift; |
|
383
|
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
foreach (@{$self->{"__folders"}}) { |
|
385
|
|
|
|
|
|
|
if ($_ =~ /^($id)$/) { |
|
386
|
|
|
|
|
|
|
return 1; |
|
387
|
|
|
|
|
|
|
} |
|
388
|
|
|
|
|
|
|
} |
|
389
|
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
return 0; |
|
391
|
|
|
|
|
|
|
} |
|
392
|
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
=head1 VERSION |
|
394
|
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
1.4 |
|
396
|
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
=head1 DATE |
|
398
|
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
$Date: 2005/12/11 19:17:00 $ |
|
400
|
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
=head1 AUTHOR |
|
402
|
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
Aaron Straup Cope |
|
404
|
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
=head1 SEE AlSO |
|
406
|
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
L |
|
408
|
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
L |
|
410
|
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
http://pyxml.sourceforge.net/topics/xbel/ |
|
412
|
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
=head1 LICENSE |
|
414
|
|
|
|
|
|
|
|
|
415
|
|
|
|
|
|
|
Copyright (c) 2004 Aaron Straup Cope. All Rights Reserved. |
|
416
|
|
|
|
|
|
|
|
|
417
|
|
|
|
|
|
|
This is free software, you may use it and distribute it under the |
|
418
|
|
|
|
|
|
|
same terms as Perl itself. |
|
419
|
|
|
|
|
|
|
|
|
420
|
|
|
|
|
|
|
=cut |
|
421
|
|
|
|
|
|
|
|
|
422
|
|
|
|
|
|
|
return 1; |