| 1 | package XML::RSS::Private::Output::Base; | ||
| 2 | $XML::RSS::Private::Output::Base::VERSION = '1.62'; | ||
| 3 | 6 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 6 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 6 | ▶ | use Carp qw/ confess /; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 6 | ▶ | use HTML::Entities qw(encode_entities_numeric encode_entities); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 6 | ▶ | use DateTime::Format::Mail (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | 6 | ▶ | use DateTime::Format::W3CDTF (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 6 | ▶ | use XML::RSS (); |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 13 | |||
| 14 | sub new { | ||
| 15 | my $class = shift; | ||
| 16 | |||
| 17 | my $self = {}; | ||
| 18 | |||
| 19 | bless $self, $class; | ||
| 20 | |||
| 21 | $self->_initialize(@_); | ||
| 22 | |||
| 23 | return $self; | ||
| 24 | } | ||
| 25 | |||
| 26 | # _main() is a reference to the main XML::RSS module | ||
| 27 | sub _main { | ||
| 28 | my $self = shift; | ||
| 29 | |||
| 30 | if (@_) { | ||
| 31 | $self->{_main} = shift; | ||
| 32 | } | ||
| 33 | |||
| 34 | return $self->{_main}; | ||
| 35 | } | ||
| 36 | |||
| 37 | sub _encode_cb { | ||
| 38 | my $self = shift; | ||
| 39 | |||
| 40 | if (@_) { | ||
| 41 | $self->{_encode_cb} = shift; | ||
| 42 | } | ||
| 43 | |||
| 44 | return $self->{_encode_cb}; | ||
| 45 | } | ||
| 46 | |||
| 47 | sub _item_idx { | ||
| 48 | my $self = shift; | ||
| 49 | |||
| 50 | if (@_) { | ||
| 51 | $self->{_item_idx} = shift; | ||
| 52 | } | ||
| 53 | |||
| 54 | return $self->{_item_idx}; | ||
| 55 | } | ||
| 56 | |||
| 57 | sub _initialize { | ||
| 58 | my $self = shift; | ||
| 59 | my $args = shift; | ||
| 60 | |||
| 61 | $self->{_output} = ""; | ||
| 62 | $self->_main($args->{main}); | ||
| 63 | |||
| 64 | # TODO : Remove once we have inheritance proper. | ||
| 65 | $self->_rss_out_version($args->{version}); | ||
| 66 | if (defined($args->{encode_cb})) { | ||
| 67 | $self->_encode_cb($args->{encode_cb}); | ||
| 68 | } | ||
| 69 | else { | ||
| 70 | $self->_encode_cb(\&_default_encode); | ||
| 71 | } | ||
| 72 | |||
| 73 | $self->_item_idx(-1); | ||
| 74 | |||
| 75 | return 0; | ||
| 76 | } | ||
| 77 | |||
| 78 | sub _rss_out_version { | ||
| 79 | my $self = shift; | ||
| 80 | |||
| 81 | if (@_) { | ||
| 82 | $self->{_rss_out_version} = shift; | ||
| 83 | } | ||
| 84 | return $self->{_rss_out_version}; | ||
| 85 | } | ||
| 86 | |||
| 87 | sub _encode { | ||
| 88 | my ($self, $text) = @_; | ||
| 89 | return $self->_encode_cb()->($self, $text); | ||
| 90 | } | ||
| 91 | |||
| 92 | sub _default_encode { | ||
| 93 | my ($self, $text) = @_; | ||
| 94 | |||
| 95 | #return "" unless defined $text; | ||
| 96 | if (!defined($text)) { | ||
| 97 | confess "\$text is undefined in XML::RSS::_encode(). We don't know how " . "to handle it!"; | ||
| 98 | } | ||
| 99 | |||
| 100 | return $text if (!$self->_main->_encode_output); | ||
| 101 | |||
| 102 | my $encoded_text = ''; | ||
| 103 | |||
| 104 | while ($text =~ s/(.*?)(\<\!\[CDATA\[.*?\]\]\>)//s) { | ||
| 105 | |||
| 106 | # we use &named; entities here because it's HTML | ||
| 107 | $encoded_text .= encode_entities($1) . $2; | ||
| 108 | } | ||
| 109 | |||
| 110 | # we use numeric entities here because it's XML | ||
| 111 | $encoded_text .= encode_entities_numeric($text); | ||
| 112 | |||
| 113 | return $encoded_text; | ||
| 114 | } | ||
| 115 | |||
| 116 | sub _out { | ||
| 117 | my ($self, $string) = @_; | ||
| 118 | $self->{_output} .= $string; | ||
| 119 | return; | ||
| 120 | } | ||
| 121 | |||
| 122 | sub _out_tag { | ||
| 123 | my ($self, $tag, $inner) = @_; | ||
| 124 | my $content = $inner; | ||
| 125 | my $attr = ""; | ||
| 126 | if (ref($inner) eq 'HASH') { | ||
| 127 | my %inner_copy = %$inner; | ||
| 128 | $content = delete $inner_copy{content}; | ||
| 129 | foreach my $key (keys %inner_copy) { | ||
| 130 | my $value = $inner->{$key}; | ||
| 131 | if (defined($value)) { | ||
| 132 | $attr .= " " . $self->_encode($key) . qq{="} . $self->_encode($value) . '"'; | ||
| 133 | } | ||
| 134 | } | ||
| 135 | } | ||
| 136 | return $self->_out("<$tag$attr>" . $self->_encode($content) . "</$tag>\n"); | ||
| 137 | } | ||
| 138 | |||
| 139 | # Remove non-alphanumeric elements and return the modified string. | ||
| 140 | # Useful for user-specified tags' attributes. | ||
| 141 | |||
| 142 | sub _sanitize { | ||
| 143 | my ($self, $string) = @_; | ||
| 144 | |||
| 145 | $string =~ s{[^a-zA-Z_\-0-9]}{}g; | ||
| 146 | return $string; | ||
| 147 | } | ||
| 148 | |||
| 149 | sub _out_ns_tag { | ||
| 150 | my ($self, $prefix, $tag, $inner) = @_; | ||
| 151 | |||
| 152 | my @subtags; | ||
| 153 | |||
| 154 | if (ref($inner) eq "HASH") { | ||
| 155 | $self->_out("<${prefix}:${tag}"); | ||
| 156 | foreach my $attr (sort { $a cmp $b } keys(%{$inner})) { | ||
| 157 | if (ref($inner->{$attr}) eq '') { | ||
| 158 | $self->_out(q{ } | ||
| 159 | . $self->_sanitize($attr) . q{="} | ||
| 160 | . $self->_encode($inner->{$attr}) | ||
| 161 | . q{"}); | ||
| 162 | } | ||
| 163 | else { | ||
| 164 | push(@subtags, $attr); | ||
| 165 | } | ||
| 166 | } | ||
| 167 | |||
| 168 | if (!@subtags) { | ||
| 169 | $self->_out("/>\n"); | ||
| 170 | } | ||
| 171 | else { | ||
| 172 | $self->_out(">\n"); | ||
| 173 | |||
| 174 | foreach my $attr (sort { $a cmp $b } @subtags) { | ||
| 175 | if (ref($inner->{$attr})) { | ||
| 176 | _out_ns_tag($self, $prefix, $tag, $inner->{$attr}); | ||
| 177 | } | ||
| 178 | } | ||
| 179 | |||
| 180 | $self->_out("</${prefix}:${tag}>\n"); | ||
| 181 | } | ||
| 182 | } | ||
| 183 | elsif (ref($inner) eq 'ARRAY') { | ||
| 184 | map { $self->_out_ns_tag($prefix, $tag, $_) } @{$inner}; | ||
| 185 | } | ||
| 186 | else { | ||
| 187 | return $self->_out_tag("${prefix}:${tag}", $inner); | ||
| 188 | } | ||
| 189 | } | ||
| 190 | |||
| 191 | sub _out_defined_tag { | ||
| 192 | my ($self, $tag, $inner) = @_; | ||
| 193 | |||
| 194 | if (defined($inner)) { | ||
| 195 | $self->_out_tag($tag, $inner); | ||
| 196 | } | ||
| 197 | |||
| 198 | return; | ||
| 199 | } | ||
| 200 | |||
| 201 | sub _out_array_tag { | ||
| 202 | my ($self, $tag, $inner) = @_; | ||
| 203 | |||
| 204 | if (ref($inner) eq "ARRAY") { | ||
| 205 | foreach my $elem (@$inner) { | ||
| 206 | $self->_out_defined_tag($tag, $elem); | ||
| 207 | } | ||
| 208 | } | ||
| 209 | else { | ||
| 210 | $self->_out_defined_tag($tag, $inner); | ||
| 211 | } | ||
| 212 | |||
| 213 | return; | ||
| 214 | } | ||
| 215 | |||
| 216 | sub _out_inner_tag { | ||
| 217 | my ($self, $params, $tag) = @_; | ||
| 218 | |||
| 219 | if (ref($params) eq "") { | ||
| 220 | $params = {'ext' => $params, 'defined' => 0,}; | ||
| 221 | } | ||
| 222 | |||
| 223 | my $ext_tag = $params->{ext}; | ||
| 224 | |||
| 225 | if (ref($ext_tag) eq "") { | ||
| 226 | $ext_tag = $self->$ext_tag(); | ||
| 227 | } | ||
| 228 | |||
| 229 | my $value = $ext_tag->{$tag}; | ||
| 230 | |||
| 231 | if ($params->{defined} ? defined($value) : 1) { | ||
| 232 | $self->_out_tag($tag, $value); | ||
| 233 | } | ||
| 234 | |||
| 235 | return; | ||
| 236 | } | ||
| 237 | |||
| 238 | sub _output_item_tag { | ||
| 239 | my ($self, $item, $tag) = @_; | ||
| 240 | |||
| 241 | return $self->_out_tag($tag, $item->{$tag}); | ||
| 242 | } | ||
| 243 | |||
| 244 | sub _output_def_image_tag { | ||
| 245 | my ($self, $tag) = @_; | ||
| 246 | |||
| 247 | return $self->_out_inner_tag({ext => "image", 'defined' => 1}, $tag); | ||
| 248 | } | ||
| 249 | |||
| 250 | sub _output_multiple_tags { | ||
| 251 | my ($self, $ext_tag, $tags_ref) = @_; | ||
| 252 | |||
| 253 | foreach my $tag (@$tags_ref) { | ||
| 254 | $self->_out_inner_tag($ext_tag, $tag); | ||
| 255 | } | ||
| 256 | |||
| 257 | return; | ||
| 258 | } | ||
| 259 | |||
| 260 | sub _output_common_textinput_sub_elements { | ||
| 261 | my $self = shift; | ||
| 262 | |||
| 263 | $self->_output_multiple_tags("textinput", [qw(title description name link)],); | ||
| 264 | } | ||
| 265 | |||
| 266 | |||
| 267 | sub _get_top_elem_about { | ||
| 268 | return ""; | ||
| 269 | } | ||
| 270 | |||
| 271 | sub _start_top_elem { | ||
| 272 | my ($self, $tag, $about_sub) = @_; | ||
| 273 | |||
| 274 | my $about = $self->_get_top_elem_about($tag, $about_sub); | ||
| 275 | |||
| 276 | return $self->_out("<$tag$about>\n"); | ||
| 277 | } | ||
| 278 | |||
| 279 | sub _out_textinput_rss_1_0_elems { | ||
| 280 | } | ||
| 281 | |||
| 282 | sub _get_textinput_tag { | ||
| 283 | return "textinput"; | ||
| 284 | } | ||
| 285 | |||
| 286 | sub _output_complete_textinput { | ||
| 287 | my $self = shift; | ||
| 288 | |||
| 289 | my $master_tag = $self->_get_textinput_tag(); | ||
| 290 | |||
| 291 | if (defined(my $link = $self->textinput('link'))) { | ||
| 292 | $self->_start_top_elem($master_tag, sub {$link}); | ||
| 293 | |||
| 294 | $self->_output_common_textinput_sub_elements(); | ||
| 295 | |||
| 296 | $self->_out_textinput_rss_1_0_elems(); | ||
| 297 | |||
| 298 | $self->_end_top_level_elem($master_tag); | ||
| 299 | } | ||
| 300 | |||
| 301 | return; | ||
| 302 | } | ||
| 303 | |||
| 304 | sub _flush_output { | ||
| 305 | my $self = shift; | ||
| 306 | |||
| 307 | my $ret = $self->{_output}; | ||
| 308 | $self->{_output} = ""; | ||
| 309 | |||
| 310 | # Detach _main to avoid referencing loops. | ||
| 311 | $self->_main(undef); | ||
| 312 | |||
| 313 | return $ret; | ||
| 314 | } | ||
| 315 | |||
| 316 | |||
| 317 | sub _date_from_dc_date { | ||
| 318 | my ($self, $string) = @_; | ||
| 319 | my $f = DateTime::Format::W3CDTF->new(); | ||
| 320 | return $f->parse_datetime($string); | ||
| 321 | } | ||
| 322 | |||
| 323 | sub _date_from_rss2 { | ||
| 324 | my ($self, $string) = @_; | ||
| 325 | my $f = DateTime::Format::Mail->new(); | ||
| 326 | return $f->parse_datetime($string); | ||
| 327 | } | ||
| 328 | |||
| 329 | sub _date_to_rss2 { | ||
| 330 | my ($self, $date) = @_; | ||
| 331 | |||
| 332 | my $pf = DateTime::Format::Mail->new(); | ||
| 333 | return $pf->format_datetime($date); | ||
| 334 | } | ||
| 335 | |||
| 336 | sub _date_to_dc_date { | ||
| 337 | my ($self, $date) = @_; | ||
| 338 | |||
| 339 | my $pf = DateTime::Format::W3CDTF->new(); | ||
| 340 | return $pf->format_datetime($date); | ||
| 341 | } | ||
| 342 | |||
| 343 | sub _channel_dc { | ||
| 344 | my ($self, $key) = @_; | ||
| 345 | |||
| 346 | if ($self->channel('dc')) { | ||
| 347 | return $self->channel('dc')->{$key}; | ||
| 348 | } | ||
| 349 | else { | ||
| 350 | return undef; | ||
| 351 | } | ||
| 352 | } | ||
| 353 | |||
| 354 | sub _channel_syn { | ||
| 355 | my ($self, $key) = @_; | ||
| 356 | |||
| 357 | if ($self->channel('syn')) { | ||
| 358 | return $self->channel('syn')->{$key}; | ||
| 359 | } | ||
| 360 | else { | ||
| 361 | return undef; | ||
| 362 | } | ||
| 363 | } | ||
| 364 | |||
| 365 | sub _calc_lastBuildDate { | ||
| 366 | my $self = shift; | ||
| 367 | if (defined(my $d = $self->_channel_dc('date'))) { | ||
| 368 | return $self->_date_to_rss2($self->_date_from_dc_date($d)); | ||
| 369 | } | ||
| 370 | else { | ||
| 371 | # If lastBuildDate is undef we can still return it because we | ||
| 372 | # need to return undef. | ||
| 373 | return $self->channel("lastBuildDate"); | ||
| 374 | } | ||
| 375 | } | ||
| 376 | |||
| 377 | sub _calc_pubDate { | ||
| 378 | my $self = shift; | ||
| 379 | |||
| 380 | if (defined(my $d = $self->channel('pubDate'))) { | ||
| 381 | return $d; | ||
| 382 | } | ||
| 383 | elsif (defined(my $d2 = $self->_channel_dc('date'))) { | ||
| 384 | return $self->_date_to_rss2($self->_date_from_dc_date($d2)); | ||
| 385 | } | ||
| 386 | else { | ||
| 387 | return undef; | ||
| 388 | } | ||
| 389 | } | ||
| 390 | |||
| 391 | sub _get_other_dc_date { | ||
| 392 | my $self = shift; | ||
| 393 | |||
| 394 | if (defined(my $d1 = $self->channel('pubDate'))) { | ||
| 395 | return $d1; | ||
| 396 | } | ||
| 397 | elsif (defined(my $d2 = $self->channel('lastBuildDate'))) { | ||
| 398 | return $d2; | ||
| 399 | } | ||
| 400 | else { | ||
| 401 | return undef; | ||
| 402 | } | ||
| 403 | } | ||
| 404 | |||
| 405 | sub _calc_dc_date { | ||
| 406 | my $self = shift; | ||
| 407 | |||
| 408 | if (defined(my $d1 = $self->_channel_dc('date'))) { | ||
| 409 | return $d1; | ||
| 410 | } | ||
| 411 | else { | ||
| 412 | my $date = $self->_get_other_dc_date(); | ||
| 413 | |||
| 414 | if (!defined($date)) { | ||
| 415 | return undef; | ||
| 416 | } | ||
| 417 | else { | ||
| 418 | return $self->_date_to_dc_date($self->_date_from_rss2($date)); | ||
| 419 | } | ||
| 420 | } | ||
| 421 | } | ||
| 422 | |||
| 423 | sub _output_xml_declaration { | ||
| 424 | my $self = shift; | ||
| 425 | |||
| 426 | my $encoding = | ||
| 427 | (defined $self->_main->_encoding()) ? ' encoding="' . $self->_main->_encoding() . '"' : ""; | ||
| 428 | $self->_out('<?xml version="1.0"' . $encoding . '?>' . "\n"); | ||
| 429 | if (defined(my $stylesheet = $self->_main->_stylesheet)) { | ||
| 430 | my $style_url = $self->_encode($stylesheet); | ||
| 431 | $self->_out(qq{<?xml-stylesheet type="text/xsl" href="$style_url"?>\n}); | ||
| 432 | } | ||
| 433 | |||
| 434 | $self->_out("\n"); | ||
| 435 | |||
| 436 | return undef; | ||
| 437 | } | ||
| 438 | |||
| 439 | sub _out_image_title_and_url { | ||
| 440 | my $self = shift; | ||
| 441 | |||
| 442 | return $self->_output_multiple_tags({ext => "image"}, [qw(title url)]); | ||
| 443 | } | ||
| 444 | |||
| 445 | sub _start_image { | ||
| 446 | my $self = shift; | ||
| 447 | |||
| 448 | $self->_start_top_elem("image", sub { $self->image('url') }); | ||
| 449 | |||
| 450 | $self->_out_image_title_and_url(); | ||
| 451 | |||
| 452 | $self->_output_def_image_tag("link"); | ||
| 453 | |||
| 454 | return; | ||
| 455 | } | ||
| 456 | |||
| 457 | sub _start_item { | ||
| 458 | my ($self, $item) = @_; | ||
| 459 | |||
| 460 | my $tag = "item"; | ||
| 461 | my $base = $item->{'xml:base'}; | ||
| 462 | $tag .= qq{ xml:base="$base"} if defined $base; | ||
| 463 | $self->_start_top_elem($tag, sub { $self->_get_item_about($item) }); | ||
| 464 | |||
| 465 | $self->_output_common_item_tags($item); | ||
| 466 | |||
| 467 | return; | ||
| 468 | } | ||
| 469 | |||
| 470 | sub _end_top_level_elem { | ||
| 471 | my ($self, $elem) = @_; | ||
| 472 | |||
| 473 | $self->_out("</$elem>\n"); | ||
| 474 | } | ||
| 475 | |||
| 476 | sub _end_item { | ||
| 477 | shift->_end_top_level_elem("item"); | ||
| 478 | } | ||
| 479 | |||
| 480 | sub _end_image { | ||
| 481 | shift->_end_top_level_elem("image"); | ||
| 482 | } | ||
| 483 | |||
| 484 | sub _end_channel { | ||
| 485 | shift->_end_top_level_elem("channel"); | ||
| 486 | } | ||
| 487 | |||
| 488 | sub _output_array_item_tag { | ||
| 489 | my ($self, $item, $tag) = @_; | ||
| 490 | |||
| 491 | if (defined($item->{$tag})) { | ||
| 492 | $self->_out_array_tag($tag, $item->{$tag}); | ||
| 493 | } | ||
| 494 | |||
| 495 | return; | ||
| 496 | } | ||
| 497 | |||
| 498 | sub _output_def_item_tag { | ||
| 499 | my ($self, $item, $tag) = @_; | ||
| 500 | |||
| 501 | if (defined($item->{$tag})) { | ||
| 502 | $self->_output_item_tag($item, $tag); | ||
| 503 | } | ||
| 504 | |||
| 505 | return; | ||
| 506 | } | ||
| 507 | |||
| 508 | sub _get_item_defined { | ||
| 509 | return 0; | ||
| 510 | } | ||
| 511 | |||
| 512 | sub _out_item_desc { | ||
| 513 | my ($self, $item) = @_; | ||
| 514 | return $self->_output_def_item_tag($item, "description"); | ||
| 515 | } | ||
| 516 | |||
| 517 | # Outputs the common item tags for RSS 0.9.1 and above. | ||
| 518 | sub _output_common_item_tags { | ||
| 519 | my ($self, $item) = @_; | ||
| 520 | |||
| 521 | my @fields = (qw( title link )); | ||
| 522 | |||
| 523 | my $defined = $self->_get_item_defined; | ||
| 524 | |||
| 525 | if (!$defined) { | ||
| 526 | foreach my $f (@fields) { | ||
| 527 | if (!defined($item->{$f})) { | ||
| 528 | die qq/Item No. / . $self->_item_idx() . qq/ is missing the "$f" field./; | ||
| 529 | } | ||
| 530 | } | ||
| 531 | } | ||
| 532 | |||
| 533 | $self->_output_multiple_tags( | ||
| 534 | {ext => $item, type => 'item', idx => $self->_item_idx(), 'defined' => $defined,}, | ||
| 535 | [@fields],); | ||
| 536 | |||
| 537 | $self->_out_item_desc($item); | ||
| 538 | |||
| 539 | return; | ||
| 540 | } | ||
| 541 | |||
| 542 | sub _output_common_channel_elements { | ||
| 543 | my $self = shift; | ||
| 544 | |||
| 545 | $self->_output_multiple_tags("channel", [qw(title link description)],); | ||
| 546 | } | ||
| 547 | |||
| 548 | |||
| 549 | sub _out_language { | ||
| 550 | my $self = shift; | ||
| 551 | |||
| 552 | return $self->_out_channel_self_dc_field("language"); | ||
| 553 | } | ||
| 554 | |||
| 555 | sub _start_channel { | ||
| 556 | my $self = shift; | ||
| 557 | |||
| 558 | $self->_start_top_elem("channel", sub { $self->_get_channel_rdf_about }); | ||
| 559 | |||
| 560 | $self->_output_common_channel_elements(); | ||
| 561 | |||
| 562 | $self->_out_language(); | ||
| 563 | |||
| 564 | return; | ||
| 565 | } | ||
| 566 | |||
| 567 | # Calculates a channel field that has a dc: and non-dc alternative, | ||
| 568 | # prefering the dc: one. | ||
| 569 | sub _calc_channel_dc_field { | ||
| 570 | my ($self, $dc_key, $non_dc_key) = @_; | ||
| 571 | |||
| 572 | my $dc_value = $self->_channel_dc($dc_key); | ||
| 573 | |||
| 574 | return defined($dc_value) ? $dc_value : $self->channel($non_dc_key); | ||
| 575 | } | ||
| 576 | |||
| 577 | sub _prefer_dc { | ||
| 578 | my $self = shift; | ||
| 579 | |||
| 580 | if (@_) { | ||
| 581 | $self->{_prefer_dc} = shift; | ||
| 582 | } | ||
| 583 | return $self->{_prefer_dc}; | ||
| 584 | } | ||
| 585 | |||
| 586 | sub _calc_channel_dc_field_params { | ||
| 587 | my ($self, $dc_key, $non_dc_key) = @_; | ||
| 588 | |||
| 589 | return ( | ||
| 590 | $self->_prefer_dc() ? "dc:$dc_key" : $non_dc_key, | ||
| 591 | $self->_calc_channel_dc_field($dc_key, $non_dc_key) | ||
| 592 | ); | ||
| 593 | } | ||
| 594 | |||
| 595 | sub _out_channel_dc_field { | ||
| 596 | my ($self, $dc_key, $non_dc_key) = @_; | ||
| 597 | |||
| 598 | return $self->_out_defined_tag($self->_calc_channel_dc_field_params($dc_key, $non_dc_key),); | ||
| 599 | } | ||
| 600 | |||
| 601 | sub _out_channel_array_self_dc_field { | ||
| 602 | my ($self, $key) = @_; | ||
| 603 | |||
| 604 | $self->_out_array_tag($self->_calc_channel_dc_field_params($key, $key),); | ||
| 605 | } | ||
| 606 | |||
| 607 | sub _out_channel_self_dc_field { | ||
| 608 | my ($self, $key) = @_; | ||
| 609 | |||
| 610 | return $self->_out_channel_dc_field($key, $key); | ||
| 611 | } | ||
| 612 | |||
| 613 | sub _out_managing_editor { | ||
| 614 | my $self = shift; | ||
| 615 | |||
| 616 | return $self->_out_channel_dc_field("publisher", "managingEditor"); | ||
| 617 | } | ||
| 618 | |||
| 619 | sub _out_webmaster { | ||
| 620 | my $self = shift; | ||
| 621 | |||
| 622 | return $self->_out_channel_dc_field("creator", "webMaster"); | ||
| 623 | } | ||
| 624 | |||
| 625 | sub _out_copyright { | ||
| 626 | my $self = shift; | ||
| 627 | |||
| 628 | return $self->_out_channel_dc_field("rights", "copyright"); | ||
| 629 | } | ||
| 630 | |||
| 631 | sub _out_editors { | ||
| 632 | my $self = shift; | ||
| 633 | |||
| 634 | $self->_out_managing_editor; | ||
| 635 | $self->_out_webmaster; | ||
| 636 | } | ||
| 637 | |||
| 638 | sub _get_channel_rdf_about { | ||
| 639 | my $self = shift; | ||
| 640 | |||
| 641 | if (defined(my $about = $self->channel('about'))) { | ||
| 642 | return $about; | ||
| 643 | } | ||
| 644 | else { | ||
| 645 | return $self->channel('link'); | ||
| 646 | } | ||
| 647 | } | ||
| 648 | |||
| 649 | sub _output_taxo_topics { | ||
| 650 | my ($self, $elem) = @_; | ||
| 651 | |||
| 652 | if (my $list = $elem->{'taxo'}) { | ||
| 653 | $self->_out("<taxo:topics>\n <rdf:Bag>\n"); | ||
| 654 | foreach my $taxo (@{$list}) { | ||
| 655 | $self->_out(" <rdf:li resource=\"" . $self->_encode($taxo) . "\" />\n"); | ||
| 656 | } | ||
| 657 | $self->_out(" </rdf:Bag>\n</taxo:topics>\n"); | ||
| 658 | } | ||
| 659 | |||
| 660 | return; | ||
| 661 | } | ||
| 662 | |||
| 663 | # Output the Dublin core properties of a certain elements (channel, image, | ||
| 664 | # textinput, item). | ||
| 665 | |||
| 666 | sub _get_dc_ok_fields { | ||
| 667 | my $self = shift; | ||
| 668 | |||
| 669 | return $self->_main->_get_dc_ok_fields(); | ||
| 670 | } | ||
| 671 | |||
| 672 | sub _out_dc_elements { | ||
| 673 | my $self = shift; | ||
| 674 | my $elem = shift; | ||
| 675 | my $skip_hash = shift || {}; | ||
| 676 | |||
| 677 | foreach my $dc (@{$self->_get_dc_ok_fields()}) { | ||
| 678 | next if $skip_hash->{$dc}; | ||
| 679 | |||
| 680 | $self->_out_array_tag("dc:$dc", $elem->{dc}->{$dc}); | ||
| 681 | } | ||
| 682 | |||
| 683 | return; | ||
| 684 | } | ||
| 685 | |||
| 686 | sub _out_module_prefix_elements_hash { | ||
| 687 | my ($self, $args) = @_; | ||
| 688 | |||
| 689 | my $prefix = $args->{prefix}; | ||
| 690 | my $data = $args->{data}; | ||
| 691 | my $url = $args->{url}; | ||
| 692 | |||
| 693 | while (my ($el, $value) = each(%$data)) { | ||
| 694 | $self->_out_module_prefix_pair( | ||
| 695 | { %$args, | ||
| 696 | el => $el, | ||
| 697 | val => $value, | ||
| 698 | } | ||
| 699 | ); | ||
| 700 | } | ||
| 701 | |||
| 702 | return; | ||
| 703 | } | ||
| 704 | |||
| 705 | sub _out_module_prefix_pair { | ||
| 706 | my ($self, $args) = @_; | ||
| 707 | |||
| 708 | my $prefix = $args->{prefix}; | ||
| 709 | my $url = $args->{url}; | ||
| 710 | |||
| 711 | my $el = $args->{el}; | ||
| 712 | my $value = $args->{val}; | ||
| 713 | |||
| 714 | if ($self->_main->_is_rdf_resource($el, $url)) { | ||
| 715 | $self->_out(qq{<${prefix}:${el} rdf:resource="} . $self->_encode($value) . qq{" />\n}); | ||
| 716 | } | ||
| 717 | else { | ||
| 718 | $self->_out_ns_tag($prefix, $el, $value); | ||
| 719 | } | ||
| 720 | |||
| 721 | return; | ||
| 722 | } | ||
| 723 | |||
| 724 | sub _out_module_prefix_elements_array { | ||
| 725 | my ($self, $args) = @_; | ||
| 726 | |||
| 727 | my $prefix = $args->{prefix}; | ||
| 728 | my $data = $args->{data}; | ||
| 729 | my $url = $args->{url}; | ||
| 730 | |||
| 731 | foreach my $element (@$data) { | ||
| 732 | $self->_out_module_prefix_pair( | ||
| 733 | { %$args, | ||
| 734 | el => $element->{'el'}, | ||
| 735 | val => $element->{'val'}, | ||
| 736 | } | ||
| 737 | ); | ||
| 738 | } | ||
| 739 | |||
| 740 | return; | ||
| 741 | } | ||
| 742 | |||
| 743 | sub _out_module_prefix_elements { | ||
| 744 | my ($self, $args) = @_; | ||
| 745 | |||
| 746 | my $data = $args->{'data'}; | ||
| 747 | |||
| 748 | if (!$data) { | ||
| 749 | |||
| 750 | # Do nothing - empty data | ||
| 751 | return; | ||
| 752 | } | ||
| 753 | elsif (ref($data) eq "HASH") { | ||
| 754 | return $self->_out_module_prefix_elements_hash($args); | ||
| 755 | } | ||
| 756 | elsif (ref($data) eq "ARRAY") { | ||
| 757 | return $self->_out_module_prefix_elements_array($args); | ||
| 758 | } | ||
| 759 | else { | ||
| 760 | die "Don't know how to handle module data of type " . ref($data) . "!"; | ||
| 761 | } | ||
| 762 | } | ||
| 763 | |||
| 764 | # Output the Ad-hoc modules | ||
| 765 | sub _out_modules_elements { | ||
| 766 | my ($self, $super_elem) = @_; | ||
| 767 | |||
| 768 | # Ad-hoc modules | ||
| 769 | while (my ($url, $prefix) = each %{$self->_modules}) { | ||
| 770 | next if $prefix =~ /^(dc|syn|taxo)$/; | ||
| 771 | |||
| 772 | $self->_out_module_prefix_elements( | ||
| 773 | { prefix => $prefix, | ||
| 774 | url => $url, | ||
| 775 | data => $super_elem->{$prefix}, | ||
| 776 | } | ||
| 777 | ); | ||
| 778 | |||
| 779 | } | ||
| 780 | |||
| 781 | return; | ||
| 782 | } | ||
| 783 | |||
| 784 | sub _out_complete_outer_tag { | ||
| 785 | my ($self, $outer, $inner) = @_; | ||
| 786 | |||
| 787 | my $value = $self->_main->{$outer}->{$inner}; | ||
| 788 | |||
| 789 | if (defined($value)) { | ||
| 790 | $self->_out("<$outer>\n"); | ||
| 791 | $self->_out_array_tag($inner, $value); | ||
| 792 | $self->_end_top_level_elem($outer); | ||
| 793 | } | ||
| 794 | } | ||
| 795 | |||
| 796 | sub _out_skip_tag { | ||
| 797 | my ($self, $what) = @_; | ||
| 798 | |||
| 799 | return $self->_out_complete_outer_tag("skip\u${what}s", $what); | ||
| 800 | } | ||
| 801 | |||
| 802 | sub _out_skip_hours { | ||
| 803 | return shift->_out_skip_tag("hour"); | ||
| 804 | } | ||
| 805 | |||
| 806 | sub _out_skip_days { | ||
| 807 | return shift->_out_skip_tag("day"); | ||
| 808 | } | ||
| 809 | |||
| 810 | sub _get_item_about { | ||
| 811 | my ($self, $item) = @_; | ||
| 812 | return defined($item->{'about'}) ? $item->{'about'} : $item->{'link'}; | ||
| 813 | } | ||
| 814 | |||
| 815 | sub _out_image_dc_elements { | ||
| 816 | } | ||
| 817 | |||
| 818 | sub _out_modules_elements_if_supported { | ||
| 819 | } | ||
| 820 | |||
| 821 | sub _out_image_dims { | ||
| 822 | } | ||
| 823 | |||
| 824 | sub _output_defined_image { | ||
| 825 | my $self = shift; | ||
| 826 | |||
| 827 | $self->_start_image(); | ||
| 828 | |||
| 829 | $self->_out_image_dims; | ||
| 830 | |||
| 831 | # image width | ||
| 832 | #$output .= '<rss091:width>'.$self->{image}->{width}.'</rss091:width>'."\n" | ||
| 833 | # if $self->{image}->{width}; | ||
| 834 | |||
| 835 | # image height | ||
| 836 | #$output .= '<rss091:height>'.$self->{image}->{height}.'</rss091:height>'."\n" | ||
| 837 | # if $self->{image}->{height}; | ||
| 838 | |||
| 839 | # description | ||
| 840 | #$output .= '<rss091:description>'.$self->{image}->{description}.'</rss091:description>'."\n" | ||
| 841 | # if $self->{image}->{description}; | ||
| 842 | |||
| 843 | $self->_out_image_dc_elements; | ||
| 844 | |||
| 845 | $self->_out_modules_elements_if_supported($self->image()); | ||
| 846 | |||
| 847 | $self->_end_image(); | ||
| 848 | } | ||
| 849 | |||
| 850 | sub _is_image_defined { | ||
| 851 | my $self = shift; | ||
| 852 | |||
| 853 | return defined($self->image('url')); | ||
| 854 | } | ||
| 855 | |||
| 856 | sub _output_complete_image { | ||
| 857 | my $self = shift; | ||
| 858 | |||
| 859 | if ($self->_is_image_defined()) { | ||
| 860 | $self->_output_defined_image(); | ||
| 861 | } | ||
| 862 | } | ||
| 863 | |||
| 864 | sub _out_seq_items { | ||
| 865 | my $self = shift; | ||
| 866 | |||
| 867 | # Seq items | ||
| 868 | $self->_out("<items>\n <rdf:Seq>\n"); | ||
| 869 | |||
| 870 | my $idx = 0; | ||
| 871 | foreach my $item (@{$self->_main->_get_items()}) { | ||
| 872 | |||
| 873 | my $about_text = $self->_get_item_about($item); | ||
| 874 | |||
| 875 | if (!defined($about_text)) { | ||
| 876 | die qq/Item No. $idx is missing "about" or "link" fields./; | ||
| 877 | } | ||
| 878 | |||
| 879 | $self->_out(' <rdf:li rdf:resource="' . $self->_encode($about_text) . '" />' . "\n"); | ||
| 880 | } | ||
| 881 | continue { | ||
| 882 | $idx++; | ||
| 883 | } | ||
| 884 | |||
| 885 | $self->_out(" </rdf:Seq>\n</items>\n"); | ||
| 886 | } | ||
| 887 | |||
| 888 | sub _get_first_rdf_decl_mappings { | ||
| 889 | return (); | ||
| 890 | } | ||
| 891 | |||
| 892 | sub _get_rdf_decl_mappings { | ||
| 893 | my $self = shift; | ||
| 894 | |||
| 895 | my $modules = $self->_modules(); | ||
| 896 | |||
| 897 | return [ | ||
| 898 | $self->_get_first_rdf_decl_mappings(), | ||
| 899 | sort { $a->[0] cmp $b->[0] } map { [$modules->{$_}, $_] } keys(%$modules) | ||
| 900 | ]; | ||
| 901 | } | ||
| 902 | |||
| 903 | sub _render_xmlns { | ||
| 904 | my ($self, $prefix, $url) = @_; | ||
| 905 | |||
| 906 | my $pp = defined($prefix) ? ":$prefix" : ""; | ||
| 907 | |||
| 908 | return qq{ xmlns$pp="$url"\n}; | ||
| 909 | } | ||
| 910 | |||
| 911 | sub _get_rdf_xmlnses { | ||
| 912 | my $self = shift; | ||
| 913 | |||
| 914 | return join("", map { $self->_render_xmlns(@$_) } @{$self->_get_rdf_decl_mappings}); | ||
| 915 | } | ||
| 916 | |||
| 917 | sub _get_rdf_decl_open_tag { | ||
| 918 | return qq{<rss version="2.0"\n}; | ||
| 919 | } | ||
| 920 | |||
| 921 | |||
| 922 | sub _get_rdf_decl { | ||
| 923 | my $self = shift; | ||
| 924 | my $base = $self->_main()->{'xml:base'}; | ||
| 925 | my $base_decl = (defined $base) ? qq{ xml:base="$base"\n} : ""; | ||
| 926 | return $self->_get_rdf_decl_open_tag() . $base_decl . $self->_get_rdf_xmlnses() . ">\n\n"; | ||
| 927 | } | ||
| 928 | |||
| 929 | sub _out_rdf_decl { | ||
| 930 | my $self = shift; | ||
| 931 | |||
| 932 | return $self->_out($self->_get_rdf_decl); | ||
| 933 | } | ||
| 934 | |||
| 935 | sub _out_guid { | ||
| 936 | my ($self, $item) = @_; | ||
| 937 | |||
| 938 | # The unique identifier. Use 'permaLink' for an external | ||
| 939 | # identifier, or 'guid' for a internal string. | ||
| 940 | # (I call it permaLink in the hash for purposes of clarity.) | ||
| 941 | |||
| 942 | for my $guid (qw(permaLink guid)) { | ||
| 943 | if (defined $item->{$guid}) { | ||
| 944 | $self->_out('<guid isPermaLink="' | ||
| 945 | . ($guid eq 'permaLink' ? 'true' : 'false') . '">' | ||
| 946 | . $self->_encode($item->{$guid}) | ||
| 947 | . '</guid>' | ||
| 948 | . "\n"); | ||
| 949 | last; | ||
| 950 | } | ||
| 951 | } | ||
| 952 | } | ||
| 953 | |||
| 954 | sub _out_item_source { | ||
| 955 | my ($self, $item) = @_; | ||
| 956 | |||
| 957 | if (defined $item->{source} && defined $item->{sourceUrl}) { | ||
| 958 | $self->_out('<source url="' | ||
| 959 | . $self->_encode($item->{sourceUrl}) . '">' | ||
| 960 | . $self->_encode($item->{source}) | ||
| 961 | . "</source>\n"); | ||
| 962 | } | ||
| 963 | } | ||
| 964 | |||
| 965 | sub _out_single_item_enclosure { | ||
| 966 | my ($self, $item, $enc) = @_; | ||
| 967 | |||
| 968 | return $self->_out("<enclosure " | ||
| 969 | . join(' ', map { "$_=\"" . $self->_encode($enc->{$_}) . '"' } keys(%$enc)) | ||
| 970 | . " />\n"); | ||
| 971 | } | ||
| 972 | |||
| 973 | sub _out_item_enclosure { | ||
| 974 | my ($self, $item) = @_; | ||
| 975 | |||
| 976 | if (my $enc = $item->{enclosure}) { | ||
| 977 | foreach my $sub ((ref($enc) eq "ARRAY") ? @$enc : ($enc)) { | ||
| 978 | $self->_out_single_item_enclosure($item, $sub); | ||
| 979 | } | ||
| 980 | } | ||
| 981 | } | ||
| 982 | |||
| 983 | sub _get_items { | ||
| 984 | return shift->_main->{items}; | ||
| 985 | } | ||
| 986 | |||
| 987 | sub _get_filtered_items { | ||
| 988 | return shift->_get_items; | ||
| 989 | } | ||
| 990 | |||
| 991 | sub _out_item_2_0_tags { | ||
| 992 | } | ||
| 993 | |||
| 994 | sub _out_item_1_0_tags { | ||
| 995 | } | ||
| 996 | |||
| 997 | sub _output_single_item { | ||
| 998 | my ($self, $item) = @_; | ||
| 999 | |||
| 1000 | $self->_start_item($item); | ||
| 1001 | |||
| 1002 | $self->_out_item_2_0_tags($item); | ||
| 1003 | |||
| 1004 | $self->_out_item_1_0_tags($item); | ||
| 1005 | |||
| 1006 | $self->_out_modules_elements_if_supported($item); | ||
| 1007 | |||
| 1008 | $self->_end_item($item); | ||
| 1009 | } | ||
| 1010 | |||
| 1011 | sub _output_items { | ||
| 1012 | my $self = shift; | ||
| 1013 | |||
| 1014 | $self->_item_idx(0); | ||
| 1015 | foreach my $item (@{$self->_get_filtered_items}) { | ||
| 1016 | $self->_output_single_item($item); | ||
| 1017 | } | ||
| 1018 | continue { | ||
| 1019 | $self->_item_idx($self->_item_idx() + 1); | ||
| 1020 | } | ||
| 1021 | } | ||
| 1022 | |||
| 1023 | sub _output_main_elements { | ||
| 1024 | my $self = shift; | ||
| 1025 | |||
| 1026 | $self->_output_complete_image(); | ||
| 1027 | |||
| 1028 | $self->_output_items; | ||
| 1029 | |||
| 1030 | $self->_output_complete_textinput(); | ||
| 1031 | } | ||
| 1032 | |||
| 1033 | # Outputs the last elements - for RSS versions 0.9.1 and 2.0 . | ||
| 1034 | sub _out_last_elements { | ||
| 1035 | my $self = shift; | ||
| 1036 | |||
| 1037 | $self->_out("\n"); | ||
| 1038 | |||
| 1039 | $self->_output_main_elements; | ||
| 1040 | |||
| 1041 | $self->_out_skip_hours(); | ||
| 1042 | |||
| 1043 | $self->_out_skip_days(); | ||
| 1044 | |||
| 1045 | $self->_end_channel; | ||
| 1046 | } | ||
| 1047 | |||
| 1048 | sub _calc_prefer_dc { | ||
| 1049 | return 0; | ||
| 1050 | } | ||
| 1051 | |||
| 1052 | sub _output_xml_start { | ||
| 1053 | my ($self) = @_; | ||
| 1054 | |||
| 1055 | $self->_prefer_dc($self->_calc_prefer_dc()); | ||
| 1056 | |||
| 1057 | $self->_output_xml_declaration(); | ||
| 1058 | |||
| 1059 | $self->_out_rdf_decl; | ||
| 1060 | |||
| 1061 | $self->_start_channel(); | ||
| 1062 | } | ||
| 1063 | |||
| 1064 | sub _get_end_tag { | ||
| 1065 | return "rss"; | ||
| 1066 | } | ||
| 1067 | |||
| 1068 | sub _out_end_tag { | ||
| 1069 | my $self = shift; | ||
| 1070 | |||
| 1071 | return $self->_out("</" . $self->_get_end_tag() . ">"); | ||
| 1072 | } | ||
| 1073 | |||
| 1074 | sub _out_all_modules_elems { | ||
| 1075 | my $self = shift; | ||
| 1076 | |||
| 1077 | # Dublin Core module | ||
| 1078 | $self->_out_dc_elements($self->channel(), | ||
| 1079 | {map { $_ => 1 } qw(language creator publisher rights date)}, | ||
| 1080 | ); | ||
| 1081 | |||
| 1082 | # Syndication module | ||
| 1083 | foreach my $syn (@{$self->_main->_get_syn_ok_fields}) { | ||
| 1084 | if (defined(my $value = $self->_channel_syn($syn))) { | ||
| 1085 | $self->_out_ns_tag("syn", $syn, $value); | ||
| 1086 | } | ||
| 1087 | } | ||
| 1088 | |||
| 1089 | # Taxonomy module | ||
| 1090 | $self->_output_taxo_topics($self->channel()); | ||
| 1091 | |||
| 1092 | $self->_out_modules_elements($self->channel()); | ||
| 1093 | } | ||
| 1094 | |||
| 1095 | sub _out_dates { | ||
| 1096 | my $self = shift; | ||
| 1097 | |||
| 1098 | $self->_out_defined_tag("pubDate", $self->_calc_pubDate()); | ||
| 1099 | $self->_out_defined_tag("lastBuildDate", $self->_calc_lastBuildDate()); | ||
| 1100 | } | ||
| 1101 | |||
| 1102 | sub _out_def_chan_tag { | ||
| 1103 | my ($self, $tag) = @_; | ||
| 1104 | return $self->_output_multiple_tags({ext => "channel", 'defined' => 1}, [$tag],); | ||
| 1105 | } | ||
| 1106 | |||
| 1107 | # $self->_render_complete_rss_output($xml_version) | ||
| 1108 | # | ||
| 1109 | # This function is the workhorse of the XML output and does all the work of | ||
| 1110 | # rendering the RSS, delegating the work to specialised functions. | ||
| 1111 | # | ||
| 1112 | # It accepts the requested version number as its argument. | ||
| 1113 | |||
| 1114 | sub _render_complete_rss_output { | ||
| 1115 | my ($self) = @_; | ||
| 1116 | |||
| 1117 | $self->_output_xml_start(); | ||
| 1118 | |||
| 1119 | $self->_output_rss_middle; | ||
| 1120 | |||
| 1121 | $self->_out_end_tag; | ||
| 1122 | |||
| 1123 | return $self->_flush_output(); | ||
| 1124 | } | ||
| 1125 | |||
| 1126 | ### | ||
| 1127 | ### Delegate the XML::RSS accessors to _main | ||
| 1128 | ### | ||
| 1129 | |||
| 1130 | sub channel { | ||
| 1131 | return shift->_main->channel(@_); | ||
| 1132 | } | ||
| 1133 | |||
| 1134 | sub image { | ||
| 1135 | return shift->_main->image(@_); | ||
| 1136 | } | ||
| 1137 | |||
| 1138 | sub textinput { | ||
| 1139 | return shift->_main->textinput(@_); | ||
| 1140 | } | ||
| 1141 | |||
| 1142 | sub _modules { | ||
| 1143 | return shift->_main->_modules(); | ||
| 1144 | } | ||
| 1145 | |||
| 1146 | 1; | ||
| 1147 | |||
| 1148 | __END__ | ||
| 1149 | |||
| 1150 | =pod | ||
| 1151 | |||
| 1152 | =encoding UTF-8 | ||
| 1153 | |||
| 1154 | =head1 VERSION | ||
| 1155 | |||
| 1156 | version 1.62 | ||
| 1157 | |||
| 1158 | =head1 METHODS | ||
| 1159 | |||
| 1160 | =head2 channel | ||
| 1161 | |||
| 1162 | Internal use. | ||
| 1163 | |||
| 1164 | =head2 image | ||
| 1165 | |||
| 1166 | Internal use. | ||
| 1167 | |||
| 1168 | =head2 new | ||
| 1169 | |||
| 1170 | Internal use. | ||
| 1171 | |||
| 1172 | =head2 textinput | ||
| 1173 | |||
| 1174 | Internal use. | ||
| 1175 | |||
| 1176 | =for :stopwords cpan testmatrix url bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan | ||
| 1177 | |||
| 1178 | =head1 SUPPORT | ||
| 1179 | |||
| 1180 | =head2 Websites | ||
| 1181 | |||
| 1182 | The following websites have more information about this module, and may be of help to you. As always, | ||
| 1183 | in addition to those websites please use your favorite search engine to discover more resources. | ||
| 1184 | |||
| 1185 | =over 4 | ||
| 1186 | |||
| 1187 | =item * | ||
| 1188 | |||
| 1189 | MetaCPAN | ||
| 1190 | |||
| 1191 | A modern, open-source CPAN search engine, useful to view POD in HTML format. | ||
| 1192 | |||
| 1193 | L<https://metacpan.org/release/XML-RSS> | ||
| 1194 | |||
| 1195 | =item * | ||
| 1196 | |||
| 1197 | RT: CPAN's Bug Tracker | ||
| 1198 | |||
| 1199 | The RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN. | ||
| 1200 | |||
| 1201 | L<https://rt.cpan.org/Public/Dist/Display.html?Name=XML-RSS> | ||
| 1202 | |||
| 1203 | =item * | ||
| 1204 | |||
| 1205 | CPANTS | ||
| 1206 | |||
| 1207 | The CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution. | ||
| 1208 | |||
| 1209 | L<http://cpants.cpanauthors.org/dist/XML-RSS> | ||
| 1210 | |||
| 1211 | =item * | ||
| 1212 | |||
| 1213 | CPAN Testers | ||
| 1214 | |||
| 1215 | The CPAN Testers is a network of smoke testers who run automated tests on uploaded CPAN distributions. | ||
| 1216 | |||
| 1217 | L<http://www.cpantesters.org/distro/X/XML-RSS> | ||
| 1218 | |||
| 1219 | =item * | ||
| 1220 | |||
| 1221 | CPAN Testers Matrix | ||
| 1222 | |||
| 1223 | The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms. | ||
| 1224 | |||
| 1225 | L<http://matrix.cpantesters.org/?dist=XML-RSS> | ||
| 1226 | |||
| 1227 | =item * | ||
| 1228 | |||
| 1229 | CPAN Testers Dependencies | ||
| 1230 | |||
| 1231 | The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution. | ||
| 1232 | |||
| 1233 | L<http://deps.cpantesters.org/?module=XML::RSS> | ||
| 1234 | |||
| 1235 | =back | ||
| 1236 | |||
| 1237 | =head2 Bugs / Feature Requests | ||
| 1238 | |||
| 1239 | Please report any bugs or feature requests by email to C<bug-xml-rss at rt.cpan.org>, or through | ||
| 1240 | the web interface at L<https://rt.cpan.org/Public/Bug/Report.html?Queue=XML-RSS>. You will be automatically notified of any | ||
| 1241 | progress on the request by the system. | ||
| 1242 | |||
| 1243 | =head2 Source Code | ||
| 1244 | |||
| 1245 | The code is open to the world, and available for you to hack on. Please feel free to browse it and play | ||
| 1246 | with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull | ||
| 1247 | from your repository :) | ||
| 1248 | |||
| 1249 | L<https://github.com/shlomif/perl-XML-RSS> | ||
| 1250 | |||
| 1251 | git clone git://github.com/shlomif/perl-XML-RSS.git | ||
| 1252 | |||
| 1253 | =head1 AUTHOR | ||
| 1254 | |||
| 1255 | Shlomi Fish <shlomif@cpan.org> | ||
| 1256 | |||
| 1257 | =head1 BUGS | ||
| 1258 | |||
| 1259 | Please report any bugs or feature requests on the bugtracker website | ||
| 1260 | L<https://github.com/shlomif/perl-XML-RSS/issues> | ||
| 1261 | |||
| 1262 | When submitting a bug or request, please include a test-file or a | ||
| 1263 | patch to an existing test-file that illustrates the bug or desired | ||
| 1264 | feature. | ||
| 1265 | |||
| 1266 | =head1 COPYRIGHT AND LICENSE | ||
| 1267 | |||
| 1268 | This software is copyright (c) 2001 by Various. | ||
| 1269 | |||
| 1270 | This is free software; you can redistribute it and/or modify it under | ||
| 1271 | the same terms as the Perl 5 programming language system itself. | ||
| 1272 | |||
| 1273 | =cut | ||