File Coverage

blib/lib/App/RSS2Leafnode.pm
Criterion Covered Total %
statement 75 1586 4.7
branch 0 718 0.0
condition 0 532 0.0
subroutine 26 162 16.0
pod 4 123 3.2
total 105 3121 3.3


line stmt bran cond sub pod time code
1             # Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Kevin Ryde
2             #
3             # This file is part of RSS2Leafnode.
4             #
5             # RSS2Leafnode is free software; you can redistribute it and/or modify it
6             # under the terms of the GNU General Public License as published by the Free
7             # Software Foundation; either version 3, or (at your option) any later
8             # version.
9             #
10             # RSS2Leafnode is distributed in the hope that it will be useful, but
11             # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12             # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13             # for more details.
14             #
15             # You should have received a copy of the GNU General Public License along
16             # with RSS2Leafnode. If not, see .
17              
18              
19             # maybe:
20             # location links
21             # http://maps.google.com/maps?ll=-35.066667,148.1
22             # http://maps.google.com/maps?ll=-35.066667,148.1&spn=0.01,0.01&t=m
23             #
24             #
25             # when site has mutliple names for a page, relative or absolute
26              
27              
28              
29             package App::RSS2Leafnode;
30 1     1   1476 use 5.010;
  1         4  
  1         37  
31 1     1   4 use strict;
  1         2  
  1         25  
32 1     1   5 use warnings;
  1         1  
  1         20  
33 1     1   4 use Carp;
  1         1  
  1         110  
34 1     1   1173 use Encode;
  1         12210  
  1         88  
35 1     1   6753 use Hash::Util::FieldHash;
  1         1138  
  1         46  
36 1     1   7 use List::Util 'min', 'max';
  1         1  
  1         94  
37 1     1   886 use List::MoreUtils;
  1         1222  
  1         43  
38 1     1   1036 use POSIX (); # ENOENT, etc
  1         6409  
  1         26  
39 1     1   17 use Scalar::Util;
  1         2  
  1         48  
40 1     1   861 use Text::Trim 1.02; # version 1.02 for undef support
  1         588  
  1         68  
41 1     1   798 use URI;
  1         8036  
  1         28  
42 1     1   791 use HTML::Entities::Interpolate;
  1         7548  
  1         5  
43              
44 1     1   545 use App::RSS2Leafnode::XML::Twig::Other;
  1         2  
  1         43  
45              
46             # version 1.17 for __p(), and version 1.16 for turn_utf_8_on()
47 1     1   943 use Locale::TextDomain 1.17;
  1         9373  
  1         7  
48 1     1   9041 use Locale::TextDomain ('App-RSS2Leafnode');
  1         3  
  1         5  
49             BEGIN {
50 1     1   25 use Locale::Messages;
  1         2  
  1         59  
51 1     1   5 Locale::Messages::bind_textdomain_codeset ('App-RSS2Leafnode','UTF-8');
52 1         19 Locale::Messages::bind_textdomain_filter ('App-RSS2Leafnode',
53             \&Locale::Messages::turn_utf_8_on);
54             }
55              
56             # uncomment this to run the ### lines
57             # use Smart::Comments;
58              
59             our $VERSION;
60             BEGIN {
61 1     1   750 $VERSION = 77;
62             }
63              
64             ## no critic (ProhibitFixedStringMatches)
65              
66              
67             # Cribs:
68             #
69             # RSS
70             # http://my.netscape.com/publish/help/
71             # RSS 0.9 spec.
72             # http://my.netscape.com/publish/help/mnn20/quickstart.html
73             # RSS 0.91 spec.
74             # http://purl.org/rss/1.0/
75             # RSS 1.0 spec.
76             # http://www.rssboard.org/rss-specification
77             # http://www.rssboard.org/files/rss-2.0-sample.xml
78             # RSS 2.0 spec and sample.
79             #
80             # http://www.rssboard.org/rss-profile
81             # "Best practices."
82             #
83             # Dublin Core
84             # RFC 5013 -- summary
85             # http://dublincore.org/documents/dcmi-terms/ -- dc/terms
86             #
87             # Atom
88             # RFC 4287 -- Atom spec
89             # RFC 3339 -- ISO timestamps as used in Atom
90             # RFC 4685 -- "thr" threading extensions
91             # RFC 4946 --
92             # RFC 5005 -- etc paging and archiving
93             # http://diveintomark.org/archives/2004/05/28/howto-atom-id
94             # Making an
95             # http://www.iana.org/assignments/link-relations/link-relations.xhtml
96             # assigned values
97             #
98             # RSS Modules:
99             # http://www.meatballwiki.org/wiki/ModWiki -- wiki
100             # http://web.resource.org/rss/1.0/modules/slash/
101             # http://code.google.com/apis/feedburner/feedburner_namespace_reference.html
102             # http://backend.userland.com/creativeCommonsRSSModule
103             #
104             # http://web.resource.org/rss/1.0/modules/content/
105             # http://www.rssboard.org/rss-profile#namespace-elements-content
106             # http://validator.w3.org/feed/docs/warning/NeedDescriptionBeforeContent.html
107             # should precede
108             #
109             # http://www.apple.com/itunes/podcasts/specs.html
110             # http://www.feedforall.com/itunes.htm
111             # http://www.w3.org/2003/01/geo/wgs84_pos -- etc
112             # http://www.georss.org/
113             # http://www.georss.org/Encodings
114             # http://www.georss.org/atom
115             # http://www.georss.org/rdf_rss1
116             #
117             # http://activitystrea.ms/specs/atom/1.0/
118             # activity:
119             # http://prismstandard.org/namespaces/basic/2.0/
120             # http://www.prismstandard.org/specifications/2.0/PRISM_prism_namespace_2.0.pdf
121             # Prism
122             #
123             # URIs
124             # RFC 1738, RFC 2396, RFC 3986 -- URI formats (news/nntp in 1738)
125             # draft-ellermann-news-nntp-uri-11.txt -- news/nntp update
126             # RFC 2732 -- ipv6 "[]" hostnames
127             # RFC 2141 -- urn:
128             # RFC 4122 -- uuid format (as under urn:uuid:)
129             # RFC 4151 -- tag:
130             # RFC 1034, RFC 1123 -- domain names
131             # RFC 2606 -- reserved domain names ".invalid"
132             #
133             # XML
134             # http://www.w3.org/TR/xmlbase/ -- xml:base
135             # RFC 3023 text/xml etc media types
136             #
137             # Mail Messages
138             # RFC 850, RFC 1036
139             # -- News message format, inc headers and rnews format
140             # RFC 2822, RFC 5322, RFC 5536
141             # -- Email message format.
142             # RFC 2076, RFC 4021 -- headers summary.
143             # RFC 2557 -- MHTML Content-Location
144             # RFC 1864 -- Content-MD5 header
145             # RFC 2369 -- List-Post header and friends
146             # http://www.ietf.org/proceedings/98dec/I-D/draft-ietf-drums-mail-followup-to-00.txt
147             # Draft "Mail-Followup-To" header.
148             #
149             # RFC 1327 -- X.400 to RFC822 introducing Language header
150             # RFC 3282 -- Content-Language header
151             # RFC 1766, RFC 3066, RFC 4646 -- language tag form
152             #
153             #
154             # NNTP
155             # RFC 977 -- NNTP
156             # RFC 2616 -- HTTP/1.1 Accept-Encoding header
157             # RFC 2980 -- NNTP extensions
158             #
159             # RFC 4642 -- NNTP with SSL
160             #
161             # For XML in Perl there's several ways to do it!
162             # - XML::Parser looks likely for stream/event processing, but its builtin
163             # tree mode is very basic.
164             # - XML::Twig extends XML::Parser to a good tree, though the docs are
165             # slightly light on. It only does a subset of "XPath" but the
166             # functions/regexps are more perl-like for matching and there's various
167             # handy shortcuts for common operations.
168             # - XML::LibXML is the full blown libxml and is rather a lot to learn.
169             # Because it's mainly C it's not easy to find where or how you're going
170             # wrong when your code doesn't work. libxml also seems stricter about
171             # namespace matters than XML::Parser/XML::Twig.
172             # - XML::RSS uses XML::Parser to build its own style tree of RSS,
173             # including unifying differences among RSS/RDF 0.91, 1.0 and 2.0.
174             # Nested elements seem to need specific handling in its code, which can
175             # make it tricky for sub-element oddities. A fair amount of it is about
176             # writing RSS too.
177             # - XML::RSS::LibXML uses libxml for XML::RSS compatible reading and
178             # writing. It seems to do better on unrecognised sub-elements.
179             # - XML::Atom offers the basic Atom elements but doesn't seem to give
180             # access to extra stuff that might be in a feed.
181             # - XML::Feed tries to unify XML::RSS and XML::Atom but again doesn't seem
182             # to go much beyond the basics. It too is geared towards writing as
183             # well as reading.
184             # - XML::TreePP pure perl parser to a hash tree.
185             #
186             # The choice of XML::Twig is based on wanting both RSS and Atom, but
187             # XML::Feed not going far enough. Tree processing is easier than stream,
188             # and an RSS isn't meant to be huge. A tree may help if channel fields
189             # follow items or something equally unnatural, but will probably assume that
190             # doesn't happen and look at the twig partial-tree mode. Between the tree
191             # styles XML::LibXML is harder to get into than Twig.
192             #
193              
194             #------------------------------------------------------------------------------
195             # mostly generic
196              
197             # return $str with a newline at the end, if it doesn't already have one
198             sub str_ensure_newline {
199 0     0 0   my ($str) = @_;
200 0 0         if ($str !~ /\n$/) { $str .= "\n" }
  0            
201 0           return $str;
202             }
203              
204             sub md5_of_utf8 {
205 0     0 0   my ($str) = @_;
206 0           require Digest::MD5;
207 0           return Digest::MD5::md5_base64 (Encode::encode_utf8 ($str));
208             }
209              
210             sub is_empty {
211 0     0 0   my ($str) = @_;
212 0   0       return (! defined $str || $str =~ /^\s*$/);
213             }
214             sub is_non_empty {
215 0     0 0   my ($str) = @_;
216 0           return ! is_empty($str);
217             }
218             sub non_empty {
219 0     0 0   my ($str) = @_;
220 0 0         return (is_non_empty($str) ? $str : ());
221             }
222              
223             sub join_non_empty {
224 0     0 0   my $sep = shift;
225 0           return non_empty (join($sep, map {non_empty($_)} @_));
  0            
226             }
227              
228             sub collapse_whitespace {
229 0     0 0   my ($str) = @_;
230 0 0         defined $str or return undef;
231 0 0         $str =~ s/(\s+)/($1 eq ' ' ? $1 : ' ')/ge;
  0            
232 0           return Text::Trim::trim($str);
233             }
234              
235             # return true if $str is entirely ascii chars 0 to 127
236             sub is_ascii {
237 0     0 0   my ($str) = @_;
238 0           return ($str !~ /[^[:ascii:]]/);
239             }
240              
241             # Return the number of lines in $str.
242             # If $str ends with a newline then that counts as the last line, so "xyz\n"
243             # is one line. If $str doesn't end with a newline then the final chars are
244             # a line, so "abc\ndef" is two lines.
245             sub str_count_lines {
246 0     0 0   my ($str) = @_;
247 0   0       return scalar($str =~ tr/\n//) + (length($str) && substr($str,-1) ne "\n");
248             }
249              
250             sub File_Temp_DEBUG_saver {
251 0     0 0   my ($self, $newval) = @_;
252 0           require Scope::Guard;
253 0           require File::Temp;
254 0           my $oldval = $File::Temp::DEBUG;
255 0     0     my $ret = Scope::Guard->new (sub { $File::Temp::DEBUG = $oldval });
  0            
256 0           $File::Temp::DEBUG = $newval;
257 0           return $ret;
258             }
259             sub MIME_Tools_debugging {
260 0     0 0   my ($self, $newval) = @_;
261 0           require Scope::Guard;
262 0           require MIME::Tools;
263 0           my $oldval = MIME::Tools->debugging;
264 0     0     my $ret = Scope::Guard->new (sub { MIME::Tools->debugging($oldval) });
  0            
265 0           MIME::Tools->debugging ($newval);
266 0           return $ret;
267             }
268              
269             sub homedir {
270             # my ($self) = @_;
271 0     0 0   require File::HomeDir;
272             # call each time just in case playing tricks with $ENV{HOME} in conf file
273 0   0       return File::HomeDir->my_home
274             // croak 'File::HomeDir says you have no home directory';
275             }
276              
277             #------------------------------------------------------------------------------
278             # Number::Format for sizes in bytes
279              
280             use constant::defer NUMBER_FORMAT => sub {
281 0         0 require Number::Format;
282 0         0 Number::Format->VERSION(1.5); # for format_bytes() options params
283 0         0 return Number::Format->new
284             (-kilo_suffix => __p('number-format-kilobytes','K'),
285             -mega_suffix => __p('number-format-megabytes','M'),
286             -giga_suffix => __p('number-format-gigabytes','G'));
287 1     1   820 };
  1         689  
  1         9  
288              
289             sub format_size_in_bytes {
290 0     0 0   my ($self, $length) = @_;
291 0 0         if ($length >= 2000) {
292 0           return $self->NUMBER_FORMAT()->format_bytes ($length, precision => 1);
293             } else {
294 0           return __x('{size} bytes', size => $length);
295             }
296             }
297              
298             #------------------------------------------------------------------------------
299              
300             sub new {
301 0     0 1   my $class = shift;
302 0           return bless {
303             # config variables
304             verbose => 0,
305             render => 0,
306             render_width => 60,
307             rss_get_links => 0,
308             rss_get_comments => 0,
309             rss_newest_only => 0,
310             get_icon => 0,
311             html_charset_from_content => 0,
312              
313             # secret extra
314             msgidextra => '',
315              
316             @_,
317             }, $class;
318             }
319              
320             sub command_line {
321 0     0 1   my ($self) = @_;
322              
323 0           my $done_version;
324 0           require Getopt::Long;
325 0           Getopt::Long::Configure ('no_ignore_case');
326             Getopt::Long::GetOptions
327             ('config=s' => \$self->{'config_filename'},
328             'verbose:1' => \$self->{'verbose'},
329             'version' => sub {
330 0     0     say __x("RSS2Leafnode version {version}", version => $VERSION);
331 0           $done_version = 1;
332             },
333             'bareversion' => sub {
334 0     0     say $VERSION;
335 0           $done_version = 1;
336             },
337             'msgid=s' => \$self->{'msgidextra'},
338             'help|?' => sub {
339 0     0     say __x("rss2leafnode [--options]");
340 0           say __x(" --config=filename configuration file (default ~/.rss2leafnode.conf)");
341 0           say __x(" --help print this help");
342 0           say __x(" --verbose describe what's done");
343 0           say __x(" --verbose=2 show technical details of what's done");
344 0           say __x(" --version print program version number");
345 0           exit 0;
346 0 0         }) or return 1;
347 0 0         if (! $done_version) {
348 0           $self->do_config_file;
349 0           $self->nntp_close;
350             }
351 0           return 0;
352             }
353              
354             sub verbose {
355 0     0 0   my $self = shift;
356 0           my $count = shift;
357 0 0         if ($self->{'verbose'} >= $count) {
358 0           say @_;
359             }
360             }
361              
362             sub config_filename {
363 0     0 0   my ($self) = @_;
364 0   0       return $self->{'config_filename'} // do {
365 0           require File::Spec;
366 0           File::Spec->catfile ($self->homedir, '.rss2leafnode.conf');
367             };
368             }
369             sub status_filename {
370 0     0 0   my ($self) = @_;
371 0   0       return $self->{'status_filename'} // do {
372 0           require File::Spec;
373 0           File::Spec->catfile ($self->homedir, '.rss2leafnode.status');
374             };
375             }
376              
377             sub do_config_file {
378 0     0 0   my ($self) = @_;
379 0           my @guards;
380              
381 0 0         open STDERR, '>&STDOUT' or die "Oops, can't join STDERR to STDOUT";
382              
383             # File::Temp::DEBUG for possible temp files used by HTML::FormatExternal
384             # these debugs turned on only for the duration of running the config file
385             # and the downloading etc in it
386 0 0         if ($self->{'verbose'} >= 2) {
387 0           push @guards, $self->File_Temp_DEBUG_saver(1);
388 0           push @guards, $self->MIME_Tools_debugging(1);
389             }
390              
391 0           my $config_filename = $self->config_filename;
392 0           $self->verbose (1, "config: ", $config_filename);
393              
394 0           require App::RSS2Leafnode::Conf;
395 0           local $App::RSS2Leafnode::Conf::r2l = $self;
396 0 0         if (! defined (do { package App::RSS2Leafnode::Conf;
397 0           do $config_filename;
398             })) {
399 0 0         if (! -e $config_filename) {
400 0           croak "rss2leafnode: config file $config_filename doesn't exist\n";
401             } else {
402 0           croak $@;
403             }
404             }
405             }
406              
407             #------------------------------------------------------------------------------
408             # LWP stuff
409              
410             sub user_agent {
411 0     0 0   my ($self) = @_;
412 0 0         if (defined $self->{'user_agent'}) {
413 0           return $self->{'user_agent'};
414             } else {
415 0           return 'RSS2leafnode/' . $self->VERSION . ' ';
416             }
417             }
418              
419             sub ua {
420 0     0 0   my ($self) = @_;
421 0   0       return ($self->{'ua'} ||= do {
422 0           require LWP::UserAgent;
423 0           LWP::UserAgent->VERSION(5.832); # 5.832 for content_charset()
424              
425             # one connection kept alive
426 0           my $ua = LWP::UserAgent->new (keep_alive => 1);
427 0           Scalar::Util::weaken ($ua->{(__PACKAGE__)} = $self);
428 0           $ua->agent ($self->user_agent);
429              
430 0           Scalar::Util::weaken (my $weak_self = $self);
431 0           $ua->add_handler (request_send => \&lwp_request_send__verbose);
432             $ua->add_handler (response_done => sub {
433 0     0     lwp_response_done__check_md5 ($weak_self, @_);
434 0           });
435              
436             # ask for everything $resp->decode() / $resp->decoded_content() can cope
437             # with, in particular "gzip" and "deflate" compression if Compress::Zlib
438             # or whatever is available
439             #
440 0           require HTTP::Message;
441 0           my $decodable = HTTP::Message::decodable();
442 0           $self->verbose (2, "HTTP decodable: ", $decodable);
443 0           $ua->default_header ('Accept-Encoding' => $decodable);
444              
445 0           $ua
446             });
447             }
448              
449             sub lwp_request_send__verbose {
450 0     0 0   my ($req, $ua, $h) = @_;
451 0           my $self = $ua->{(__PACKAGE__)};
452 0           $self->verbose (2, "request_send:", $req->dump, "\n"); # extra newline
453 0           return; # continue processing
454             }
455              
456             sub lwp_response_done__check_md5 {
457 0     0 0   my ($self, $resp, $ua, $h) = @_;
458 0 0         $self || return;
459             ### lwp_response_done__check_md5() ...
460 0   0       my $want = $resp->header('Content-MD5') // do {
461 0           $self->verbose (2, 'no Content-MD5 header');
462 0           return;
463             };
464 0           $resp->decode;
465 0           my $cref = $resp->content_ref;
466 0           require Digest::MD5;
467 0           my $got = Digest::MD5::md5_hex($$cref);
468 0 0         if ($got ne $want) {
469 0           print __x("Warning, MD5 checksum mismatch on download {url}\n",
470             url => $resp->request->uri);
471             } else {
472 0           $self->verbose(2, 'Content-MD5 ok');
473             }
474             }
475              
476             # $resp is a HTTP::Response object. Modify its headers to apply our
477             # $html_charset_from_content option, which means if it's set then prefer the
478             # document's Content-Type over what the server says.
479             #
480             # The LWP::UserAgent parse_head option appends the document bits to
481             # the message headers. If the server and the document both offer a
482             # Content-Type then there's two, with the document one last, so all we have
483             # to do is change to make the last one the only one.
484             #
485             sub enforce_html_charset_from_content {
486 0     0 0   my ($self, $resp) = @_;
487 0 0 0       if ($self->{'html_charset_from_content'}
488             && $resp->headers->content_is_html) {
489 0           my $old = $resp->header('Content-Type');
490 0           $resp->header('Content-Type' => $resp->headers->content_type);
491              
492 0           $self->verbose (2, 'html_charset_from_content mangled Content-Type from');
493 0           $self->verbose (2, " from ", $old);
494 0           $self->verbose (2, " to ", $resp->header('Content-Type'));
495 0           $self->verbose (2, " giving charset ", $resp->content_charset);
496             }
497             }
498              
499              
500             #------------------------------------------------------------------------------
501             my %known;
502              
503             # dates through which thing is valid
504             # ENHANCE-ME: is this something to work into the skipdays? or a message expiry?
505             #
506             $known{'/channel/item/dcterms:valid'} = undef;
507              
508             # maybe the target audience for speeches, announcements.
509             $known{'/channel/item/dcterms:audience'} = undef;
510              
511             # earthquake depth, repeat of text
512             # unix seconds since 1970 date of earthquake, repeating text
513             @known{qw(/channel/item/eq:depth
514             /channel/item/eq:seconds)} = ();
515              
516             # rdf structure stuff
517             @known{qw(/channel/items
518             /channel/items/rdf:Seq
519             /channel/items/rdf:Seq/rdf:li)} = ();
520              
521             @known{('/channel/cloud',
522             '/channel/link',
523             '/channel/docs',
524             '/channel/generator',
525             '/channel/rating',
526             '/channel/id',
527             '/channel/description',
528             '/channel/tagline',
529             '/channel/info', # atom something freeform
530             '/channel/itunes:summary',
531             '/channel/feedburner:info',
532              
533             # nothing much in these as yet eg. rssboard
534             '/channel/item/sitemap:priority',
535             '/channel/item/sitemap:changefreq',
536              
537             # feedburner junk
538             '/channel/feedburner:feedFlare',
539              
540             # images
541             '/channel/itunes:owner',
542             '/channel/itunes:owner/itunes:name',
543             '/channel/itunes:owner/itunes:email',
544              
545             '/channel/textInput',
546             '/channel/textInput/description',
547             '/channel/textInput/link',
548             '/channel/textInput/name',
549             '/channel/textInput/title',
550             '/channel/textinput',
551             '/channel/textinput/title',
552             '/channel/textinput/description',
553             '/channel/textinput/name',
554             '/channel/textinput/link',
555              
556             '/channel/openSearch:totalResults',
557             '/channel/openSearch:startIndex',
558             '/channel/openSearch:itemsPerPage',
559              
560             '/channel/item',
561             '/channel/item/source',
562              
563             '/channel/item/twitter:source',
564              
565             # something from radio free france
566             # eg. http://radiofrance-podcast.net/podcast09/rss_10193.xml
567             '/channel/item/podcastRF:businessReference',
568              
569             # google documents stuff
570             '/channel/item/gd:extendedProperty',
571              
572             # repeats in structured form the rate shown in the text
573             # eg. RBA http://www.rba.gov.au/rss/rss-cb-exchange-rates.xml
574             'channel/item/cb:statistics',
575              
576             # repeats plain text
577             # eg. Fed Reserve http://www.federalreserve.gov/feeds/press_taf.xml
578             '/channel/item/cb:news',
579              
580             # FIXME: may have bit extra detail
581             # Fed eg. http://www.federalreserve.gov/feeds/speeches.xml
582             '/channel/item/cb:speech',
583              
584             # repeat in structured form
585             # guess likewise
586             # Fed eg. http://www.federalreserve.gov/feeds/ifdp.xml
587             # FIXME: except has extra pdf form link
588             '/channel/item/cb:paper',
589             '/channel/item/cb:event',
590              
591             # is an sha-1 or similar hash of a target media file etc
592             '/channel/item/media:hash',
593              
594             # not sure what these are, but don't seem very interesting
595             '/channel/item/slate:slate_plus', # false
596             '/channel/item/slate:paywall', # false
597             '/channel/item/slate:sponsored', # false
598             )} = ();
599              
600             # weather
601             # '/channel/item/w:current',
602             # '/channel/item/w:forecast',
603             # '/channel/yweather:location',
604             # '/channel/yweather:units',
605             # '/channel/yweather:wind',
606             # '/channel/yweather:atmosphere',
607             # '/channel/yweather:astronomy',
608             # '/channel/item/yweather:condition',
609             # '/channel/item/yweather:forecast',
610              
611             # --central-bank
612             # /channel/item/cb:statistics
613             # /channel/item/cb:statistics/cb:country
614             # /channel/item/cb:statistics/cb:institutionAbbrev
615             # /channel/item/cb:statistics/cb:exchangeRate
616             # /channel/item/cb:statistics/cb:exchangeRate/cb:value
617             # /channel/item/cb:statistics/cb:exchangeRate/cb:baseCurrency
618             # /channel/item/cb:statistics/cb:exchangeRate/cb:targetCurrency
619             # /channel/item/cb:statistics/cb:exchangeRate/cb:rateType
620             # /channel/item/cb:statistics/cb:exchangeRate/cb:observationPeriod
621             # /channel/item/cb:speech
622             # /channel/item/cb:speech/cb:simpleTitle
623             # /channel/item/cb:speech/cb:occurrenceDate
624             # /channel/item/cb:speech/cb:person
625             # /channel/item/cb:speech/cb:person/cb:givenName
626             # /channel/item/cb:speech/cb:person/cb:surname
627             # /channel/item/cb:speech/cb:person/cb:personalTitle
628             # /channel/item/cb:speech/cb:person/cb:nameAsWritten
629             # /channel/item/cb:speech/cb:person/cb:role
630             # /channel/item/cb:speech/cb:person/cb:role/cb:jobTitle
631             # /channel/item/cb:speech/cb:person/cb:role/cb:affiliation
632             # /channel/item/cb:speech/cb:venue
633              
634              
635             #------------------------------------------------------------------------------
636             # dates
637              
638 1     1   1486 use constant RFC822_STRFTIME_FORMAT => '%a, %d %b %Y %H:%M:%S %z';
  1         3  
  1         2122  
639              
640             # return a string which is current time in RFC 822 format
641             sub rfc822_time_now {
642 0     0 0   return POSIX::strftime (RFC822_STRFTIME_FORMAT, localtime(time()));
643             }
644              
645             sub isodate_to_rfc822 {
646 0     0 0   my ($isodate) = @_;
647 0 0         if (! defined $isodate) { return undef; }
  0            
648 0           my $date = $isodate; # the original goes through if unrecognised
649              
650 0 0 0       if ($isodate =~ /\dT\d/ || $isodate =~ /^\d{4}-\d{2}-\d{2}$/) {
651             # eg. "2000-01-01T12:00+00:00"
652             # "2000-01-01T12:00:00Z"
653             # "2000-01-01"
654 0 0         my $zonestr = ($isodate =~ s/([+-][0-9][0-9]):([0-9][0-9])$// ? " $1$2"
    0          
655             : $isodate =~ s/Z$// ? ' +0000'
656             : '');
657 0           require Date::Parse;
658 0           my $time_t = Date::Parse::str2time($isodate);
659 0 0         if (defined $time_t) {
660 0           $date = POSIX::strftime ("%a, %d %b %Y %H:%M:%S$zonestr",
661             localtime ($time_t));
662             }
663             }
664 0           return $date;
665             }
666              
667             # Return an RFC822 date string, or undef if nothing known.
668             # This gets a sensible sort-by-date in the newsreader.
669             # seems to be accompanied by the usual so may be
670             # redundant.
671             #
672             sub item_to_date {
673 0     0 0   my ($self, $item) = @_;
674 0           my $date;
675 0           foreach my $elt ($item, item_to_channel($item)) {
676 0   0       $date = (non_empty ($elt->first_child_trimmed_text('pubDate'))
      0        
      0        
      0        
      0        
      0        
      0        
      0        
      0        
677             // non_empty ($elt->first_child_trimmed_text('dc:date'))
678             // non_empty ($elt->first_child_trimmed_text('jf:creationDate'))
679             # Atom
680             // non_empty ($elt->first_child_trimmed_text('modified'))
681             // non_empty ($elt->first_child_trimmed_text('updated'))
682             // non_empty ($elt->first_child_trimmed_text('issued'))
683             // non_empty ($elt->first_child_trimmed_text('dcterms:issued'))
684             // non_empty ($elt->first_child_trimmed_text('created'))
685             # channel
686             // non_empty ($elt->first_child_trimmed_text('lastBuildDate'))
687             # Atom
688             // non_empty ($elt->first_child_trimmed_text('published'))
689             );
690 0 0         last if defined $date;
691             }
692 0           return isodate_to_rfc822($date);
693             }
694             @known{qw(/channel/dc:date
695             /channel/lastBuildDate
696             /channel/pubDate
697             /channel/updated
698             /channel/modified
699              
700             /channel/item/dc:date
701             /channel/item/pubDate
702             /channel/item/updated
703             /channel/item/published
704             /channel/item/modified
705             /channel/item/created
706             /channel/item/issued
707             /channel/item/dcterms:issued
708              
709             /channel/item/jf:creationDate --java-locale-human-readable
710             /channel/item/jf:modificationDate
711             /channel/item/jf:date --free-form
712             )} = ();
713              
714              
715             sub item_to_timet {
716 0     0 0   my ($self, $item) = @_;
717             ### item_to_timet() ...
718 0   0       my $str = $self->item_to_date($item)
719             // return - POSIX::DBL_MAX(); # no date fields
720              
721 0           require Date::Parse;
722             ### $str
723             # print Date::Parse::str2time($str)," $str\n";
724             return (Date::Parse::str2time($str)
725 0   0       // do {
726 0           say __x('Unrecognised date "{date}" from {url}',
727             date => $str,
728             url => $self->{'uri'});
729 0           - POSIX::DBL_MAX();
730             });
731             }
732              
733             #-----------------------------------------------------------------------------
734             # Message-ID
735              
736             # Return a message ID for something at $uri, optionally uniquified by $str.
737             # $uri is either a URI object or a url string.
738             # Weird chars in $uri or $str are escaped as necessary.
739             # Secret $self->{'msgidextra'} can make different message ids for the same
740             # content when testing.
741             #
742             # The path from $uri is incorporated in the result. fetch_html() needs this
743             # since the ETag identifier is only per-url, not globally unique. Suspect
744             # fetch_rss() needs it for a guid too (a non-permaLink one), as think the
745             # guid is only unique within the particular $uri feed, not globally and not
746             # even across multiple feeds on the same server.
747             #
748             sub url_to_msgid {
749 0     0 0   my ($self, $url, $str) = @_;
750              
751 0           my $host;
752 0           my $pathbit = $url;
753              
754 0 0         if (my $uri = eval { URI->new($url) }) {
  0            
755 0           $uri = $uri->canonical;
756 0 0         if ($uri->can('host')) {
    0          
757 0           $host = $uri->host;
758 0           $uri->host('');
759 0           $pathbit = $uri->as_string;
760              
761             # If the $uri schema has a host part but it's empty or "localhost"
762             # then try expanding that to hostname().
763             #
764             # $uri schemas without a host part, like "urn:" in an Atom don't
765             # get hostname(), since want the generated msgid to come out the same
766             # if such a urn: appears from different downloaded locations.
767             #
768 0 0 0       if (is_empty($host) || $host eq 'localhost') {
769 0           require Sys::Hostname;
770 0           eval { $host = Sys::Hostname::hostname() };
  0            
771             }
772              
773             } elsif ($uri->can('authority')) {
774             # the "authority" part of a "tag:" schema
775 0           $host = $uri->authority;
776 0           $uri->authority('');
777 0           $pathbit = $uri->as_string;
778             }
779             }
780              
781             # $host can be empty if running from a file:///
782             # "localhost" is a bit bogus and in particular leafnode won't accept it.
783             # ".invalid" as per RFC 2606
784 0 0 0       if (is_empty($host) || $host eq 'localhost') {
785 0           $host = 'rss2leafnode.invalid';
786             }
787              
788             # ipv6 dotted hostname "[1234:5678::0000]" -> "1234.5678.0000..ipv6",
789             # because [ and : are not allowed (RFC 2822 "Atom" atext)
790             # $uri->canonical above lower cases any hex, for consistency
791 0 0         if (($host =~ s/^\[|\]$//g) | ($host =~ tr/:/./)) {
792 0           $host .= '.ipv6';
793             }
794              
795             # leafnode 2.0.0.alpha20070602a seems to insist on a "." in the host name
796 0 0         unless ($host =~ /\./) {
797 0           $host .= '.withadot';
798             }
799              
800 0           return ('<'
801             . msgid_chars(join_non_empty('.',
802             "rss2leafnode" . $self->{'msgidextra'},
803             $pathbit,
804             $str))
805             . '@'
806             . msgid_chars($host)
807             . '>');
808             }
809             # msgid_chars($str) returns $str with invalid Message-ID characters munged.
810             # Per RFC850 must be printing ascii and not < > or whitespace, but for
811             # safety reduce that a bit, in particular excluding ' and ".
812             sub msgid_chars {
813 0     0 0   my ($str) = @_;
814 0           require URI::Escape;
815 0           return URI::Escape::uri_escape_utf8 ($str, "^A-Za-z0-9\\-_.!~*/:");
816             }
817              
818             #------------------------------------------------------------------------------
819             # news posting
820             #
821             # This used to run the "rnews" program, which in leafnode 2 does some direct
822             # writing to the spool. But that requires user "news" perms, and as of the
823             # June 2007 leafnode beta it tends to be a good deal slower because it reads
824             # the whole groupinfo file. It has the advantage of not being picky about
825             # message ID hostnames, and allowing read-only groups to be filled. But
826             # apart from that plain POST seems much easier for being "server neutral".
827             #
828             # IHAVE instead of POST would be a possibility, when available, though POST
829             # is probably more accurate in the sense it's a new article coming into the
830             # news system.
831             #
832             # Net::NNTP looks at $ENV{NNTPSERVER}, $ENV{NEWSHOST} and Net::Config
833             # nntp_hosts list for the news server. Maybe could have that here too,
834             # instead of always defaulting to localhost (in $self->{'nntp_host'}).
835             # Would want to find out the name chosen to show in diagnostics though.
836              
837             # return a string "host:port", suitable for the Host arg to Net::NNTP->new
838             sub uri_to_nntp_host {
839 0     0 0   my ($uri) = @_;
840 0   0       return (non_empty($uri->host) // 'localhost') . ':' . $uri->port;
841             }
842              
843             sub nntp {
844 0     0 0   my ($self) = @_;
845             # reopen if different 'nntp_host'
846 0 0 0       if (! $self->{'nntp'}
847             || $self->{'nntp'}->host ne $self->{'nntp_host'}) {
848 0           my $host = $self->{'nntp_host'};
849 0           $self->verbose (1, __x("nntp: {host}", host => $host));
850 0           require Net::NNTP;
851 0 0         my $nntp = $self->{'nntp'}
852             = Net::NNTP->new ($host, ($self->{'verbose'} >= 2
853             ? (Debug => 1)
854             : ()));
855 0 0         if (! $nntp) {
856 0           croak __x("Cannot connect to NNTP on \"{host}\"\n", host => $host);
857             }
858 0 0         if (! $nntp->postok) {
859 0           $self->verbose (1, "Hmm, ", $nntp->host, " doesn't say \"posting ok\" ...");
860             }
861             }
862 0           return $self->{'nntp'};
863             }
864              
865             sub nntp_close {
866 0     0 0   my ($self) = @_;
867 0 0         if (my $nntp = delete $self->{'nntp'}) {
868 0 0         if (! $nntp->quit) {
869 0           say "Error closing nntp: ",$nntp->message;
870             }
871             }
872             }
873              
874             # check that $group exists in the NNTP, return 1 if so, or 0 if not
875             sub nntp_group_check {
876 0     0 0   my ($self, $group) = @_;
877 0           my $nntp = $self->nntp;
878 0 0         if (! $nntp->group($group)) {
879 0           print __x("rss2leafnode: no group \"{group}\" on host \"{host}\"
880             (See the rss2leafnode man page for notes on creating groups.)
881             ",
882             host => $nntp->host,
883             group => $group);
884 0           return 0;
885             }
886              
887 0           return 1;
888             }
889              
890             sub nntp_message_id_exists {
891 0     0 0   my ($self, $msgid) = @_;
892 0           my $ret = $self->nntp->nntpstat($msgid);
893 0 0         if ($self->{'verbose'} >= 2) {
    0          
894 0 0         $self->verbose (2, "'$msgid' ", ($ret ? 'exists already' : 'new'));
895             } elsif ($self->{'verbose'} >= 1) {
896 0 0         if ($ret) {
897 0           $self->verbose (1, ' ', __('exists already'));
898             }
899             }
900 0           return $ret;
901             }
902              
903             # post $msg to NNTP, return true if successful
904             sub nntp_post {
905 0     0 0   my ($self, $msg) = @_;
906 0           my $nntp = $self->nntp;
907 0 0         if (! $nntp->post ($msg->as_string)) {
908 0           say __x('Cannot post: {message}',
909             message => scalar($nntp->message));
910 0           return 0;
911             }
912 0           return 1;
913             }
914              
915              
916             #------------------------------------------------------------------------------
917             # HTML title
918              
919             # extra data associated against a HTTP::Response object
920             Hash::Util::FieldHash::fieldhash (my %resp_exiftool_info);
921              
922             # return hashref { Title => $str, ... }, or empty {} if no exiftool etc
923             sub resp_exiftool_info {
924 0     0 0   my ($resp) = @_;
925 0 0         defined $resp or return {};
926 0 0         if (! exists $resp_exiftool_info{$resp}) {
927 0           $resp_exiftool_info{$resp} = _resp_exiftool_info($resp);
928             ### exiftool info: $resp_exiftool_info{$resp}
929             }
930 0           return $resp_exiftool_info{$resp};
931             }
932             sub _resp_exiftool_info {
933 0     0     my ($resp) = @_;
934              
935             # Want ExifTool 8.22 to have PNG tEXt returned as utf8, but don't bother
936             # to enforce that.
937             #
938             # The returned fields from image formats with a defined charset are
939             # converted to the exiftool default "Charset" of utf8, and from other
940             # image formats the fields are bytes of something unknown. Might slightly
941             # like to know which is the case, and show raw bytes different from "bytes
942             # which ought to be utf8", but for now just Encode::decode_utf8() and let
943             # its Encode::FB_DEFAULT() put substitution chars for non-ascii non-utf8.
944             #
945 0 0         eval { require Image::ExifTool; 1 } || return {};
  0            
  0            
946 0           $resp->decode;
947 0           my $cref = $resp->content_ref;
948 0           return Image::ExifTool::ImageInfo
949             ($cref,
950             ['Title','Author','Copyright','ImageSize'], # just these tags
951             {List => 0}); # get list values as comma separated
952             }
953              
954             # $resp is a HTTP::Response, return title
955             sub html_title {
956 0     0 0   my ($resp) = @_;
957              
958             return (# for images prefer filename+size over URI::Title just filename
959 0   0       non_empty (html_title_exiftool_image($resp))
      0        
      0        
960              
961             // non_empty (html_title_urititle($resp))
962             // non_empty (html_title_exiftool($resp))
963             // $resp->title);
964             }
965             sub html_title_urititle {
966 0     0 0   my ($resp) = @_;
967 0 0         eval { require URI::Title } or return undef;
  0            
968              
969             # suppress some dodginess in URI::Title 1.82
970             local $SIG{'__WARN__'} = sub {
971 0     0     my ($msg) = @_;
972 0 0         $msg =~ /Use of uninitialized value/ or warn @_;
973 0           };
974 0           $resp->decode;
975 0   0       return URI::Title::title
976             ({ url => ($resp->request->uri // ''),
977             data => $resp->content});
978             }
979             sub html_title_exiftool_image {
980 0     0 0   my ($resp) = @_;
981 0 0         $resp->content_type =~ m{^image/} or return;
982 0 0         if (defined (my $title = html_title_exiftool($resp))) {
983 0           return $title;
984             }
985 0   0       my $info = resp_exiftool_info($resp) // return;
986             ### html_title_exiftool_image() on: $info
987 0 0         defined $info->{'ImageSize'} or return;
988 0           return $resp->filename.' '.$info->{'ImageSize'};
989             }
990             sub html_title_exiftool {
991 0     0 0   my ($resp) = @_;
992 0   0       my $title = resp_exiftool_info($resp)->{'Title'} // return;
993 0           return Encode::decode_utf8 ($title);
994             }
995              
996              
997             #------------------------------------------------------------------------------
998             # mime
999              
1000             # prepended to "X-Mailer" header
1001 1     1   6 use constant mime_mailer_extra => "RSS2Leafnode $VERSION";
  1         2  
  1         1777  
1002              
1003             # $body is a MIME::Body object, append $str to it
1004             sub mime_body_append {
1005 0     0 0   my ($body, $str) = @_;
1006 0           $str = $body->as_string . "\n" . str_ensure_newline ($str);
1007 0 0         my $IO = $body->open('w')
1008             or die "rss2leafnode: body I/O open: $!";
1009 0           $IO->print ($str);
1010 0 0         $IO->close
1011             or die "rss2leafnode: body I/O close: $!";
1012             }
1013              
1014             # if $str is not ascii then apply encode_mimewords()
1015             sub mimewords_non_ascii {
1016 0     0 0   my ($str) = @_;
1017 0 0 0       if (defined $str && ! is_ascii($str)) {
1018 0           require MIME::Words;
1019 0           $str = MIME::Words::encode_mimewords (Encode::encode_utf8($str),
1020             Charset => 'UTF-8');
1021             }
1022 0           return $str;
1023             }
1024              
1025             sub mime_build {
1026 0     0 0   my ($self, $headers, @args) = @_;
1027              
1028             # Headers in utf-8, the same as other text. The docs of
1029             # encode_mimewords() isn't clear, but seems to expect bytes of the
1030             # specified charset.
1031 0           foreach my $key (sort keys %$headers) {
1032 0           $headers->{$key}
1033             = mimewords_non_ascii(Text::Trim::trim($headers->{$key}));
1034             }
1035              
1036 0           %$headers = (%$headers, @args);
1037 0   0       $headers->{'Top'} //= 0; # default to a part not a toplevel
1038 0   0       $headers->{'Encoding'} //= '-SUGGEST';
1039              
1040 0 0         if ($headers->{'Top'}) {
1041 0           my $now822 = rfc822_time_now();
1042 0   0       $headers->{'Date'} //= $now822;
1043 0           $headers->{'Date-Received:'} = $now822;
1044             }
1045              
1046 0 0         if (utf8::is_utf8($headers->{'Data'})) {
1047 0           warn 'Oops, mime_build() data should be bytes';
1048             }
1049              
1050             # downgrade utf-8 to us-ascii if possible
1051 0 0 0       if ($headers->{'Type'} eq 'text/plain'
      0        
      0        
1052             && lc($headers->{'Charset'}||0) eq 'utf-8'
1053             && is_ascii ($headers->{'Data'})) {
1054 0           $headers->{'Charset'} = 'us-ascii';
1055              
1056             # not sure mangling text/html body content is a good idea -- would only
1057             # want it on generated html, not downloaded
1058             #
1059             # if ($headers->{'Type'} eq 'text/html') {
1060             # $headers->{'Data'} =~ s{(
1061             # }
1062             }
1063              
1064 0           @args = map {$_,$headers->{$_}} sort keys %$headers;
  0            
1065 0 0         if ($self->{'verbose'} >= 4) {
1066 0           require Data::Dumper;
1067 0           $self->verbose (4, Data::Dumper->new([\@args],['mime headers'])->Dump);
1068             }
1069              
1070 0           require MIME::Entity;
1071 0           my $top = MIME::Entity->build (Disposition => 'inline', @args);
1072              
1073 0 0 0       if ($headers->{'Top'} && ! defined $headers->{'X-Mailer:'}) {
1074 0           my $head = $top->head;
1075 0           $head->set('X-Mailer', join_non_empty (', ',
1076             $self->mime_mailer_extra,
1077             $head->get('X-Mailer')));
1078             }
1079              
1080 0           return $top;
1081             }
1082              
1083             # $resp is a HTTP::Response
1084             # Return a MIME::Entity which contains the response, and any further @headers.
1085             # If $self->{'render'} is true then render HTML to plain text.
1086             #
1087             sub mime_part_from_response {
1088 0     0 0   my ($self, $resp, @headers) = @_;
1089              
1090 0           my $content_type = $resp->content_type;
1091 0           $self->verbose (2, ' content-type: ',$content_type);
1092 0           $resp->decode;
1093 0           my $content = $resp->content; # the bytes
1094 0           my $charset = $resp->content_charset; # and their charset
1095 0           my $url = $resp->request->uri->as_string;
1096 0           my $content_md5 = $resp->header('Content-MD5');
1097              
1098 0           ($content, $content_type, $charset, my $rendered)
1099             = $self->render_maybe ($content, $content_type, $charset, $url);
1100 0 0         if ($rendered) {
1101 0           undef $content_md5;
1102             }
1103              
1104 0           return $self->mime_build
1105             ({ 'Content-Language:' => scalar($resp->header('Content-Language')),
1106             'Content-Location:' => $url,
1107             'Content-MD5:' => $content_md5,
1108             @headers,
1109             },
1110             Type => $content_type,
1111             Charset => $charset,
1112             Data => $content,
1113             Filename => $resp->filename);
1114             }
1115              
1116              
1117             # set "Lines:" header per RFC 1036
1118             # MIME::Entity 5.428 doesn't seem to have anything for this itself
1119             # this is after qp or base64, is that right? the actual message lines
1120             sub mime_entity_lines {
1121 0     0 0   my ($top) = @_;
1122 0           $top->head->set('Lines', str_count_lines ($top->stringify_body));
1123             }
1124              
1125             #------------------------------------------------------------------------------
1126             # XML::Twig stuff
1127              
1128             # Return the text of $elt and treat child elements as improperly escaped
1129             # parts of the text too.
1130             #
1131             # This is good for elements which are supposed to be HTML with

etc

1132             # escaped as <p>, but copes with feeds that don't have the necessary
1133             # escapes and thus come out with xml child elements under $elt.
1134             #
1135             # For elements which are supposed to be plain text with no markup and no
1136             # sub-elements this will at least make improper child text visible, though
1137             # it might not look very good.
1138             #
1139             # As of June 2010 http://www.drweil.com/drw/ecs/rss.xml is an example of
1140             # improperly escaped html.
1141             #
1142             # FIXME: Any need to watch out for types?
1143             #
1144             sub elt_subtext {
1145 0     0 0   my ($elt) = @_;
1146 0 0         defined $elt or return undef;
1147 0 0         if ($elt->is_text) { return $elt->text; }
  0            
1148 0           return join ('', map {_elt_subtext_with_tags($_)} $elt->children);
  0            
1149             }
1150             sub _elt_subtext_with_tags {
1151 0     0     my ($elt) = @_;
1152 0 0         defined $elt or return undef;
1153 0 0         if ($elt->is_text) { return $elt->text; }
  0            
1154 0           return ($elt->start_tag
1155 0           . join ('', map {_elt_subtext_with_tags($_)} $elt->children)
1156             . $elt->end_tag);
1157             }
1158              
1159             # $elt contains xhtml
etc sub-elements. Return a plain html string.
1160             # Prefixes like Bold are turned into plain .
1161             # This relies on the map_xmlns mapping to give prefix "xhtml:"
1162             #
1163             sub elt_xhtml_to_html {
1164 0     0 0   my ($elt) = @_;
1165              
1166             # could probably do it destructively, but just in case
1167 0           $elt = $elt->copy;
1168 0           App::RSS2Leafnode::XML::Twig::Other::elt_tree_strip_prefix ($elt, 'xhtml');
1169              
1170             # lose xmlns:xhtml="http://www.w3.org/1999/xhtml"
1171 0           $elt->strip_att('xmlns:xhtml');
1172              
1173             # something fishy turns "href" to "xhtml:href", drop any "xhtml:"
1174             # bare "href" also gets turned into atom:href as the default namespace,
1175             # drop any "atom:"
1176 0           foreach my $child ($elt->descendants) {
1177 0           foreach my $attname ($child->att_names) {
1178 0 0         if ($attname =~ /^(xhtml|atom):(.*)/) {
1179 0           $child->change_att_name($attname, $2);
1180             }
1181             }
1182             }
1183              
1184 0           my $old_pretty = $elt->set_pretty_print ('none');
1185             ### $old_pretty
1186 0           my $ret = $elt->xml_string;
1187 0           $elt->set_pretty_print ($old_pretty);
1188 0           return $ret;
1189              
1190             }
1191              
1192             # elt_content_type() returns 'text', 'html', 'xhtml' or a mime type.
1193             # If no type="" attribute the default is 'text', except for RSS
1194             # which is 'html'.
1195             #
1196             # RSS http://www.debian.org/News/weekly/dwn.en.rdf circa Feb 2010 had some
1197             # html in its , but believe that's an error (mozilla shows it as </td> </tr> <tr> <td class="h" > <a name="1198">1198</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # plain text) and that RSS is all plain text outside <description>. </td> </tr> <tr> <td class="h" > <a name="1199">1199</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="1200">1200</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <dc:type>text</dc:type> probably refers only to the nature of the item, </td> </tr> <tr> <td class="h" > <a name="1201">1201</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # not the formatting as html vs text. </td> </tr> <tr> <td class="h" > <a name="1202">1202</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="1203">1203</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @known{'/channel/item/dc:type'} = undef; </td> </tr> <tr> <td class="h" > <a name="1204">1204</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="1205">1205</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub elt_content_type { </td> </tr> <tr> <td class="h" > <a name="1206">1206</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1206-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1206-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($elt) = @_; </td> </tr> <tr> <td class="h" > <a name="1207">1207</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1207-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! defined $elt) { return undef; } </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1208">1208</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1209">1209</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1209-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1209-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined (my $type = ($elt->att('atom:type') // $elt->att('type')))) { </td> </tr> <tr> <td class="h" > <a name="1210">1210</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # type="application/xhtml+xml" at http://xmltwig.com/blog/index.atom, </td> </tr> <tr> <td class="h" > <a name="1211">1211</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # dunno if it should be just "xhtml", but recognise it anyway </td> </tr> <tr> <td class="h" > <a name="1212">1212</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1212-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($type eq 'application/xhtml+xml') { return 'xhtml'; } </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1213">1213</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $type; </td> </tr> <tr> <td class="h" > <a name="1214">1214</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1215">1215</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1215-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($elt->root->tag eq 'feed') { </td> </tr> <tr> <td class="h" > <a name="1216">1216</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 'text'; # Atom <feed> defaults to text </td> </tr> <tr> <td class="h" > <a name="1217">1217</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1218">1218</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $tag = $elt->tag; </td> </tr> <tr> <td class="h" > <a name="1219">1219</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1219-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($tag =~ /^itunes:/) { </td> </tr> <tr> <td class="h" > <a name="1220">1220</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # itunes spec is for text-only, no html markup </td> </tr> <tr> <td class="h" > <a name="1221">1221</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 'text'; </td> </tr> <tr> <td class="h" > <a name="1222">1222</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1223">1223</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1223-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1223-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($tag eq 'description' # RSS <description> is encoded html </td> </tr> <tr> <td class="h" > <a name="1224">1224</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || $tag eq 'content:encoded') { # same in content:encoded </td> </tr> <tr> <td class="h" > <a name="1225">1225</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 'html'; </td> </tr> <tr> <td class="h" > <a name="1226">1226</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1227">1227</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # other RSS is text </td> </tr> <tr> <td class="h" > <a name="1228">1228</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 'text'; </td> </tr> <tr> <td class="h" > <a name="1229">1229</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1230">1230</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1231">1231</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $elt is an XML::Twig::Elt of an RSS or Atom text element. </td> </tr> <tr> <td class="h" > <a name="1232">1232</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Atom has a type="" attribute, RSS is html. Html or xhtml are rendered to </td> </tr> <tr> <td class="h" > <a name="1233">1233</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # a single long line of plain text. </td> </tr> <tr> <td class="h" > <a name="1234">1234</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="1235">1235</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub elt_to_rendered_line { </td> </tr> <tr> <td class="h" > <a name="1236">1236</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1236-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1236-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($elt) = @_; </td> </tr> <tr> <td class="h" > <a name="1237">1237</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1237-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> defined $elt or return; </td> </tr> <tr> <td class="h" > <a name="1238">1238</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1239">1239</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $str; </td> </tr> <tr> <td class="h" > <a name="1240">1240</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $type = elt_content_type ($elt); </td> </tr> <tr> <td class="h" > <a name="1241">1241</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1241-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($type eq 'xhtml') { </td> </tr> <tr> <td class="h" > <a name="1242">1242</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $str = elt_xhtml_to_html ($elt); </td> </tr> <tr> <td class="h" > <a name="1243">1243</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $type = 'html'; </td> </tr> <tr> <td class="h" > <a name="1244">1244</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="1245">1245</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $str = elt_subtext($elt); </td> </tr> <tr> <td class="h" > <a name="1246">1246</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1247">1247</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1247-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($type eq 'html') { </td> </tr> <tr> <td class="h" > <a name="1248">1248</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $str = html_to_rendered_line($str); </td> </tr> <tr> <td class="h" > <a name="1249">1249</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1250">1250</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # plain 'text' or anything unrecognised collapsed too </td> </tr> <tr> <td class="h" > <a name="1251">1251</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return non_empty(collapse_whitespace($str)); </td> </tr> <tr> <td class="h" > <a name="1252">1252</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1253">1253</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1254">1254</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub html_to_rendered_line { </td> </tr> <tr> <td class="h" > <a name="1255">1255</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1255-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1255-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($html) = @_; </td> </tr> <tr> <td class="h" > <a name="1256">1256</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require HTML::FormatText; </td> </tr> <tr> <td class="h" > <a name="1257">1257</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return collapse_whitespace </td> </tr> <tr> <td class="h" > <a name="1258">1258</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (HTML::FormatText->format_string ($html, </td> </tr> <tr> <td class="h" > <a name="1259">1259</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> leftmargin => 0, </td> </tr> <tr> <td class="h" > <a name="1260">1260</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> rightmargin => 999)); </td> </tr> <tr> <td class="h" > <a name="1261">1261</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1262">1262</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1263">1263</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1264">1264</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> #------------------------------------------------------------------------------ </td> </tr> <tr> <td class="h" > <a name="1265">1265</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # XML::RSS::Timing </td> </tr> <tr> <td class="h" > <a name="1266">1266</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1267">1267</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub twig_to_timingfields { </td> </tr> <tr> <td class="h" > <a name="1268">1268</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1268-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1268-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $twig) = @_; </td> </tr> <tr> <td class="h" > <a name="1269">1269</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1269-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return if ! defined $twig; </td> </tr> <tr> <td class="h" > <a name="1270">1270</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $root = $twig->root; </td> </tr> <tr> <td class="h" > <a name="1271">1271</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my %timingfields; </td> </tr> <tr> <td class="h" > <a name="1272">1272</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1273">1273</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1273-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (my $ttl = $root->first_descendant('ttl')) { </td> </tr> <tr> <td class="h" > <a name="1274">1274</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $timingfields{'ttl'} = $ttl->trimmed_text; </td> </tr> <tr> <td class="h" > <a name="1275">1275</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1276">1276</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1276-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (my $skipHours = $root->first_descendant('skipHours')) { </td> </tr> <tr> <td class="h" > <a name="1277">1277</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $timingfields{'skipHours'} = [map {$_->trimmed_text} $skipHours->children('hour')]; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1278">1278</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1279">1279</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1279-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (my $skipDays = $root->first_descendant('skipDays')) { </td> </tr> <tr> <td class="h" > <a name="1280">1280</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $timingfields{'skipDays'} = [map {$_->trimmed_text} $skipDays->children('day')]; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1281">1281</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1282">1282</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1283">1283</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # "syn:updatePeriod" etc </td> </tr> <tr> <td class="h" > <a name="1284">1284</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $key (qw(updatePeriod updateFrequency updateBase)) { </td> </tr> <tr> <td class="h" > <a name="1285">1285</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1285-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (my $update = $root->first_descendant("syn:$key")) { </td> </tr> <tr> <td class="h" > <a name="1286">1286</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $timingfields{$key} = $update->trimmed_text; </td> </tr> <tr> <td class="h" > <a name="1287">1287</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1288">1288</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1289">1289</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1289-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($self->{'verbose'} >= 2) { </td> </tr> <tr> <td class="h" > <a name="1290">1290</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require Data::Dumper; </td> </tr> <tr> <td class="h" > <a name="1291">1291</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, </td> </tr> <tr> <td class="h" > <a name="1292">1292</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Data::Dumper->new([\%timingfields],['timingfields']) </td> </tr> <tr> <td class="h" > <a name="1293">1293</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ->Indent(1)->Sortkeys(1)->Dump); </td> </tr> <tr> <td class="h" > <a name="1294">1294</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1295">1295</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1295-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! %timingfields) { </td> </tr> <tr> <td class="h" > <a name="1296">1296</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return; # no info </td> </tr> <tr> <td class="h" > <a name="1297">1297</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1298">1298</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1299">1299</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # if XML::RSS::Timing doesn't like the values then don't record them </td> </tr> <tr> <td class="h" > <a name="1300">1300</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1300-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return unless $self->timingfields_to_timing(\%timingfields); </td> </tr> <tr> <td class="h" > <a name="1301">1301</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1302">1302</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return \%timingfields; </td> </tr> <tr> <td class="h" > <a name="1303">1303</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1304">1304</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @known{qw(/channel/skipDays </td> </tr> <tr> <td class="h" > <a name="1305">1305</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/skipDays/day </td> </tr> <tr> <td class="h" > <a name="1306">1306</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/skipHours </td> </tr> <tr> <td class="h" > <a name="1307">1307</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/skipHours/hour </td> </tr> <tr> <td class="h" > <a name="1308">1308</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/ttl </td> </tr> <tr> <td class="h" > <a name="1309">1309</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/syn:updateBase </td> </tr> <tr> <td class="h" > <a name="1310">1310</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/syn:updatePeriod </td> </tr> <tr> <td class="h" > <a name="1311">1311</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/syn:updateFrequency)} = (); </td> </tr> <tr> <td class="h" > <a name="1312">1312</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1313">1313</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return an XML::RSS::Timing object, or undef </td> </tr> <tr> <td class="h" > <a name="1314">1314</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub timingfields_to_timing { </td> </tr> <tr> <td class="h" > <a name="1315">1315</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1315-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1315-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $timingfields) = @_; </td> </tr> <tr> <td class="h" > <a name="1316">1316</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1316-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $timingfields // return undef; </td> </tr> <tr> <td class="h" > <a name="1317">1317</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1318">1318</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1318-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> eval { require XML::RSS::Timing } || return undef; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1319">1319</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $timing = XML::RSS::Timing->new; </td> </tr> <tr> <td class="h" > <a name="1320">1320</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $timing->use_exceptions(0); </td> </tr> <tr> <td class="h" > <a name="1321">1321</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> while (my ($key, $value) = each %$timingfields) { </td> </tr> <tr> <td class="h" > <a name="1322">1322</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1322-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (ref $value) { </td> </tr> <tr> <td class="h" > <a name="1323">1323</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $timing->$key (@$value); </td> </tr> <tr> <td class="h" > <a name="1324">1324</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="1325">1325</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $timing->$key ($value); </td> </tr> <tr> <td class="h" > <a name="1326">1326</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1327">1327</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1328">1328</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1328-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (my @complaints = $timing->complaints) { </td> </tr> <tr> <td class="h" > <a name="1329">1329</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> say __x('XML::RSS::Timing complains about {url}', </td> </tr> <tr> <td class="h" > <a name="1330">1330</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> url => $self->{'uri'}); </td> </tr> <tr> <td class="h" > <a name="1331">1331</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $complaint (@complaints) { </td> </tr> <tr> <td class="h" > <a name="1332">1332</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> say " $complaint"; </td> </tr> <tr> <td class="h" > <a name="1333">1333</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1334">1334</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return undef; </td> </tr> <tr> <td class="h" > <a name="1335">1335</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1336">1336</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $timing; </td> </tr> <tr> <td class="h" > <a name="1337">1337</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1338">1338</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1339">1339</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1340">1340</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> #------------------------------------------------------------------------------ </td> </tr> <tr> <td class="h" > <a name="1341">1341</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # rss2leafnode.status file </td> </tr> <tr> <td class="h" > <a name="1342">1342</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1343">1343</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $self->{'global_status'} is a hashref containing entries URL => STATUS, </td> </tr> <tr> <td class="h" > <a name="1344">1344</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # where URL is a string and STATUS is a sub-hashref of information </td> </tr> <tr> <td class="h" > <a name="1345">1345</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1346">1346</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1346-1"> 1 </a> </td> <td >   </td> <td > 6 </td> <td class="s"> use constant STATUS_EXPIRE_DAYS => 45; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 1 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 3407 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1347">1347</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1348">1348</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # read $status_filename into $self->{'global_status'} </td> </tr> <tr> <td class="h" > <a name="1349">1349</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub status_read { </td> </tr> <tr> <td class="h" > <a name="1350">1350</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1350-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1350-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self) = @_; </td> </tr> <tr> <td class="h" > <a name="1351">1351</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->{'global_status'} = {}; </td> </tr> <tr> <td class="h" > <a name="1352">1352</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $status_filename = $self->status_filename; </td> </tr> <tr> <td class="h" > <a name="1353">1353</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, 'read status: ', $status_filename); </td> </tr> <tr> <td class="h" > <a name="1354">1354</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1355">1355</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $! = 0; </td> </tr> <tr> <td class="h" > <a name="1356">1356</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $global_status = do $status_filename; </td> </tr> <tr> <td class="h" > <a name="1357">1357</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1357-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! defined $global_status) { </td> </tr> <tr> <td class="h" > <a name="1358">1358</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1358-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($! == POSIX::ENOENT()) { </td> </tr> <tr> <td class="h" > <a name="1359">1359</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, "status file doesn't exist"); </td> </tr> <tr> <td class="h" > <a name="1360">1360</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="1361">1361</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> say "rss2leafnode: error in $status_filename\n$@"; </td> </tr> <tr> <td class="h" > <a name="1362">1362</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> say "ignoring that file"; </td> </tr> <tr> <td class="h" > <a name="1363">1363</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1364">1364</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $global_status = {}; </td> </tr> <tr> <td class="h" > <a name="1365">1365</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1366">1366</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->{'global_status'} = $global_status; </td> </tr> <tr> <td class="h" > <a name="1367">1367</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1368">1368</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1369">1369</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # delete old entries from $self->{'global_status'} </td> </tr> <tr> <td class="h" > <a name="1370">1370</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub status_prune { </td> </tr> <tr> <td class="h" > <a name="1371">1371</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1371-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1371-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self) = @_; </td> </tr> <tr> <td class="h" > <a name="1372">1372</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1372-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $global_status = $self->{'global_status'} // return; </td> </tr> <tr> <td class="h" > <a name="1373">1373</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $pruned = 0; </td> </tr> <tr> <td class="h" > <a name="1374">1374</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $old_time = time() - STATUS_EXPIRE_DAYS * 86400; </td> </tr> <tr> <td class="h" > <a name="1375">1375</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $key (keys %$global_status) { </td> </tr> <tr> <td class="h" > <a name="1376">1376</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1376-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($global_status->{$key}->{'status-time'} < $old_time) { </td> </tr> <tr> <td class="h" > <a name="1377">1377</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, __x("discard old status {url}\n", url => $key)); </td> </tr> <tr> <td class="h" > <a name="1378">1378</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> delete $global_status->{$key}; </td> </tr> <tr> <td class="h" > <a name="1379">1379</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $pruned++; </td> </tr> <tr> <td class="h" > <a name="1380">1380</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1381">1381</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1382">1382</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1382-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($pruned) { </td> </tr> <tr> <td class="h" > <a name="1383">1383</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (1, __xn("discard {count} old status entry\n", </td> </tr> <tr> <td class="h" > <a name="1384">1384</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> "discard {count} old status entries\n", </td> </tr> <tr> <td class="h" > <a name="1385">1385</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $pruned, </td> </tr> <tr> <td class="h" > <a name="1386">1386</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> count => $pruned)); </td> </tr> <tr> <td class="h" > <a name="1387">1387</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1388">1388</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1389">1389</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1390">1390</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # save $self->{'global_status'} into the $status_filename </td> </tr> <tr> <td class="h" > <a name="1391">1391</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub status_save { </td> </tr> <tr> <td class="h" > <a name="1392">1392</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1392-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1392-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $status) = @_; </td> </tr> <tr> <td class="h" > <a name="1393">1393</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $status->{'status-time'} = time(); </td> </tr> <tr> <td class="h" > <a name="1394">1394</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1394-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($status->{'timingfields'}) { </td> </tr> <tr> <td class="h" > <a name="1395">1395</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $status->{'timingfields'}->{'lastPolled'} = $status->{'status-time'}; </td> </tr> <tr> <td class="h" > <a name="1396">1396</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1397">1397</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1398">1398</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->status_prune; </td> </tr> <tr> <td class="h" > <a name="1399">1399</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1400">1400</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require Data::Dumper; </td> </tr> <tr> <td class="h" > <a name="1401">1401</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $str = Data::Dumper->new([$self->{'global_status'}],['global_status']) </td> </tr> <tr> <td class="h" > <a name="1402">1402</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ->Indent(1)->Sortkeys(1)->Terse(1)->Useqq(1)->Dump; </td> </tr> <tr> <td class="h" > <a name="1403">1403</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $str = <<"HERE"; </td> </tr> <tr> <td class="h" > <a name="1404">1404</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # rss2leafnode status file -- automatically generated -- DO NOT EDIT </td> </tr> <tr> <td class="h" > <a name="1405">1405</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="1406">1406</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # (If there seems to be something very wrong then you can delete this file </td> </tr> <tr> <td class="h" > <a name="1407">1407</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # and it'll be started afresh on the next run.) </td> </tr> <tr> <td class="h" > <a name="1408">1408</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1409">1409</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $str </td> </tr> <tr> <td class="h" > <a name="1410">1410</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1411">1411</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1412">1412</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Local variables: </td> </tr> <tr> <td class="h" > <a name="1413">1413</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # mode: perl-mode </td> </tr> <tr> <td class="h" > <a name="1414">1414</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # End: </td> </tr> <tr> <td class="h" > <a name="1415">1415</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> HERE </td> </tr> <tr> <td class="h" > <a name="1416">1416</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1417">1417</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $status_filename = $self->status_filename; </td> </tr> <tr> <td class="h" > <a name="1418">1418</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $out; </td> </tr> <tr> <td class="h" > <a name="1419">1419</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1419-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1419-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (open $out, '>', $status_filename </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1420">1420</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> and print $out $str </td> </tr> <tr> <td class="h" > <a name="1421">1421</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> and close $out) </td> </tr> <tr> <td class="h" > <a name="1422">1422</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> or croak "rss2leafnode: cannot write to $status_filename: $!\n"; </td> </tr> <tr> <td class="h" > <a name="1423">1423</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1424">1424</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1425">1425</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return a hashref which has status information about $url, or undef if </td> </tr> <tr> <td class="h" > <a name="1426">1426</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # nothing recorded about $url </td> </tr> <tr> <td class="h" > <a name="1427">1427</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub status_geturl { </td> </tr> <tr> <td class="h" > <a name="1428">1428</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1428-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1428-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $url) = @_; </td> </tr> <tr> <td class="h" > <a name="1429">1429</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1429-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->status_read if ! $self->{'global_status'}; </td> </tr> <tr> <td class="h" > <a name="1430">1430</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1430-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! $self->{'global_status'}->{$url}) { </td> </tr> <tr> <td class="h" > <a name="1431">1431</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->{'global_status'}->{$url} = { 'status-time' => time() }; </td> </tr> <tr> <td class="h" > <a name="1432">1432</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1433">1433</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $self->{'global_status'}->{$url}; </td> </tr> <tr> <td class="h" > <a name="1434">1434</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1435">1435</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1436">1436</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $resp is a HTTP::Response object from retrieving $url. </td> </tr> <tr> <td class="h" > <a name="1437">1437</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Optional $twig is an XML::Twig. </td> </tr> <tr> <td class="h" > <a name="1438">1438</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Record against $url any ETag, Last-Modified and ttl from $resp and $twig. </td> </tr> <tr> <td class="h" > <a name="1439">1439</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # If $resp is an error return, or is undef, then do nothing. </td> </tr> <tr> <td class="h" > <a name="1440">1440</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub status_etagmod_resp { </td> </tr> <tr> <td class="h" > <a name="1441">1441</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1441-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1441-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $url, $resp, $twig) = @_; </td> </tr> <tr> <td class="h" > <a name="1442">1442</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1442-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1442-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($resp && $resp->is_success) { </td> </tr> <tr> <td class="h" > <a name="1443">1443</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $status = $self->status_geturl ($url); </td> </tr> <tr> <td class="h" > <a name="1444">1444</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $status->{'Last-Modified'} = $resp->header('Last-Modified'); </td> </tr> <tr> <td class="h" > <a name="1445">1445</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $status->{'ETag'} = $resp->header('ETag'); </td> </tr> <tr> <td class="h" > <a name="1446">1446</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $status->{'timingfields'} = $self->twig_to_timingfields ($twig); </td> </tr> <tr> <td class="h" > <a name="1447">1447</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1448">1448</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1448-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1448-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! defined $status->{'ETag'} && ! defined $status->{'Last-Modified'}) { </td> </tr> <tr> <td class="h" > <a name="1449">1449</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (1, " no ETag or Last-Modified"); </td> </tr> <tr> <td class="h" > <a name="1450">1450</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1451">1451</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1451-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined (my $comments_count = $self->{'comments_count'})) { </td> </tr> <tr> <td class="h" > <a name="1452">1452</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $status->{'comments_count'} = $comments_count; </td> </tr> <tr> <td class="h" > <a name="1453">1453</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1454">1454</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1455">1455</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1455-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($twig) { </td> </tr> <tr> <td class="h" > <a name="1456">1456</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # record previously applied newest option </td> </tr> <tr> <td class="h" > <a name="1457">1457</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $status->{'rss_newest_only'} = $self->{'rss_newest_only'}; </td> </tr> <tr> <td class="h" > <a name="1458">1458</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="1459">1459</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # if (rss_newest_cmp($self,$status) > 0) { </td> </tr> <tr> <td class="h" > <a name="1460">1460</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # # the newest number increases </td> </tr> <tr> <td class="h" > <a name="1461">1461</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # } </td> </tr> <tr> <td class="h" > <a name="1462">1462</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1463">1463</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $key (keys %$status) { </td> </tr> <tr> <td class="h" > <a name="1464">1464</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1464-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! defined $status->{$key}) { delete $status->{$key} } </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1465">1465</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1466">1466</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->status_save($status); </td> </tr> <tr> <td class="h" > <a name="1467">1467</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1468">1468</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1469">1469</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1470">1470</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # update recorded status for a $url with unchanged contents </td> </tr> <tr> <td class="h" > <a name="1471">1471</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub status_unchanged { </td> </tr> <tr> <td class="h" > <a name="1472">1472</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1472-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1472-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $url) = @_; </td> </tr> <tr> <td class="h" > <a name="1473">1473</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (1, ' ', __('unchanged')); </td> </tr> <tr> <td class="h" > <a name="1474">1474</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->status_save ($self->status_geturl ($url)); </td> </tr> <tr> <td class="h" > <a name="1475">1475</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1476">1476</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1477">1477</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $req is a HTTP::Request object. </td> </tr> <tr> <td class="h" > <a name="1478">1478</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Add "If-None-Match" and/or "If-Modified-Since" headers to it based on what </td> </tr> <tr> <td class="h" > <a name="1479">1479</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # the status file has recorded from when we last fetched the url in $req. </td> </tr> <tr> <td class="h" > <a name="1480">1480</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Return 1 to download, 0 if nothing expected yet by RSS timing fields </td> </tr> <tr> <td class="h" > <a name="1481">1481</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="1482">1482</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub status_etagmod_req { </td> </tr> <tr> <td class="h" > <a name="1483">1483</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1483-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1483-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $req, $for_rss) = @_; </td> </tr> <tr> <td class="h" > <a name="1484">1484</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1484-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->{'global_status'} or $self->status_read; </td> </tr> <tr> <td class="h" > <a name="1485">1485</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1486">1486</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $url = $req->uri->as_string; </td> </tr> <tr> <td class="h" > <a name="1487">1487</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $status = $self->{'global_status'}->{$url} </td> </tr> <tr> <td class="h" > <a name="1488">1488</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1488-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // do { </td> </tr> <tr> <td class="h" > <a name="1489">1489</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, __x("no status info for {url}\n", url => $url)); </td> </tr> <tr> <td class="h" > <a name="1490">1490</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 1; # want download </td> </tr> <tr> <td class="h" > <a name="1491">1491</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> }; </td> </tr> <tr> <td class="h" > <a name="1492">1492</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1493">1493</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1493-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($for_rss) { </td> </tr> <tr> <td class="h" > <a name="1494">1494</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # if status says the last download was for only a certain number of </td> </tr> <tr> <td class="h" > <a name="1495">1495</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # newest, then force a re-download if that option now different </td> </tr> <tr> <td class="h" > <a name="1496">1496</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1496-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! str_equal($self->{'rss_newest_only'}, </td> </tr> <tr> <td class="h" > <a name="1497">1497</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $status->{'rss_newest_only'})) { </td> </tr> <tr> <td class="h" > <a name="1498">1498</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 1; # want download </td> </tr> <tr> <td class="h" > <a name="1499">1499</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1500">1500</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1501">1501</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1502">1502</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1502-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (my $timing = $self->timingfields_to_timing ($status->{'timingfields'})) { </td> </tr> <tr> <td class="h" > <a name="1503">1503</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $next = $timing->nextUpdate; </td> </tr> <tr> <td class="h" > <a name="1504">1504</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $now = time(); </td> </tr> <tr> <td class="h" > <a name="1505">1505</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1505-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($next > $now) { </td> </tr> <tr> <td class="h" > <a name="1506">1506</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (1, ' ', </td> </tr> <tr> <td class="h" > <a name="1507">1507</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> __x('timing: next update {time} (local time)', </td> </tr> <tr> <td class="h" > <a name="1508">1508</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> time => POSIX::strftime ("%H:%M:%S %a %d %b %Y", </td> </tr> <tr> <td class="h" > <a name="1509">1509</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> localtime($next)))); </td> </tr> <tr> <td class="h" > <a name="1510">1510</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1510-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1510-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (eval 'use Time::Duration::Locale; 1' </td> </tr> <tr> <td class="h" > <a name="1511">1511</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || eval 'use Time::Duration; 1') { </td> </tr> <tr> <td class="h" > <a name="1512">1512</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (1, ' ', __x('which is {duration} from now', </td> </tr> <tr> <td class="h" > <a name="1513">1513</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> duration => duration($next-$now))); </td> </tr> <tr> <td class="h" > <a name="1514">1514</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1515">1515</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 0; # no update yet </td> </tr> <tr> <td class="h" > <a name="1516">1516</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1517">1517</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1518">1518</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1518-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined (my $lastmod = $status->{'Last-Modified'})) { </td> </tr> <tr> <td class="h" > <a name="1519">1519</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $req->header('If-Modified-Since' => $lastmod); </td> </tr> <tr> <td class="h" > <a name="1520">1520</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1521">1521</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1521-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined (my $etag = $status->{'ETag'})) { </td> </tr> <tr> <td class="h" > <a name="1522">1522</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $req->header('If-None-Match' => $etag); </td> </tr> <tr> <td class="h" > <a name="1523">1523</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1524">1524</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 1; </td> </tr> <tr> <td class="h" > <a name="1525">1525</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1526">1526</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1527">1527</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return -1 if x<y, 0 if x==y, or 1 if x>1 </td> </tr> <tr> <td class="h" > <a name="1528">1528</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # sub rss_newest_cmp { </td> </tr> <tr> <td class="h" > <a name="1529">1529</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # my ($x, $y) = @_; </td> </tr> <tr> <td class="h" > <a name="1530">1530</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # if ($x->{'rss_newest_only'}) { </td> </tr> <tr> <td class="h" > <a name="1531">1531</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # if (! $y->{'rss_newest_only'}) { </td> </tr> <tr> <td class="h" > <a name="1532">1532</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return -1; # x finite, y infinite </td> </tr> <tr> <td class="h" > <a name="1533">1533</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # } </td> </tr> <tr> <td class="h" > <a name="1534">1534</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # # x and y finite </td> </tr> <tr> <td class="h" > <a name="1535">1535</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return ($x->{'rss_newest_only'} <=> $y->{'rss_newest_only'}); </td> </tr> <tr> <td class="h" > <a name="1536">1536</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # } else { </td> </tr> <tr> <td class="h" > <a name="1537">1537</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # # x infinite, so 1 if y finite, 0 if y infinite too </td> </tr> <tr> <td class="h" > <a name="1538">1538</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return !! $y->{'rss_newest_only'}; </td> </tr> <tr> <td class="h" > <a name="1539">1539</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # } </td> </tr> <tr> <td class="h" > <a name="1540">1540</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # } </td> </tr> <tr> <td class="h" > <a name="1541">1541</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub str_equal { </td> </tr> <tr> <td class="h" > <a name="1542">1542</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1542-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1542-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($x, $y) = @_; </td> </tr> <tr> <td class="h" > <a name="1543">1543</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1543-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return ((defined $x && defined $y && $x eq $y) </td> </tr> <tr> <td class="h" > <a name="1544">1544</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || (! defined $x && ! defined $y)); </td> </tr> <tr> <td class="h" > <a name="1545">1545</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1546">1546</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1547">1547</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> #------------------------------------------------------------------------------ </td> </tr> <tr> <td class="h" > <a name="1548">1548</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # render html </td> </tr> <tr> <td class="h" > <a name="1549">1549</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1550">1550</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $content_type is a string like "text/html" or "text/plain". </td> </tr> <tr> <td class="h" > <a name="1551">1551</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $content is data as raw bytes. </td> </tr> <tr> <td class="h" > <a name="1552">1552</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $charset is the character set of those bytes, eg. "utf-8". </td> </tr> <tr> <td class="h" > <a name="1553">1553</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="1554">1554</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # If the $render option is set, and $content_type is 'text/html', then </td> </tr> <tr> <td class="h" > <a name="1555">1555</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # render $content down to 'text/plain', using either HTML::FormatText or </td> </tr> <tr> <td class="h" > <a name="1556">1556</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Lynx. </td> </tr> <tr> <td class="h" > <a name="1557">1557</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # The return is a new triplet ($content, $content_type, $charset). </td> </tr> <tr> <td class="h" > <a name="1558">1558</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="1559">1559</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub render_maybe { </td> </tr> <tr> <td class="h" > <a name="1560">1560</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1560-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1560-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $content, $content_type, $charset, $base_url) = @_; </td> </tr> <tr> <td class="h" > <a name="1561">1561</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $rendered = 0; </td> </tr> <tr> <td class="h" > <a name="1562">1562</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1562-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1562-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($self->{'render'} && $content_type eq 'text/html') { </td> </tr> <tr> <td class="h" > <a name="1563">1563</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1564">1564</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $class = $self->{'render'}; </td> </tr> <tr> <td class="h" > <a name="1565">1565</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1565-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($class !~ /^HTML::/) { $class = "HTML::FormatText::\u$class"; } </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1566">1566</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $class =~ s/::1$//; # "::1" is $render=1 for plain HTML::FormatText </td> </tr> <tr> <td class="h" > <a name="1567">1567</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require Module::Load; </td> </tr> <tr> <td class="h" > <a name="1568">1568</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Module::Load::load ($class); </td> </tr> <tr> <td class="h" > <a name="1569">1569</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1570">1570</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1570-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($class =~ /^HTML::FormatText($|::WithLinks)/) { </td> </tr> <tr> <td class="h" > <a name="1571">1571</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Believe HTML::FormatText (as of version 2.04) doesn't know much </td> </tr> <tr> <td class="h" > <a name="1572">1572</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # about input or output charsets, but it can be tricked into getting </td> </tr> <tr> <td class="h" > <a name="1573">1573</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # pretty reasonable results by putting wide chars through it. </td> </tr> <tr> <td class="h" > <a name="1574">1574</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Likewise HTML::FormatText::WithLinks (as of version 0.11). </td> </tr> <tr> <td class="h" > <a name="1575">1575</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="1576">1576</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # FIXME: decode() can error out on bad charset </td> </tr> <tr> <td class="h" > <a name="1577">1577</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $content = Encode::decode ($charset, $content); </td> </tr> <tr> <td class="h" > <a name="1578">1578</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local $SIG{'__WARN__'} = \&_warn_suppress_unknown_base; </td> </tr> <tr> <td class="h" > <a name="1579">1579</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $content = $class->format_string </td> </tr> <tr> <td class="h" > <a name="1580">1580</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ($content, </td> </tr> <tr> <td class="h" > <a name="1581">1581</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> base => $base_url, </td> </tr> <tr> <td class="h" > <a name="1582">1582</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> leftmargin => 0, </td> </tr> <tr> <td class="h" > <a name="1583">1583</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> rightmargin => $self->{'render_width'}); </td> </tr> <tr> <td class="h" > <a name="1584">1584</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $content = Encode::encode_utf8 ($content); </td> </tr> <tr> <td class="h" > <a name="1585">1585</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1586">1586</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="1587">1587</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # HTML::FormatExternal style charset specs </td> </tr> <tr> <td class="h" > <a name="1588">1588</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $content = $class->format_string </td> </tr> <tr> <td class="h" > <a name="1589">1589</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ($content, </td> </tr> <tr> <td class="h" > <a name="1590">1590</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> base => $base_url, </td> </tr> <tr> <td class="h" > <a name="1591">1591</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> leftmargin => 0, </td> </tr> <tr> <td class="h" > <a name="1592">1592</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> rightmargin => $self->{'render_width'}, </td> </tr> <tr> <td class="h" > <a name="1593">1593</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> input_charset => $charset, </td> </tr> <tr> <td class="h" > <a name="1594">1594</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> output_charset => 'utf-8'); </td> </tr> <tr> <td class="h" > <a name="1595">1595</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1596">1596</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $charset = 'UTF-8'; </td> </tr> <tr> <td class="h" > <a name="1597">1597</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $content_type = 'text/plain'; </td> </tr> <tr> <td class="h" > <a name="1598">1598</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $rendered = 1; </td> </tr> <tr> <td class="h" > <a name="1599">1599</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1600">1600</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return ($content, $content_type, $charset, $rendered); </td> </tr> <tr> <td class="h" > <a name="1601">1601</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1602">1602</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub _warn_suppress_unknown_base { </td> </tr> <tr> <td class="h" > <a name="1603">1603</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1603-1"> 0 </a> </td> <td >   </td> <td >   </td> <td class="s"> my ($msg) = @_; </td> </tr> <tr> <td class="h" > <a name="1604">1604</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1604-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $msg =~ /^Unknown configure option 'base'/ </td> </tr> <tr> <td class="h" > <a name="1605">1605</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> or warn $msg; </td> </tr> <tr> <td class="h" > <a name="1606">1606</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1607">1607</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1608">1608</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $str is a wide-char string of text </td> </tr> <tr> <td class="h" > <a name="1609">1609</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub text_wrap { </td> </tr> <tr> <td class="h" > <a name="1610">1610</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1610-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1610-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $str, $prefix) = @_; </td> </tr> <tr> <td class="h" > <a name="1611">1611</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1611-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! defined $prefix) { $prefix = ''; } </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1612">1612</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require Text::WrapI18N; </td> </tr> <tr> <td class="h" > <a name="1613">1613</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local $Text::WrapI18N::columns = $self->{'render_width'} + 1; </td> </tr> <tr> <td class="h" > <a name="1614">1614</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local $Text::WrapI18N::unexpand = 0; # no tabs in output </td> </tr> <tr> <td class="h" > <a name="1615">1615</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local $Text::WrapI18N::huge = 'overflow'; # don't break long words </td> </tr> <tr> <td class="h" > <a name="1616">1616</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $str =~ tr/\n/ /; </td> </tr> <tr> <td class="h" > <a name="1617">1617</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1617-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $second_prefix = (length($prefix) ? ' 'x(length($prefix)+2) : ''); </td> </tr> <tr> <td class="h" > <a name="1618">1618</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return Text::WrapI18N::wrap($prefix, $second_prefix, $str); </td> </tr> <tr> <td class="h" > <a name="1619">1619</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1620">1620</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1621">1621</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> #------------------------------------------------------------------------------ </td> </tr> <tr> <td class="h" > <a name="1622">1622</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Face icons </td> </tr> <tr> <td class="h" > <a name="1623">1623</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1624">1624</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $item is an XML::Twig::Elt of an RSS or Atom item </td> </tr> <tr> <td class="h" > <a name="1625">1625</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return a string value for the Face: header, or undef if no icon </td> </tr> <tr> <td class="h" > <a name="1626">1626</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub item_to_face { </td> </tr> <tr> <td class="h" > <a name="1627">1627</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1627-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1627-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $item) = @_; </td> </tr> <tr> <td class="h" > <a name="1628">1628</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1628-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->{'get_icon'} || return; </td> </tr> <tr> <td class="h" > <a name="1629">1629</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1629-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my ($uri, $width, $height) = $self->item_image_uwh ($item) </td> </tr> <tr> <td class="h" > <a name="1630">1630</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> or return; </td> </tr> <tr> <td class="h" > <a name="1631">1631</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1631-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->face_wh_ok ($width, $height) || return; </td> </tr> <tr> <td class="h" > <a name="1632">1632</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $self->download_face ($uri, $width, $height); </td> </tr> <tr> <td class="h" > <a name="1633">1633</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1634">1634</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1635">1635</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $item is an XML::Twig::Elt of an RSS or Atom item </td> </tr> <tr> <td class="h" > <a name="1636">1636</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return values ($uri, $width, $height) of the <image> etc from it </td> </tr> <tr> <td class="h" > <a name="1637">1637</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="1638">1638</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub item_image_uwh { </td> </tr> <tr> <td class="h" > <a name="1639">1639</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1639-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1639-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $item) = @_; </td> </tr> <tr> <td class="h" > <a name="1640">1640</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### item_image_uwh() ... </td> </tr> <tr> <td class="h" > <a name="1641">1641</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1642">1642</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $where ($item, </td> </tr> <tr> <td class="h" > <a name="1643">1643</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> item_to_channel($item)) { </td> </tr> <tr> <td class="h" > <a name="1644">1644</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### image text: $where->first_child_text('image') </td> </tr> <tr> <td class="h" > <a name="1645">1645</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1646">1646</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # identi.ca </td> </tr> <tr> <td class="h" > <a name="1647">1647</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1647-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (my $actor = $where->first_child('activity:actor')) { </td> </tr> <tr> <td class="h" > <a name="1648">1648</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my ($url, $width, $height); </td> </tr> <tr> <td class="h" > <a name="1649">1649</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $link_elt ($actor->children('link')) { </td> </tr> <tr> <td class="h" > <a name="1650">1650</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1650-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1650-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ($link_elt->att('rel')||$link_elt->att('atom:rel')||'') </td> </tr> <tr> <td class="h" > <a name="1651">1651</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> eq 'avatar' or next; </td> </tr> <tr> <td class="h" > <a name="1652">1652</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1652-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $url = $link_elt->att('href') // $link_elt->att('atom:href') // next; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1653">1653</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $this_width = $link_elt->att('media:width'); </td> </tr> <tr> <td class="h" > <a name="1654">1654</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1654-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1654-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> next if (defined $width </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1655">1655</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> && defined $this_width </td> </tr> <tr> <td class="h" > <a name="1656">1656</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> && $width < $this_width); # prefer smallest </td> </tr> <tr> <td class="h" > <a name="1657">1657</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $url = App::RSS2Leafnode::XML::Twig::Other::elt_xml_based_uri ($link_elt, $url); </td> </tr> <tr> <td class="h" > <a name="1658">1658</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1658-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $width = ($this_width || 0); </td> </tr> <tr> <td class="h" > <a name="1659">1659</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1659-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $height = ($link_elt->att('media:height') || 0); </td> </tr> <tr> <td class="h" > <a name="1660">1660</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### $url </td> </tr> <tr> <td class="h" > <a name="1661">1661</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### $width </td> </tr> <tr> <td class="h" > <a name="1662">1662</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### $height </td> </tr> <tr> <td class="h" > <a name="1663">1663</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1664">1664</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1664-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined $url) { </td> </tr> <tr> <td class="h" > <a name="1665">1665</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return ($url, $width, $height); </td> </tr> <tr> <td class="h" > <a name="1666">1666</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1667">1667</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1668">1668</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1669">1669</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # RSS </td> </tr> <tr> <td class="h" > <a name="1670">1670</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <image> </td> </tr> <tr> <td class="h" > <a name="1671">1671</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <url>foo.png</url> </td> </tr> <tr> <td class="h" > <a name="1672">1672</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <width>...</width> optional </td> </tr> <tr> <td class="h" > <a name="1673">1673</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <height>...</height> optional </td> </tr> <tr> <td class="h" > <a name="1674">1674</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </image> </td> </tr> <tr> <td class="h" > <a name="1675">1675</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1675-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (my $image_elt = $where->first_child('image')) { </td> </tr> <tr> <td class="h" > <a name="1676">1676</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $url_elt; # XML::Twig::Elt where the url came from </td> </tr> <tr> <td class="h" > <a name="1677">1677</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $url; # url string </td> </tr> <tr> <td class="h" > <a name="1678">1678</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1678-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($url_elt = $image_elt->first_child('url')) { </td> </tr> <tr> <td class="h" > <a name="1679">1679</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $url = $url_elt->trimmed_text; </td> </tr> <tr> <td class="h" > <a name="1680">1680</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="1681">1681</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Cooper Hewitt museum http://blog.cooperhewitt.org/rss/?limit=10 </td> </tr> <tr> <td class="h" > <a name="1682">1682</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # item <image> as html text like </td> </tr> <tr> <td class="h" > <a name="1683">1683</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <image> </td> </tr> <tr> <td class="h" > <a name="1684">1684</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <![CDATA[<img src="http://blog.cooperhewitt.org/images/277t.jpg" alt="" />]]> </td> </tr> <tr> <td class="h" > <a name="1685">1685</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </image> </td> </tr> <tr> <td class="h" > <a name="1686">1686</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # don't want to encourage dodginess like this, but picking it out </td> </tr> <tr> <td class="h" > <a name="1687">1687</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # isn't too hard </td> </tr> <tr> <td class="h" > <a name="1688">1688</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1688-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($image_elt->text =~ /<img[^>]*\ssrc="([^"]*)/) { </td> </tr> <tr> <td class="h" > <a name="1689">1689</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### image from html: $1 </td> </tr> <tr> <td class="h" > <a name="1690">1690</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $url_elt = $image_elt; </td> </tr> <tr> <td class="h" > <a name="1691">1691</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $url = $1; </td> </tr> <tr> <td class="h" > <a name="1692">1692</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1693">1693</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1694">1694</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1694-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (is_non_empty ($url)) { </td> </tr> <tr> <td class="h" > <a name="1695">1695</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $width = $image_elt->first_child_text('width'); </td> </tr> <tr> <td class="h" > <a name="1696">1696</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1696-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1696-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> unless (Scalar::Util::looks_like_number($width) && $width > 0) { </td> </tr> <tr> <td class="h" > <a name="1697">1697</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $width = 0; </td> </tr> <tr> <td class="h" > <a name="1698">1698</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1699">1699</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $height = $image_elt->first_child_text('height'); </td> </tr> <tr> <td class="h" > <a name="1700">1700</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1700-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1700-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> unless (Scalar::Util::looks_like_number($height) && $height > 0) { </td> </tr> <tr> <td class="h" > <a name="1701">1701</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $height = 0; </td> </tr> <tr> <td class="h" > <a name="1702">1702</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1703">1703</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### item_image_uwh() RSS: $url </td> </tr> <tr> <td class="h" > <a name="1704">1704</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return (App::RSS2Leafnode::XML::Twig::Other::elt_xml_based_uri ($url_elt, $url), </td> </tr> <tr> <td class="h" > <a name="1705">1705</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $width, $height); </td> </tr> <tr> <td class="h" > <a name="1706">1706</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1707">1707</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1708">1708</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1709">1709</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Atom channel <icon>foo.png</icon> should be square </td> </tr> <tr> <td class="h" > <a name="1710">1710</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # or channel <logo>foo.png</logo> bigger form, rectangle 2*K x K </td> </tr> <tr> <td class="h" > <a name="1711">1711</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="1712">1712</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <itunes:image href="http://..."> in item or channel. Supposedly this </td> </tr> <tr> <td class="h" > <a name="1713">1713</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # is bigger than the RSS 48x48, so would probably need shrinking. Rate </td> </tr> <tr> <td class="h" > <a name="1714">1714</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # it below <icon> or <logo> for that reason. </td> </tr> <tr> <td class="h" > <a name="1715">1715</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="1716">1716</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <media:thumbnail href="" width="" height=""> snapshot of movie etc </td> </tr> <tr> <td class="h" > <a name="1717">1717</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Is it better to show the channel icon, being the From person? </td> </tr> <tr> <td class="h" > <a name="1718">1718</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="1719">1719</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $elt; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1720">1720</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my ($width, $height); </td> </tr> <tr> <td class="h" > <a name="1721">1721</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $url = ((($elt = $where->first_child('icon')) </td> </tr> <tr> <td class="h" > <a name="1722">1722</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> && non_empty ($elt->text)) </td> </tr> <tr> <td class="h" > <a name="1723">1723</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || (($elt = $where->first_child('logo')) </td> </tr> <tr> <td class="h" > <a name="1724">1724</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> && non_empty ($elt->text)) </td> </tr> <tr> <td class="h" > <a name="1725">1725</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || (($elt = $where->first_child('itunes:image')) </td> </tr> <tr> <td class="h" > <a name="1726">1726</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> && non_empty ($elt->att('href'))) </td> </tr> <tr> <td class="h" > <a name="1727">1727</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || (($elt = $where->first_child('media:thumbnail')) </td> </tr> <tr> <td class="h" > <a name="1728">1728</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> && is_non_empty ($elt->att('url')) </td> </tr> <tr> <td class="h" > <a name="1729">1729</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> && do { </td> </tr> <tr> <td class="h" > <a name="1730">1730</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $width = $elt->att('width'); </td> </tr> <tr> <td class="h" > <a name="1731">1731</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $height = $elt->att('height'); </td> </tr> <tr> <td class="h" > <a name="1732">1732</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $elt->att('url') }) </td> </tr> <tr> <td class="h" > <a name="1733">1733</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # seen att('atom:url' rather than plain 'url' ... </td> </tr> <tr> <td class="h" > <a name="1734">1734</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || (($elt = $where->first_child('media:thumbnail')) </td> </tr> <tr> <td class="h" > <a name="1735">1735</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> && is_non_empty ($elt->att('atom:url')) </td> </tr> <tr> <td class="h" > <a name="1736">1736</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1736-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> && do { </td> </tr> <tr> <td class="h" > <a name="1737">1737</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $width = $elt->att('width'); </td> </tr> <tr> <td class="h" > <a name="1738">1738</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $height = $elt->att('height'); </td> </tr> <tr> <td class="h" > <a name="1739">1739</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $elt->att('atom:url') })); </td> </tr> <tr> <td class="h" > <a name="1740">1740</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### $url </td> </tr> <tr> <td class="h" > <a name="1741">1741</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1741-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($url) { </td> </tr> <tr> <td class="h" > <a name="1742">1742</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1742-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1742-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> unless (Scalar::Util::looks_like_number($width) && $width > 0) { </td> </tr> <tr> <td class="h" > <a name="1743">1743</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $width = 0; </td> </tr> <tr> <td class="h" > <a name="1744">1744</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1745">1745</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1745-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1745-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> unless (Scalar::Util::looks_like_number($height) && $height > 0) { </td> </tr> <tr> <td class="h" > <a name="1746">1746</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $height = 0; </td> </tr> <tr> <td class="h" > <a name="1747">1747</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1748">1748</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return (App::RSS2Leafnode::XML::Twig::Other::elt_xml_based_uri ($elt, $url), </td> </tr> <tr> <td class="h" > <a name="1749">1749</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $width, </td> </tr> <tr> <td class="h" > <a name="1750">1750</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $height); </td> </tr> <tr> <td class="h" > <a name="1751">1751</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1752">1752</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1753">1753</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1754">1754</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # status.net for rss 1.0 </td> </tr> <tr> <td class="h" > <a name="1755">1755</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <statusnet:postIcon rdf:resource="http://avatar.identi.ca/..."></statusnet:postIcon> </td> </tr> <tr> <td class="h" > <a name="1756">1756</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1756-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (my $elt = $where->first_child('statusnet:postIcon')) { </td> </tr> <tr> <td class="h" > <a name="1757">1757</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1757-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (is_non_empty (my $url = $elt->att('rdf:resource'))) { </td> </tr> <tr> <td class="h" > <a name="1758">1758</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return (App::RSS2Leafnode::XML::Twig::Other::elt_xml_based_uri ($elt, $url), </td> </tr> <tr> <td class="h" > <a name="1759">1759</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 0, 0); # unknown size </td> </tr> <tr> <td class="h" > <a name="1760">1760</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1761">1761</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1762">1762</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1763">1763</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <author><gd:image ...> </td> </tr> <tr> <td class="h" > <a name="1764">1764</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # eg. from blogger.com </td> </tr> <tr> <td class="h" > <a name="1765">1765</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/> </td> </tr> <tr> <td class="h" > <a name="1766">1766</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="1767">1767</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $elt; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1768">1768</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1768-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1768-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (($elt = $where->first_child('author')) </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-3"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1769">1769</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> && ($elt = $elt->first_child('gd:image')) </td> </tr> <tr> <td class="h" > <a name="1770">1770</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> && (is_non_empty (my $url = $elt->att('src') // $elt->att('atom:src')))) { </td> </tr> <tr> <td class="h" > <a name="1771">1771</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### $url </td> </tr> <tr> <td class="h" > <a name="1772">1772</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1772-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return (App::RSS2Leafnode::XML::Twig::Other::elt_xml_based_uri ($elt, $url), </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1773">1773</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $elt->att('width') || $elt->att('atom:width') || 0, </td> </tr> <tr> <td class="h" > <a name="1774">1774</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $elt->att('height') || $elt->att('atom:height') || 0); </td> </tr> <tr> <td class="h" > <a name="1775">1775</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1776">1776</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1777">1777</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1778">1778</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return; </td> </tr> <tr> <td class="h" > <a name="1779">1779</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1780">1780</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @known{qw(/channel/logo </td> </tr> <tr> <td class="h" > <a name="1781">1781</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/icon </td> </tr> <tr> <td class="h" > <a name="1782">1782</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/image </td> </tr> <tr> <td class="h" > <a name="1783">1783</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/image/url </td> </tr> <tr> <td class="h" > <a name="1784">1784</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/image/width </td> </tr> <tr> <td class="h" > <a name="1785">1785</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/image/height </td> </tr> <tr> <td class="h" > <a name="1786">1786</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/image/title </td> </tr> <tr> <td class="h" > <a name="1787">1787</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/image/link </td> </tr> <tr> <td class="h" > <a name="1788">1788</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/image/description </td> </tr> <tr> <td class="h" > <a name="1789">1789</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/itunes:image </td> </tr> <tr> <td class="h" > <a name="1790">1790</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/statusnet:postIcon </td> </tr> <tr> <td class="h" > <a name="1791">1791</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1792">1792</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/image </td> </tr> <tr> <td class="h" > <a name="1793">1793</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/media:thumbnail </td> </tr> <tr> <td class="h" > <a name="1794">1794</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/statusnet:postIcon </td> </tr> <tr> <td class="h" > <a name="1795">1795</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> )} = (); </td> </tr> <tr> <td class="h" > <a name="1796">1796</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1797">1797</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $resp is a HTTP::Response </td> </tr> <tr> <td class="h" > <a name="1798">1798</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return a string value for the Face: header, or undef if no icon </td> </tr> <tr> <td class="h" > <a name="1799">1799</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub http_resp_to_face { </td> </tr> <tr> <td class="h" > <a name="1800">1800</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1800-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1800-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $resp) = @_; </td> </tr> <tr> <td class="h" > <a name="1801">1801</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1801-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->{'get_icon'} || return; </td> </tr> <tr> <td class="h" > <a name="1802">1802</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1803">1803</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1803-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $uri = http_resp_favicon_uri($resp) || return; </td> </tr> <tr> <td class="h" > <a name="1804">1804</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, ' response favicon URI: ', $uri); </td> </tr> <tr> <td class="h" > <a name="1805">1805</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $self->download_face ($uri, 0, 0); </td> </tr> <tr> <td class="h" > <a name="1806">1806</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1807">1807</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1808">1808</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $resp is a HTTP::Response </td> </tr> <tr> <td class="h" > <a name="1809">1809</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # if it's a html with a favicon link return a URI object of that image </td> </tr> <tr> <td class="h" > <a name="1810">1810</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="1811">1811</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # http://www.w3.org/2005/10/howto-favicon </td> </tr> <tr> <td class="h" > <a name="1812">1812</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="1813">1813</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub http_resp_favicon_uri { </td> </tr> <tr> <td class="h" > <a name="1814">1814</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1814-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1814-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($resp) = @_; </td> </tr> <tr> <td class="h" > <a name="1815">1815</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1815-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $resp->headers->content_is_html || return; </td> </tr> <tr> <td class="h" > <a name="1816">1816</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require HTML::Parser; </td> </tr> <tr> <td class="h" > <a name="1817">1817</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $href; </td> </tr> <tr> <td class="h" > <a name="1818">1818</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $p; </td> </tr> <tr> <td class="h" > <a name="1819">1819</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $p = HTML::Parser->new (api_version => 3, </td> </tr> <tr> <td class="h" > <a name="1820">1820</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> start_h => [ sub { </td> </tr> <tr> <td class="h" > <a name="1821">1821</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1821-1"> 0 </a> </td> <td >   </td> <td >   </td> <td class="s"> my ($tagname, $attr) = @_; </td> </tr> <tr> <td class="h" > <a name="1822">1822</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1822-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1822-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($tagname eq 'link' </td> </tr> <tr> <td class="h" > <a name="1823">1823</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> && $attr->{'rel'} eq 'icon') { </td> </tr> <tr> <td class="h" > <a name="1824">1824</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $href = $attr->{'href'}; </td> </tr> <tr> <td class="h" > <a name="1825">1825</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $p->eof; </td> </tr> <tr> <td class="h" > <a name="1826">1826</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1827">1827</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> }, "tagname, attr"]); </td> </tr> <tr> <td class="h" > <a name="1828">1828</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $resp->decode; </td> </tr> <tr> <td class="h" > <a name="1829">1829</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $p->parse ($resp->content); </td> </tr> <tr> <td class="h" > <a name="1830">1830</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1830-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $href && URI->new_abs ($href, $resp->base); </td> </tr> <tr> <td class="h" > <a name="1831">1831</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1832">1832</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1833">1833</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return base64 string value for "Face:" header </td> </tr> <tr> <td class="h" > <a name="1834">1834</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub download_face { </td> </tr> <tr> <td class="h" > <a name="1835">1835</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1835-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1835-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $uri, $width, $height) = @_; </td> </tr> <tr> <td class="h" > <a name="1836">1836</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $key = $uri->canonical->as_string; </td> </tr> <tr> <td class="h" > <a name="1837">1837</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1837-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! exists $self->{'download_face'}->{$key}) { </td> </tr> <tr> <td class="h" > <a name="1838">1838</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->{'download_face'}->{$key} </td> </tr> <tr> <td class="h" > <a name="1839">1839</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> = $self->download_face_uncached ($uri, $width, $height); </td> </tr> <tr> <td class="h" > <a name="1840">1840</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1841">1841</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $self->{'download_face'}->{$key}; </td> </tr> <tr> <td class="h" > <a name="1842">1842</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1843">1843</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub download_face_uncached { </td> </tr> <tr> <td class="h" > <a name="1844">1844</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1844-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1844-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $url, $width, $height) = @_; </td> </tr> <tr> <td class="h" > <a name="1845">1845</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1846">1846</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->{'download_face_uncached'} = $url; </td> </tr> <tr> <td class="h" > <a name="1847">1847</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (1, ' image download: ', $url); </td> </tr> <tr> <td class="h" > <a name="1848">1848</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1849">1849</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require HTTP::Request; </td> </tr> <tr> <td class="h" > <a name="1850">1850</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $req = HTTP::Request->new (GET => $url); </td> </tr> <tr> <td class="h" > <a name="1851">1851</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $resp = $self->ua->request($req); </td> </tr> <tr> <td class="h" > <a name="1852">1852</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1852-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! $resp->is_success) { </td> </tr> <tr> <td class="h" > <a name="1853">1853</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> print __x(" no image: {status}\n", </td> </tr> <tr> <td class="h" > <a name="1854">1854</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> status => $resp->status_line); </td> </tr> <tr> <td class="h" > <a name="1855">1855</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return; </td> </tr> <tr> <td class="h" > <a name="1856">1856</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1857">1857</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1858">1858</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $type = $resp->content_type; </td> </tr> <tr> <td class="h" > <a name="1859">1859</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### $type </td> </tr> <tr> <td class="h" > <a name="1860">1860</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # FIXME: is mime=>$type the right way? could give it a look at the url </td> </tr> <tr> <td class="h" > <a name="1861">1861</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # basename or server's suggested filename too, for Read() to use the </td> </tr> <tr> <td class="h" > <a name="1862">1862</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # extension. </td> </tr> <tr> <td class="h" > <a name="1863">1863</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1863-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1863-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($type eq 'image/vnd.microsoft.icon' || $type eq 'image/x-icon') { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1864">1864</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # mime.xml of imagemagick 6.6.0 only has "image/x-ico", and nothing for </td> </tr> <tr> <td class="h" > <a name="1865">1865</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # ico in magic.xml </td> </tr> <tr> <td class="h" > <a name="1866">1866</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $type = 'ico'; </td> </tr> <tr> <td class="h" > <a name="1867">1867</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($type =~ m{^image/(.*)$}i) { </td> </tr> <tr> <td class="h" > <a name="1868">1868</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $type = $1; </td> </tr> <tr> <td class="h" > <a name="1869">1869</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="1870">1870</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, 'ignore non-image icon type: ',$type); </td> </tr> <tr> <td class="h" > <a name="1871">1871</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return; </td> </tr> <tr> <td class="h" > <a name="1872">1872</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1873">1873</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1874">1874</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $resp->decode; </td> </tr> <tr> <td class="h" > <a name="1875">1875</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $data = $resp->content; </td> </tr> <tr> <td class="h" > <a name="1876">1876</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1876-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1876-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($type ne 'png' </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-3"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-4"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1877">1877</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || $width == 0 || $height == 0 </td> </tr> <tr> <td class="h" > <a name="1878">1878</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || $width > 48 || $height > 48) { </td> </tr> <tr> <td class="h" > <a name="1879">1879</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1879-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $data = $self->imagemagick_to_png($type,$data) // return; </td> </tr> <tr> <td class="h" > <a name="1880">1880</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1881">1881</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, " image for Face ",length($data)," bytes"); </td> </tr> <tr> <td class="h" > <a name="1882">1882</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1883">1883</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # use a space as a separator since MIME::Entity will collapse out a </td> </tr> <tr> <td class="h" > <a name="1884">1884</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # newline and make an enormous long word which then can't be split across </td> </tr> <tr> <td class="h" > <a name="1885">1885</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # header lines and will likely exceed the nntp 998 char single-line limit </td> </tr> <tr> <td class="h" > <a name="1886">1886</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require MIME::Base64; </td> </tr> <tr> <td class="h" > <a name="1887">1887</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $data = MIME::Base64::encode_base64($data, " "); </td> </tr> <tr> <td class="h" > <a name="1888">1888</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### $data </td> </tr> <tr> <td class="h" > <a name="1889">1889</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1890">1890</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $data; </td> </tr> <tr> <td class="h" > <a name="1891">1891</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1892">1892</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1893">1893</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub face_wh_ok { </td> </tr> <tr> <td class="h" > <a name="1894">1894</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1894-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1894-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $width, $height) = @_; </td> </tr> <tr> <td class="h" > <a name="1895">1895</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1896">1896</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1896-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1896-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($width > 0 && $width > 2*$height) { </td> </tr> <tr> <td class="h" > <a name="1897">1897</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # some obnoxious banner </td> </tr> <tr> <td class="h" > <a name="1898">1898</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (1, ' ', </td> </tr> <tr> <td class="h" > <a name="1899">1899</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> __x('image is a banner ({width}x{height}), ignore', </td> </tr> <tr> <td class="h" > <a name="1900">1900</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> width => $width, height => $height)); </td> </tr> <tr> <td class="h" > <a name="1901">1901</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 0; </td> </tr> <tr> <td class="h" > <a name="1902">1902</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1903">1903</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 1; </td> </tr> <tr> <td class="h" > <a name="1904">1904</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1905">1905</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1906">1906</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> #------------------------------------------------------------------------------ </td> </tr> <tr> <td class="h" > <a name="1907">1907</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # ImageMagick bits </td> </tr> <tr> <td class="h" > <a name="1908">1908</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1909">1909</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $type is "gif", "ico" etc, $data is an image in a byte string </td> </tr> <tr> <td class="h" > <a name="1910">1910</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return a byte string of png, or undef if $data unrecognised </td> </tr> <tr> <td class="h" > <a name="1911">1911</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub imagemagick_to_png { </td> </tr> <tr> <td class="h" > <a name="1912">1912</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1912-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1912-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $type, $data) = @_; </td> </tr> <tr> <td class="h" > <a name="1913">1913</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### $type </td> </tr> <tr> <td class="h" > <a name="1914">1914</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1914-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $image = $self->imagemagick_from_data($type,$data) // return; </td> </tr> <tr> <td class="h" > <a name="1915">1915</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1916">1916</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $width = $image->Get('width'); </td> </tr> <tr> <td class="h" > <a name="1917">1917</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $height = $image->Get('height'); </td> </tr> <tr> <td class="h" > <a name="1918">1918</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### compress: $image->Get('compression') </td> </tr> <tr> <td class="h" > <a name="1919">1919</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, " image ${width}x${height}"); </td> </tr> <tr> <td class="h" > <a name="1920">1920</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1920-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1920-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($width == 0 || $height == 0) { </td> </tr> <tr> <td class="h" > <a name="1921">1921</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return; </td> </tr> <tr> <td class="h" > <a name="1922">1922</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1923">1923</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1923-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1923-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($width <= 48 && $height <= 48 && $type eq 'png') { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1924">1924</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $data; </td> </tr> <tr> <td class="h" > <a name="1925">1925</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1926">1926</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1927">1927</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # having downloaded the image is it better to keep a banner but shrink it, </td> </tr> <tr> <td class="h" > <a name="1928">1928</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # or discard as no good? </td> </tr> <tr> <td class="h" > <a name="1929">1929</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="1930">1930</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $self->face_wh_ok ($width, $height) || return; </td> </tr> <tr> <td class="h" > <a name="1931">1931</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1932">1932</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1932-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1932-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($width > 48 || $height > 48) { </td> </tr> <tr> <td class="h" > <a name="1933">1933</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $factor; </td> </tr> <tr> <td class="h" > <a name="1934">1934</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1934-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#1934-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($width <= 2*48 && $height <= 2*48) { </td> </tr> <tr> <td class="h" > <a name="1935">1935</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $factor = 0.5; </td> </tr> <tr> <td class="h" > <a name="1936">1936</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="1937">1937</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $factor = min (48 / $width, 48 / $height); </td> </tr> <tr> <td class="h" > <a name="1938">1938</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1939">1939</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $width = POSIX::ceil ($width * $factor); </td> </tr> <tr> <td class="h" > <a name="1940">1940</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $height = POSIX::ceil ($height * $factor); </td> </tr> <tr> <td class="h" > <a name="1941">1941</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, " image shrink by $factor to ${width}x${height}"); </td> </tr> <tr> <td class="h" > <a name="1942">1942</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # cf LiquidResize() or plain Resize() </td> </tr> <tr> <td class="h" > <a name="1943">1943</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $image->AdaptiveResize (width => $width, height => $height); </td> </tr> <tr> <td class="h" > <a name="1944">1944</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1945">1945</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1946">1946</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $ret = $image->Set (magick => 'PNG8'); </td> </tr> <tr> <td class="h" > <a name="1947">1947</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### ret: "$ret" </td> </tr> <tr> <td class="h" > <a name="1948">1948</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### ret: $ret+0 </td> </tr> <tr> <td class="h" > <a name="1949">1949</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1949-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($ret != 0) { </td> </tr> <tr> <td class="h" > <a name="1950">1950</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> print "oops, imagemagick doesn't like PNG8: $ret\n"; </td> </tr> <tr> <td class="h" > <a name="1951">1951</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return; </td> </tr> <tr> <td class="h" > <a name="1952">1952</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1953">1953</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### compress: $image->Get('compression') </td> </tr> <tr> <td class="h" > <a name="1954">1954</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1955">1955</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $image->Write ('/tmp/x.png'); </td> </tr> <tr> <td class="h" > <a name="1956">1956</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ($data) = $image->ImageToBlob (); </td> </tr> <tr> <td class="h" > <a name="1957">1957</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $data; </td> </tr> <tr> <td class="h" > <a name="1958">1958</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1959">1959</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1960">1960</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1961">1961</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $type is "png", "ico" etc, $data is an image in a byte string </td> </tr> <tr> <td class="h" > <a name="1962">1962</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return a Image::Magick object, or undef if Perl-Magick not available </td> </tr> <tr> <td class="h" > <a name="1963">1963</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub imagemagick_from_data { </td> </tr> <tr> <td class="h" > <a name="1964">1964</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1964-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#1964-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $type, $data) = @_; </td> </tr> <tr> <td class="h" > <a name="1965">1965</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### imagemagick_from_data(): $type </td> </tr> <tr> <td class="h" > <a name="1966">1966</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1966-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> eval { require Image::Magick } or return; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1967">1967</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1968">1968</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $image = Image::Magick->new (magick=>$type); </td> </tr> <tr> <td class="h" > <a name="1969">1969</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $image->Set(debug=>'All'); </td> </tr> <tr> <td class="h" > <a name="1970">1970</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $ret = $image->BlobToImage ($data); </td> </tr> <tr> <td class="h" > <a name="1971">1971</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### ret: "$ret" </td> </tr> <tr> <td class="h" > <a name="1972">1972</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### ret: $ret+0 </td> </tr> <tr> <td class="h" > <a name="1973">1973</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1973-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($ret == 1) { </td> </tr> <tr> <td class="h" > <a name="1974">1974</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $image; </td> </tr> <tr> <td class="h" > <a name="1975">1975</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1976">1976</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1977">1977</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # try again without the $type forced, in case bad Content-Type from http </td> </tr> <tr> <td class="h" > <a name="1978">1978</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $image = Image::Magick->new; </td> </tr> <tr> <td class="h" > <a name="1979">1979</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $image->Set(debug=>'All'); </td> </tr> <tr> <td class="h" > <a name="1980">1980</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $ret = $image->BlobToImage ($data); </td> </tr> <tr> <td class="h" > <a name="1981">1981</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### ret: "$ret" </td> </tr> <tr> <td class="h" > <a name="1982">1982</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### ret: $ret+0 </td> </tr> <tr> <td class="h" > <a name="1983">1983</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#1983-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($ret == 1) { </td> </tr> <tr> <td class="h" > <a name="1984">1984</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $image; </td> </tr> <tr> <td class="h" > <a name="1985">1985</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1986">1986</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1987">1987</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> print __x(" imagemagick doesn't like image data ({length} bytes) from {url}: {error}\n", </td> </tr> <tr> <td class="h" > <a name="1988">1988</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> length => length($data), </td> </tr> <tr> <td class="h" > <a name="1989">1989</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> url => $self->{'download_face_uncached'}, </td> </tr> <tr> <td class="h" > <a name="1990">1990</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> error => $ret); </td> </tr> <tr> <td class="h" > <a name="1991">1991</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return undef; </td> </tr> <tr> <td class="h" > <a name="1992">1992</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="1993">1993</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1994">1994</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1995">1995</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> #------------------------------------------------------------------------------ </td> </tr> <tr> <td class="h" > <a name="1996">1996</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # XML::Liberal </td> </tr> <tr> <td class="h" > <a name="1997">1997</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="1998">1998</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> use constant::defer have_xml_liberal => sub { </td> </tr> <tr> <td class="h" > <a name="1999">1999</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> my ($self) = @_; </td> </tr> <tr> <td class="h" > <a name="2000">2000</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2000-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> if (eval { require XML::Liberal; 1 }) { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2001">2001</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> return 1; </td> </tr> <tr> <td class="h" > <a name="2002">2002</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2003">2003</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> $self->verbose (3, __x('XML::Liberal not available: {error}', error => $@)); </td> </tr> <tr> <td class="h" > <a name="2004">2004</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 0 </td> <td class="s"> return 0; </td> </tr> <tr> <td class="h" > <a name="2005">2005</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2005-1"> 1 </a> </td> <td >   </td> <td > 7 </td> <td class="s"> }; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 2 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 9 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2006">2006</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2007">2007</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # try to correct $xmlstr </td> </tr> <tr> <td class="h" > <a name="2008">2008</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # if successful return a new xml string, otherwise return undef </td> </tr> <tr> <td class="h" > <a name="2009">2009</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub xml_liberal_correction { </td> </tr> <tr> <td class="h" > <a name="2010">2010</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2010-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2010-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $xmlstr) = @_; </td> </tr> <tr> <td class="h" > <a name="2011">2011</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2011-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->have_xml_liberal or return; </td> </tr> <tr> <td class="h" > <a name="2012">2012</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2013">2013</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### try XML-Liberal ... </td> </tr> <tr> <td class="h" > <a name="2014">2014</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $liberal = XML::Liberal->new('LibXML'); </td> </tr> <tr> <td class="h" > <a name="2015">2015</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2015-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (my $doc = eval { $liberal->parse_string($xmlstr) }) { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2016">2016</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $doc->toString; </td> </tr> <tr> <td class="h" > <a name="2017">2017</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="2018">2018</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, __x('XML::Liberal parse error: {error}', error => $@)); </td> </tr> <tr> <td class="h" > <a name="2019">2019</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return undef; </td> </tr> <tr> <td class="h" > <a name="2020">2020</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2021">2021</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2022">2022</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2023">2023</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2024">2024</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> #------------------------------------------------------------------------------ </td> </tr> <tr> <td class="h" > <a name="2025">2025</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # error as news message </td> </tr> <tr> <td class="h" > <a name="2026">2026</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2027">2027</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub error_message { </td> </tr> <tr> <td class="h" > <a name="2028">2028</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2028-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2028-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $subject, $message, $attach_bytes) = @_; </td> </tr> <tr> <td class="h" > <a name="2029">2029</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2030">2030</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require Encode; </td> </tr> <tr> <td class="h" > <a name="2031">2031</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $charset = 'utf-8'; </td> </tr> <tr> <td class="h" > <a name="2032">2032</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $message = str_ensure_newline ($message); </td> </tr> <tr> <td class="h" > <a name="2033">2033</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $message = Encode::encode ($charset, $message, Encode::FB_DEFAULT()); </td> </tr> <tr> <td class="h" > <a name="2034">2034</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2035">2035</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $date = rfc822_time_now(); </td> </tr> <tr> <td class="h" > <a name="2036">2036</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require Digest::MD5; </td> </tr> <tr> <td class="h" > <a name="2037">2037</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $msgid = $self->url_to_msgid </td> </tr> <tr> <td class="h" > <a name="2038">2038</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ('http://localhost', </td> </tr> <tr> <td class="h" > <a name="2039">2039</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Digest::MD5::md5_base64 ($date.$subject.$message)); </td> </tr> <tr> <td class="h" > <a name="2040">2040</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2041">2041</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $top = $self->mime_build </td> </tr> <tr> <td class="h" > <a name="2042">2042</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ({ </td> </tr> <tr> <td class="h" > <a name="2043">2043</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'Path:' => 'localhost', </td> </tr> <tr> <td class="h" > <a name="2044">2044</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'Newsgroups:' => $self->{'nntp_group'}, </td> </tr> <tr> <td class="h" > <a name="2045">2045</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> From => __('RSS2Leafnode').' <nobody@localhost>', </td> </tr> <tr> <td class="h" > <a name="2046">2046</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Subject => $subject, </td> </tr> <tr> <td class="h" > <a name="2047">2047</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Date => $date, </td> </tr> <tr> <td class="h" > <a name="2048">2048</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'Message-ID' => $msgid, </td> </tr> <tr> <td class="h" > <a name="2049">2049</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> }, </td> </tr> <tr> <td class="h" > <a name="2050">2050</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Top => 1, </td> </tr> <tr> <td class="h" > <a name="2051">2051</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Type => 'text/plain', </td> </tr> <tr> <td class="h" > <a name="2052">2052</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Charset => $charset, </td> </tr> <tr> <td class="h" > <a name="2053">2053</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Data => $message); </td> </tr> <tr> <td class="h" > <a name="2054">2054</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2055">2055</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2055-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined $attach_bytes) { </td> </tr> <tr> <td class="h" > <a name="2056">2056</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $top->make_multipart; </td> </tr> <tr> <td class="h" > <a name="2057">2057</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $part = $self->mime_build </td> </tr> <tr> <td class="h" > <a name="2058">2058</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ({}, </td> </tr> <tr> <td class="h" > <a name="2059">2059</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Charset => 'none', </td> </tr> <tr> <td class="h" > <a name="2060">2060</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Type => 'application/octet-stream', </td> </tr> <tr> <td class="h" > <a name="2061">2061</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Data => $attach_bytes); </td> </tr> <tr> <td class="h" > <a name="2062">2062</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $top->add_part ($part); </td> </tr> <tr> <td class="h" > <a name="2063">2063</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2064">2064</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2065">2065</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> mime_entity_lines($top); </td> </tr> <tr> <td class="h" > <a name="2066">2066</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2066-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->nntp_post($top) || return; </td> </tr> <tr> <td class="h" > <a name="2067">2067</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> say __x('{group} 1 new article', group => $self->{'nntp_group'}); </td> </tr> <tr> <td class="h" > <a name="2068">2068</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2069">2069</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2070">2070</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2071">2071</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> #------------------------------------------------------------------------------ </td> </tr> <tr> <td class="h" > <a name="2072">2072</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # fetch HTML </td> </tr> <tr> <td class="h" > <a name="2073">2073</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2074">2074</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub http_resp_to_from { </td> </tr> <tr> <td class="h" > <a name="2075">2075</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2075-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2075-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $resp) = @_; </td> </tr> <tr> <td class="h" > <a name="2076">2076</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### http_resp_to_from() </td> </tr> <tr> <td class="h" > <a name="2077">2077</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#2077-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $self->http_resp_exiftool_author($resp) </td> </tr> <tr> <td class="h" > <a name="2078">2078</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // 'nobody@'.$self->uri_to_host; </td> </tr> <tr> <td class="h" > <a name="2079">2079</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2080">2080</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub http_resp_exiftool_author { </td> </tr> <tr> <td class="h" > <a name="2081">2081</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2081-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2081-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $resp) = @_; </td> </tr> <tr> <td class="h" > <a name="2082">2082</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # PNG Author field, or HTML <meta> author </td> </tr> <tr> <td class="h" > <a name="2083">2083</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#2083-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $author = resp_exiftool_info($resp)->{'Author'} // return; </td> </tr> <tr> <td class="h" > <a name="2084">2084</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $self->email_format_maybe (Encode::decode_utf8($author), '', undef); </td> </tr> <tr> <td class="h" > <a name="2085">2085</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2086">2086</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2087">2087</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub http_resp_to_copyright { </td> </tr> <tr> <td class="h" > <a name="2088">2088</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2088-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2088-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $resp) = @_; </td> </tr> <tr> <td class="h" > <a name="2089">2089</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### http_http_resp_to_copyright() ... </td> </tr> <tr> <td class="h" > <a name="2090">2090</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2091">2091</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my @copyrights = non_empty($resp->header('X-Meta-Copyright')); </td> </tr> <tr> <td class="h" > <a name="2092">2092</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2092-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> unless ($resp->content_type =~ m{^text/}) { </td> </tr> <tr> <td class="h" > <a name="2093">2093</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # PNG Copyright field, perhaps other formats </td> </tr> <tr> <td class="h" > <a name="2094">2094</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> push @copyrights, non_empty(resp_exiftool_info($resp)->{'Copyright'}); </td> </tr> <tr> <td class="h" > <a name="2095">2095</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2096">2096</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return \@copyrights; </td> </tr> <tr> <td class="h" > <a name="2097">2097</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2098">2098</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2099">2099</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return a "Keywords:" string, or undef if nothing </td> </tr> <tr> <td class="h" > <a name="2100">2100</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub http_resp_to_keywords { </td> </tr> <tr> <td class="h" > <a name="2101">2101</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2101-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2101-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $resp) = @_; </td> </tr> <tr> <td class="h" > <a name="2102">2102</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### http_resp_to_keywords() ... </td> </tr> <tr> <td class="h" > <a name="2103">2103</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2104">2104</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my @keywords = $resp->header('X-Meta-Keywords'); </td> </tr> <tr> <td class="h" > <a name="2105">2105</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2106">2106</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2106-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($resp->headers->content_is_html) { </td> </tr> <tr> <td class="h" > <a name="2107">2107</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $resp->decode; </td> </tr> <tr> <td class="h" > <a name="2108">2108</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require HTML::Parser; </td> </tr> <tr> <td class="h" > <a name="2109">2109</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $p = HTML::Parser->new </td> </tr> <tr> <td class="h" > <a name="2110">2110</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (api_version => 3, </td> </tr> <tr> <td class="h" > <a name="2111">2111</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> report_tags => ['meta'], </td> </tr> <tr> <td class="h" > <a name="2112">2112</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> start_h => [ sub { </td> </tr> <tr> <td class="h" > <a name="2113">2113</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2113-1"> 0 </a> </td> <td >   </td> <td >   </td> <td class="s"> my ($tagname, $attr) = @_; </td> </tr> <tr> <td class="h" > <a name="2114">2114</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <meta rel="og:type" content="sport"> facebook thing </td> </tr> <tr> <td class="h" > <a name="2115">2115</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2115-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#2115-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($tagname eq 'meta' </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2116">2116</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> && lc($attr->{'property'}||'') eq 'og:type') { </td> </tr> <tr> <td class="h" > <a name="2117">2117</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> push @keywords, $attr->{'content'}; </td> </tr> <tr> <td class="h" > <a name="2118">2118</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2119">2119</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2120">2120</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> }, "tagname, attr" ]); </td> </tr> <tr> <td class="h" > <a name="2121">2121</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $p->parse ($resp->decoded_content); </td> </tr> <tr> <td class="h" > <a name="2122">2122</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2123">2123</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### @keywords </td> </tr> <tr> <td class="h" > <a name="2124">2124</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2125">2125</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return join_non_empty </td> </tr> <tr> <td class="h" > <a name="2126">2126</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (', ', List::MoreUtils::uniq(map {collapse_whitespace($_)} </td> </tr> <tr> <td class="h" > <a name="2127">2127</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @keywords)); </td> </tr> <tr> <td class="h" > <a name="2128">2128</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2129">2129</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2130">2130</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub fetch_html { </td> </tr> <tr> <td class="h" > <a name="2131">2131</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2131-1"> 0 </a> </td> <td class="c3" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2131-1"> 1 </a> </td> <td >   </td> <td class="s"> my ($self, $group, $url, %options) = @_; </td> </tr> <tr> <td class="h" > <a name="2132">2132</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### fetch_html() ... </td> </tr> <tr> <td class="h" > <a name="2133">2133</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2134">2134</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local @{$self}{keys %options} = values %options; # hash slice </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2135">2135</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (1, __x('page: {url}', url => $url)); </td> </tr> <tr> <td class="h" > <a name="2136">2136</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2137">2137</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $group_uri = URI->new($group,'news'); </td> </tr> <tr> <td class="h" > <a name="2138">2138</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local $self->{'nntp_host'} = uri_to_nntp_host ($group_uri); </td> </tr> <tr> <td class="h" > <a name="2139">2139</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local $self->{'nntp_group'} = $group = $group_uri->group; </td> </tr> <tr> <td class="h" > <a name="2140">2140</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2140-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->nntp_group_check($group) or return; </td> </tr> <tr> <td class="h" > <a name="2141">2141</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2142">2142</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require HTTP::Request; </td> </tr> <tr> <td class="h" > <a name="2143">2143</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $req = HTTP::Request->new (GET => $url); </td> </tr> <tr> <td class="h" > <a name="2144">2144</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->status_etagmod_req ($req); </td> </tr> <tr> <td class="h" > <a name="2145">2145</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $resp = $self->ua->request($req); </td> </tr> <tr> <td class="h" > <a name="2146">2146</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2146-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($resp->code == 304) { </td> </tr> <tr> <td class="h" > <a name="2147">2147</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->status_unchanged ($url); </td> </tr> <tr> <td class="h" > <a name="2148">2148</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return; </td> </tr> <tr> <td class="h" > <a name="2149">2149</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2150">2150</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2150-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! $resp->is_success) { </td> </tr> <tr> <td class="h" > <a name="2151">2151</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> print __x("rss2leafnode: {url}\n {status}\n", </td> </tr> <tr> <td class="h" > <a name="2152">2152</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> url => $url, </td> </tr> <tr> <td class="h" > <a name="2153">2153</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> status => $resp->status_line); </td> </tr> <tr> <td class="h" > <a name="2154">2154</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return; </td> </tr> <tr> <td class="h" > <a name="2155">2155</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2156">2156</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, $resp->headers->as_string); </td> </tr> <tr> <td class="h" > <a name="2157">2157</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->enforce_html_charset_from_content ($resp); </td> </tr> <tr> <td class="h" > <a name="2158">2158</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2159">2159</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # message id is either the etag if present, or an md5 of the content if not </td> </tr> <tr> <td class="h" > <a name="2160">2160</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $msgid = $self->url_to_msgid </td> </tr> <tr> <td class="h" > <a name="2161">2161</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ($url, </td> </tr> <tr> <td class="h" > <a name="2162">2162</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#2162-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $resp->header('ETag') // do { </td> </tr> <tr> <td class="h" > <a name="2163">2163</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require Digest::MD5; </td> </tr> <tr> <td class="h" > <a name="2164">2164</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $resp->decode; </td> </tr> <tr> <td class="h" > <a name="2165">2165</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $content = $resp->content; </td> </tr> <tr> <td class="h" > <a name="2166">2166</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Digest::MD5::md5_base64($content) </td> </tr> <tr> <td class="h" > <a name="2167">2167</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> }); </td> </tr> <tr> <td class="h" > <a name="2168">2168</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2168-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 0 if $self->nntp_message_id_exists ($msgid); </td> </tr> <tr> <td class="h" > <a name="2169">2169</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2170">2170</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#2170-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $subject = (html_title($resp) </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2171">2171</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // $resp->filename </td> </tr> <tr> <td class="h" > <a name="2172">2172</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # show original url in subject, not anywhere redirected </td> </tr> <tr> <td class="h" > <a name="2173">2173</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // __x('RSS2Leafnode {url}', url => $url)); </td> </tr> <tr> <td class="h" > <a name="2174">2174</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2175">2175</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $from = $self->http_resp_to_from($resp); </td> </tr> <tr> <td class="h" > <a name="2176">2176</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $date = $resp->header('Last-Modified'); </td> </tr> <tr> <td class="h" > <a name="2177">2177</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $face = $self->http_resp_to_face($resp); </td> </tr> <tr> <td class="h" > <a name="2178">2178</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $copyright = $self->http_resp_to_copyright($resp); </td> </tr> <tr> <td class="h" > <a name="2179">2179</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $keywords = $self->http_resp_to_keywords($resp); </td> </tr> <tr> <td class="h" > <a name="2180">2180</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2181">2181</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $part = $self->http_resp_extract_main($resp); </td> </tr> <tr> <td class="h" > <a name="2182">2182</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2183">2183</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $top = $self->mime_part_from_response </td> </tr> <tr> <td class="h" > <a name="2184">2184</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ($resp, </td> </tr> <tr> <td class="h" > <a name="2185">2185</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Top => 1, </td> </tr> <tr> <td class="h" > <a name="2186">2186</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'Path:' => scalar($self->uri_to_host), </td> </tr> <tr> <td class="h" > <a name="2187">2187</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'Newsgroups:' => $group, </td> </tr> <tr> <td class="h" > <a name="2188">2188</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> From => $from, </td> </tr> <tr> <td class="h" > <a name="2189">2189</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Subject => $subject, </td> </tr> <tr> <td class="h" > <a name="2190">2190</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Date => $date, </td> </tr> <tr> <td class="h" > <a name="2191">2191</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'Message-ID' => $msgid, </td> </tr> <tr> <td class="h" > <a name="2192">2192</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Keywords => $keywords, </td> </tr> <tr> <td class="h" > <a name="2193">2193</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'Face:' => $face, </td> </tr> <tr> <td class="h" > <a name="2194">2194</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'X-Copyright:' => $copyright); </td> </tr> <tr> <td class="h" > <a name="2195">2195</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2195-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($part) { </td> </tr> <tr> <td class="h" > <a name="2196">2196</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### attach full part ... </td> </tr> <tr> <td class="h" > <a name="2197">2197</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $top->make_multipart; </td> </tr> <tr> <td class="h" > <a name="2198">2198</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $top->add_part ($part); </td> </tr> <tr> <td class="h" > <a name="2199">2199</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2200">2200</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2201">2201</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> mime_entity_lines($top); </td> </tr> <tr> <td class="h" > <a name="2202">2202</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2202-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->nntp_post($top) || return; </td> </tr> <tr> <td class="h" > <a name="2203">2203</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->status_etagmod_resp ($url, $resp); </td> </tr> <tr> <td class="h" > <a name="2204">2204</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> say __x("{group} 1 new article", group => $group); </td> </tr> <tr> <td class="h" > <a name="2205">2205</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2206">2206</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2207">2207</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $resp is a HTTP::Response </td> </tr> <tr> <td class="h" > <a name="2208">2208</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # If the $self->{'html_extract_main'} option is true and $resp is html then </td> </tr> <tr> <td class="h" > <a name="2209">2209</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # resplace the $resp content with HTML::ExtractMain extracted part. </td> </tr> <tr> <td class="h" > <a name="2210">2210</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="2211">2211</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub http_resp_extract_main { </td> </tr> <tr> <td class="h" > <a name="2212">2212</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2212-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2212-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $resp) = @_; </td> </tr> <tr> <td class="h" > <a name="2213">2213</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2214">2214</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2214-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->{'html_extract_main'} or return; </td> </tr> <tr> <td class="h" > <a name="2215">2215</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2215-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $resp->headers->content_is_html() or return; </td> </tr> <tr> <td class="h" > <a name="2216">2216</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2217">2217</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#2217-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $full_part </td> </tr> <tr> <td class="h" > <a name="2218">2218</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> = (defined $self->{'html_extract_main'} </td> </tr> <tr> <td class="h" > <a name="2219">2219</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> && $self->{'html_extract_main'} eq 'attach_full' </td> </tr> <tr> <td class="h" > <a name="2220">2220</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> && $self->mime_part_from_response($resp, </td> </tr> <tr> <td class="h" > <a name="2221">2221</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Disposition => "attachment")); </td> </tr> <tr> <td class="h" > <a name="2222">2222</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2223">2223</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require HTML::ExtractMain; </td> </tr> <tr> <td class="h" > <a name="2224">2224</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> HTML::ExtractMain->VERSION(0.63); # for output_type=>'html' </td> </tr> <tr> <td class="h" > <a name="2225">2225</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $resp->decode; # expand any compression </td> </tr> <tr> <td class="h" > <a name="2226">2226</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $content = $resp->decoded_content; # as wide-chars </td> </tr> <tr> <td class="h" > <a name="2227">2227</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2228">2228</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Output type 'html' differs from the default xhtml by a few entities, in </td> </tr> <tr> <td class="h" > <a name="2229">2229</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # particular it avoids ' which is an xml-ism not in the html standards. </td> </tr> <tr> <td class="h" > <a name="2230">2230</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Various browsers support &apos anyway, but not for example by w3m. </td> </tr> <tr> <td class="h" > <a name="2231">2231</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $content = HTML::ExtractMain::extract_main_html($content, </td> </tr> <tr> <td class="h" > <a name="2232">2232</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> output_type => 'html'); </td> </tr> <tr> <td class="h" > <a name="2233">2233</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2233-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! defined $content) { </td> </tr> <tr> <td class="h" > <a name="2234">2234</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose(1, __(" HTML::ExtractMain no main part found, posting whole")); </td> </tr> <tr> <td class="h" > <a name="2235">2235</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return; </td> </tr> <tr> <td class="h" > <a name="2236">2236</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2237">2237</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### main extracted: $content </td> </tr> <tr> <td class="h" > <a name="2238">2238</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $resp->remove_header('Content-MD5'); # since changed content </td> </tr> <tr> <td class="h" > <a name="2239">2239</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $charset = $resp->content_charset; </td> </tr> <tr> <td class="h" > <a name="2240">2240</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $content = Encode::encode ($charset, $content); </td> </tr> <tr> <td class="h" > <a name="2241">2241</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $resp->content($content); </td> </tr> <tr> <td class="h" > <a name="2242">2242</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2243">2243</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $full_part; </td> </tr> <tr> <td class="h" > <a name="2244">2244</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2245">2245</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2246">2246</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> #------------------------------------------------------------------------------ </td> </tr> <tr> <td class="h" > <a name="2247">2247</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # RSS hacks </td> </tr> <tr> <td class="h" > <a name="2248">2248</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2249">2249</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # This is a hack for Yahoo Finance feed uniqification. </td> </tr> <tr> <td class="h" > <a name="2250">2250</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $item is a feed hashref. If it has 'link' field with a yahoo.com </td> </tr> <tr> <td class="h" > <a name="2251">2251</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # redirection like </td> </tr> <tr> <td class="h" > <a name="2252">2252</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="2253">2253</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # http://au.rd.yahoo.com/finance/news/rss/financenews/*http://au.biz.yahoo.com/071003/30/1fdvx.html </td> </tr> <tr> <td class="h" > <a name="2254">2254</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="2255">2255</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # then return the last target url part. Otherwise return false. </td> </tr> <tr> <td class="h" > <a name="2256">2256</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="2257">2257</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # This allows the item to be identified by its final target link, so as to </td> </tr> <tr> <td class="h" > <a name="2258">2258</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # avoid duplication when the item appears in multiple yahoo feeds with a </td> </tr> <tr> <td class="h" > <a name="2259">2259</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # different leading part. (There's no guid in yahoo feeds, as of Oct 2007.) </td> </tr> <tr> <td class="h" > <a name="2260">2260</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="2261">2261</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub item_yahoo_permalink { </td> </tr> <tr> <td class="h" > <a name="2262">2262</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2262-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2262-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($item) = @_; </td> </tr> <tr> <td class="h" > <a name="2263">2263</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#2263-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $url = $item->first_child_text('link') </td> </tr> <tr> <td class="h" > <a name="2264">2264</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // return undef; </td> </tr> <tr> <td class="h" > <a name="2265">2265</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2265-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $url =~ m{^http://[^/]*yahoo\.com/.*\*(http://.*yahoo\.com.*)$} </td> </tr> <tr> <td class="h" > <a name="2266">2266</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> or return undef; </td> </tr> <tr> <td class="h" > <a name="2267">2267</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $1; </td> </tr> <tr> <td class="h" > <a name="2268">2268</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2269">2269</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2270">2270</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # This is a special case for Google Groups RSS feeds. </td> </tr> <tr> <td class="h" > <a name="2271">2271</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # The arguments are link elements [$name,$uri]. If there's a google groups </td> </tr> <tr> <td class="h" > <a name="2272">2272</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # like "http://groups.google.com/group/cfcdev/msg/445d4ccfdabf086b" then </td> </tr> <tr> <td class="h" > <a name="2273">2273</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return a mailing list address like "cfcdev@googlegroups.com". If not in </td> </tr> <tr> <td class="h" > <a name="2274">2274</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # that form then return undef. </td> </tr> <tr> <td class="h" > <a name="2275">2275</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="2276">2276</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub googlegroups_link_email { </td> </tr> <tr> <td class="h" > <a name="2277">2277</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ## no critic (RequireInterpolationOfMetachars) </td> </tr> <tr> <td class="h" > <a name="2278">2278</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2278-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2278-1"> 0 </a> </td> <td >   </td> <td class="s"> foreach my $l (@_) { </td> </tr> <tr> <td class="h" > <a name="2279">2279</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2279-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#2279-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($l->{'uri'} </td> </tr> <tr> <td class="h" > <a name="2280">2280</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> && $l->{'uri'}->canonical =~ m{^http://groups\.google\.com/group/([^/]+)/}) { </td> </tr> <tr> <td class="h" > <a name="2281">2281</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return ($1 . '@googlegroups.com'); </td> </tr> <tr> <td class="h" > <a name="2282">2282</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2283">2283</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2284">2284</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return undef; </td> </tr> <tr> <td class="h" > <a name="2285">2285</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2286">2286</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2287">2287</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # This is a nasty hack for http://www.aireview.com.au/rss.php </td> </tr> <tr> <td class="h" > <a name="2288">2288</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $url is a link url string just fetched, $resp is a HTTP::Response. The </td> </tr> <tr> <td class="h" > <a name="2289">2289</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return is a possibly new HTTP::Response object. </td> </tr> <tr> <td class="h" > <a name="2290">2290</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="2291">2291</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # The first fetch of an item link from aireview gives back content like </td> </tr> <tr> <td class="h" > <a name="2292">2292</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="2293">2293</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <META HTTP-EQUIV="Refresh" CONTENT="0; URL=?zz=1&&checkForCookies=1"> </td> </tr> <tr> <td class="h" > <a name="2294">2294</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="2295">2295</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # plus some cookies in the headers. The URL "zz=1" in that line seems very </td> </tr> <tr> <td class="h" > <a name="2296">2296</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # dodgy, it ends up going to the home page with mozilla. In any case a </td> </tr> <tr> <td class="h" > <a name="2297">2297</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # fresh fetch of the link url with the cookies provided is enough to get the </td> </tr> <tr> <td class="h" > <a name="2298">2298</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # actual content. </td> </tr> <tr> <td class="h" > <a name="2299">2299</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="2300">2300</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # The LWP::UserAgent::FramesReady module on cpan has a similar match of a </td> </tr> <tr> <td class="h" > <a name="2301">2301</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Refresh, for use with frames. It works by turning the response into a </td> </tr> <tr> <td class="h" > <a name="2302">2302</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # "302 Moved temporarily" for LWP to follow. urlcheck.pl at </td> </tr> <tr> <td class="h" > <a name="2303">2303</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # http://www.cpan.org/authors/id/P/PH/PHILMI/urlcheck-1.00.pl likewise </td> </tr> <tr> <td class="h" > <a name="2304">2304</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # follows. But alas both obey the URL given in the <META>, which is no good </td> </tr> <tr> <td class="h" > <a name="2305">2305</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # here. </td> </tr> <tr> <td class="h" > <a name="2306">2306</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="2307">2307</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub aireview_follow { </td> </tr> <tr> <td class="h" > <a name="2308">2308</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2308-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2308-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $url, $resp) = @_; </td> </tr> <tr> <td class="h" > <a name="2309">2309</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2310">2310</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2310-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($resp->is_success) { </td> </tr> <tr> <td class="h" > <a name="2311">2311</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $resp->decode; </td> </tr> <tr> <td class="h" > <a name="2312">2312</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $content = $resp->content; </td> </tr> <tr> <td class="h" > <a name="2313">2313</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2313-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($content =~ /<META[^>]*Refresh[^>]*checkForCookies/i) { </td> </tr> <tr> <td class="h" > <a name="2314">2314</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (1, ' following aireview META Refresh with cookies'); </td> </tr> <tr> <td class="h" > <a name="2315">2315</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require HTTP::Request; </td> </tr> <tr> <td class="h" > <a name="2316">2316</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $req = HTTP::Request->new (GET => $url); </td> </tr> <tr> <td class="h" > <a name="2317">2317</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $resp = $self->ua->request($req); </td> </tr> <tr> <td class="h" > <a name="2318">2318</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2319">2319</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2320">2320</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $resp; </td> </tr> <tr> <td class="h" > <a name="2321">2321</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2322">2322</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2323">2323</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2324">2324</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> #------------------------------------------------------------------------------ </td> </tr> <tr> <td class="h" > <a name="2325">2325</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # RSS links </td> </tr> <tr> <td class="h" > <a name="2326">2326</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2327">2327</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2328">2328</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # WordPress (http://wordpress.org/) pre 2.5 had a bug </td> </tr> <tr> <td class="h" > <a name="2329">2329</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # http://core.trac.wordpress.org/ticket/6579 where it gave </td> </tr> <tr> <td class="h" > <a name="2330">2330</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # type="appication/atom+xml" missing the "l" in "application/". </td> </tr> <tr> <td class="h" > <a name="2331">2331</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Don't want to workaround every bad generator, but this one is GPL </td> </tr> <tr> <td class="h" > <a name="2332">2332</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # free and the past versions still found for instance in the </td> </tr> <tr> <td class="h" > <a name="2333">2333</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # language log http://languagelog.ldc.upenn.edu/nll/ in Feb 2011 </td> </tr> <tr> <td class="h" > <a name="2334">2334</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="2335">2335</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub mime_type_is_rss { </td> </tr> <tr> <td class="h" > <a name="2336">2336</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2336-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2336-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $type) = @_; </td> </tr> <tr> <td class="h" > <a name="2337">2337</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return ($type =~ m{^appl?ication/atom\+xml$}); </td> </tr> <tr> <td class="h" > <a name="2338">2338</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2339">2339</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub atom_link_is_rss { </td> </tr> <tr> <td class="h" > <a name="2340">2340</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2340-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2340-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $elt) = @_; </td> </tr> <tr> <td class="h" > <a name="2341">2341</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#2341-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $type = $elt->att('atom:type') // $elt->att('type') // return 0; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2342">2342</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $self->mime_type_is_rss($type); </td> </tr> <tr> <td class="h" > <a name="2343">2343</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2344">2344</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2345">2345</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2346">2346</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2347">2347</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return list of hashrefs, each being </td> </tr> <tr> <td class="h" > <a name="2348">2348</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # { name => $str, </td> </tr> <tr> <td class="h" > <a name="2349">2349</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # uri => $uri_object, </td> </tr> <tr> <td class="h" > <a name="2350">2350</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # download => $boolean, </td> </tr> <tr> <td class="h" > <a name="2351">2351</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # priority => $number, </td> </tr> <tr> <td class="h" > <a name="2352">2352</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # } </td> </tr> <tr> <td class="h" > <a name="2353">2353</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="2354">2354</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Links are listed from highest to lowest priority. The current priority </td> </tr> <tr> <td class="h" > <a name="2355">2355</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # levels are </td> </tr> <tr> <td class="h" > <a name="2356">2356</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # 0 plain links </td> </tr> <tr> <td class="h" > <a name="2357">2357</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # -10 comment RSS </td> </tr> <tr> <td class="h" > <a name="2358">2358</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # -20 author home page </td> </tr> <tr> <td class="h" > <a name="2359">2359</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # -100 geo location text-only </td> </tr> <tr> <td class="h" > <a name="2360">2360</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # -101 statusnet geo location </td> </tr> <tr> <td class="h" > <a name="2361">2361</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # -200 <source>, <media:credit>, <itunes:explicit> </td> </tr> <tr> <td class="h" > <a name="2362">2362</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="2363">2363</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub item_to_links { </td> </tr> <tr> <td class="h" > <a name="2364">2364</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2364-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#2364-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $item) = @_; </td> </tr> <tr> <td class="h" > <a name="2365">2365</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2366">2366</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <feedburner:origLink> or <feedburner:origEnclosureLink> is when </td> </tr> <tr> <td class="h" > <a name="2367">2367</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # something has been expanded into the item, or should it be shown? </td> </tr> <tr> <td class="h" > <a name="2368">2368</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2369">2369</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # FIXME: <media:content> can be a link, but have seen it just duplicating </td> </tr> <tr> <td class="h" > <a name="2370">2370</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <enclosure> without a length. Would probably skip medium="image". </td> </tr> <tr> <td class="h" > <a name="2371">2371</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Can have a <media:title> sub-element. </td> </tr> <tr> <td class="h" > <a name="2372">2372</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="2373">2373</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # ENHANCE-ME: <media:content> can have a file size and duration. </td> </tr> <tr> <td class="h" > <a name="2374">2374</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="2375">2375</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # FIXME: <media:group> is a collection of <media:content> in different </td> </tr> <tr> <td class="h" > <a name="2376">2376</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # formats etc. Have seen this from archive.org just duplicating </td> </tr> <tr> <td class="h" > <a name="2377">2377</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <enclosure>. </td> </tr> <tr> <td class="h" > <a name="2378">2378</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="2379">2379</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <wfw:commentRss> appeared in the spec page as wfw:commentRSS, so ignore </td> </tr> <tr> <td class="h" > <a name="2380">2380</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # case. </td> </tr> <tr> <td class="h" > <a name="2381">2381</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="2382">2382</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my @elts = $item->children (qr/^(link </td> </tr> <tr> <td class="h" > <a name="2383">2383</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |enclosure </td> </tr> <tr> <td class="h" > <a name="2384">2384</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |content </td> </tr> <tr> <td class="h" > <a name="2385">2385</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |wiki:diff </td> </tr> <tr> <td class="h" > <a name="2386">2386</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |wiki:history </td> </tr> <tr> <td class="h" > <a name="2387">2387</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |comments </td> </tr> <tr> <td class="h" > <a name="2388">2388</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |wfw:comment </td> </tr> <tr> <td class="h" > <a name="2389">2389</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |wfw:commentRss </td> </tr> <tr> <td class="h" > <a name="2390">2390</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |foaf:maker </td> </tr> <tr> <td class="h" > <a name="2391">2391</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |sioc:has_creator </td> </tr> <tr> <td class="h" > <a name="2392">2392</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |sioc:has_discussion </td> </tr> <tr> <td class="h" > <a name="2393">2393</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |sioc:links_to </td> </tr> <tr> <td class="h" > <a name="2394">2394</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |sioc:reply_of </td> </tr> <tr> <td class="h" > <a name="2395">2395</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |statusnet:origin </td> </tr> <tr> <td class="h" > <a name="2396">2396</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |dc:source </td> </tr> <tr> <td class="h" > <a name="2397">2397</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> )$/ix); </td> </tr> <tr> <td class="h" > <a name="2398">2398</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### link elts: "@elts" </td> </tr> <tr> <td class="h" > <a name="2399">2399</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2400">2400</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my @links; </td> </tr> <tr> <td class="h" > <a name="2401">2401</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $elt (@elts) { </td> </tr> <tr> <td class="h" > <a name="2402">2402</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2402-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($self->{'verbose'} >= 2) { </td> </tr> <tr> <td class="h" > <a name="2403">2403</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require Text::Wrap; </td> </tr> <tr> <td class="h" > <a name="2404">2404</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local $Text::Wrap::huge = 'overflow'; # don't break long URLs etc </td> </tr> <tr> <td class="h" > <a name="2405">2405</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, "link\n", Text::Trim::trim($elt->sprint)); </td> </tr> <tr> <td class="h" > <a name="2406">2406</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2407">2407</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2408">2408</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $tag = lc($elt->tag); </td> </tr> <tr> <td class="h" > <a name="2409">2409</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### $tag </td> </tr> <tr> <td class="h" > <a name="2410">2410</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2410-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#2410-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($tag eq 'content' && atom_content_flavour($elt) ne 'link') { </td> </tr> <tr> <td class="h" > <a name="2411">2411</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> next; </td> </tr> <tr> <td class="h" > <a name="2412">2412</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2413">2413</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $l = { download => 1 }; </td> </tr> <tr> <td class="h" > <a name="2414">2414</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2415">2415</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $name ('hreflang', 'title', 'type') { </td> </tr> <tr> <td class="h" > <a name="2416">2416</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#2416-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{$name} = ($elt->att("atom:$name") // $elt->att($name)); </td> </tr> <tr> <td class="h" > <a name="2417">2417</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2418">2418</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2419">2419</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#2419-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $rel = non_empty($elt->att('atom:rel') // $elt->att('rel')); </td> </tr> <tr> <td class="h" > <a name="2420">2420</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2420-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined $rel) { </td> </tr> <tr> <td class="h" > <a name="2421">2421</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Atom rel="..." </td> </tr> <tr> <td class="h" > <a name="2422">2422</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Maybe: if ($rel eq 'next') ... # not sure about "next" link </td> </tr> <tr> <td class="h" > <a name="2423">2423</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2424">2424</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2424-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#2424-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($rel eq 'self' # the feed itself (in the channel normally) </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-3"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2425">2425</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || $rel eq 'edit' # to edit the item, maybe </td> </tr> <tr> <td class="h" > <a name="2426">2426</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || $rel eq 'service.edit' # to edit the item </td> </tr> <tr> <td class="h" > <a name="2427">2427</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || $rel eq 'license' # probably only in the channel part normally </td> </tr> <tr> <td class="h" > <a name="2428">2428</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ) { </td> </tr> <tr> <td class="h" > <a name="2429">2429</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (1, ' ', __x('skip link "{type}"', type => $rel)); </td> </tr> <tr> <td class="h" > <a name="2430">2430</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> next; </td> </tr> <tr> <td class="h" > <a name="2431">2431</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2432">2432</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2432-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($rel eq 'alternate') { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-3"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-4"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-5"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-6"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-7"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-8"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2433">2433</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # "alternate" is supposed to be the content as the entry, but in a </td> </tr> <tr> <td class="h" > <a name="2434">2434</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # web page or something. Not sure that's always quite true, so show </td> </tr> <tr> <td class="h" > <a name="2435">2435</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # it as a plain link. If no <content> then an "alternate" is </td> </tr> <tr> <td class="h" > <a name="2436">2436</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # supposed to be mandatory. </td> </tr> <tr> <td class="h" > <a name="2437">2437</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2438">2438</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($rel eq 'enclosure') { </td> </tr> <tr> <td class="h" > <a name="2439">2439</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} = __('Encl'); </td> </tr> <tr> <td class="h" > <a name="2440">2440</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2441">2441</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($rel eq 'ostatus:conversation') { </td> </tr> <tr> <td class="h" > <a name="2442">2442</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} = __('Conversation'); </td> </tr> <tr> <td class="h" > <a name="2443">2443</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'download'} = 0; </td> </tr> <tr> <td class="h" > <a name="2444">2444</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2445">2445</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($rel eq 'ostatus:attention') { </td> </tr> <tr> <td class="h" > <a name="2446">2446</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} = __('Attention'); </td> </tr> <tr> <td class="h" > <a name="2447">2447</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'download'} = 0; </td> </tr> <tr> <td class="h" > <a name="2448">2448</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2449">2449</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($rel eq 'related') { </td> </tr> <tr> <td class="h" > <a name="2450">2450</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} = __('Related'); </td> </tr> <tr> <td class="h" > <a name="2451">2451</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2452">2452</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($rel eq 'replies') { </td> </tr> <tr> <td class="h" > <a name="2453">2453</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Atom <link rel="replies" per RFC 4685 "thr:" spec </td> </tr> <tr> <td class="h" > <a name="2454">2454</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $count = $self->item_elt_comments_count($item,$elt); </td> </tr> <tr> <td class="h" > <a name="2455">2455</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2455-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($self->atom_link_is_rss($elt)) { </td> </tr> <tr> <td class="h" > <a name="2456">2456</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2456-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} = (defined $count </td> </tr> <tr> <td class="h" > <a name="2457">2457</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ? __x('RSS Replies({count})', count => $count) </td> </tr> <tr> <td class="h" > <a name="2458">2458</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> : __('RSS Replies')); </td> </tr> <tr> <td class="h" > <a name="2459">2459</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'priority'} = -10; </td> </tr> <tr> <td class="h" > <a name="2460">2460</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="2461">2461</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2461-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} = (defined $count </td> </tr> <tr> <td class="h" > <a name="2462">2462</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ? __x('Replies({count})', count => $count) </td> </tr> <tr> <td class="h" > <a name="2463">2463</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> : __('Replies')); </td> </tr> <tr> <td class="h" > <a name="2464">2464</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2465">2465</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'download'} = 0; </td> </tr> <tr> <td class="h" > <a name="2466">2466</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2467">2467</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($rel eq 'service.post') { </td> </tr> <tr> <td class="h" > <a name="2468">2468</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} = __('Comments'); </td> </tr> <tr> <td class="h" > <a name="2469">2469</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'download'} = 0; </td> </tr> <tr> <td class="h" > <a name="2470">2470</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2471">2471</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($rel eq 'via') { </td> </tr> <tr> <td class="h" > <a name="2472">2472</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} = __('Via'); </td> </tr> <tr> <td class="h" > <a name="2473">2473</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'download'} = 0; </td> </tr> <tr> <td class="h" > <a name="2474">2474</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2475">2475</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="2476">2476</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} = __x('{linkrel}', linkrel => $rel); </td> </tr> <tr> <td class="h" > <a name="2477">2477</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2478">2478</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2479">2479</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { # ! defined $rel </td> </tr> <tr> <td class="h" > <a name="2480">2480</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # tags without rel="" attribute </td> </tr> <tr> <td class="h" > <a name="2481">2481</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="2482">2482</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2482-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($tag eq 'enclosure') { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-3"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-4"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-5"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-6"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-7"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-8"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-9"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2483">2483</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} = __('Encl'); </td> </tr> <tr> <td class="h" > <a name="2484">2484</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2485">2485</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($tag eq 'dc:source') { </td> </tr> <tr> <td class="h" > <a name="2486">2486</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} = __('Source'); </td> </tr> <tr> <td class="h" > <a name="2487">2487</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'download'} = 0; </td> </tr> <tr> <td class="h" > <a name="2488">2488</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2489">2489</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($tag eq 'wiki:diff') { </td> </tr> <tr> <td class="h" > <a name="2490">2490</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} = __('Diff'); </td> </tr> <tr> <td class="h" > <a name="2491">2491</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2492">2492</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($tag eq 'wiki:history') { </td> </tr> <tr> <td class="h" > <a name="2493">2493</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} = __('History'); </td> </tr> <tr> <td class="h" > <a name="2494">2494</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'download'} = 0; </td> </tr> <tr> <td class="h" > <a name="2495">2495</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2496">2496</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($tag =~ /foaf:maker|sioc:has_creator/) { </td> </tr> <tr> <td class="h" > <a name="2497">2497</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} = __('Author'); </td> </tr> <tr> <td class="h" > <a name="2498">2498</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'download'} = 0; </td> </tr> <tr> <td class="h" > <a name="2499">2499</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'priority'} = -20; # low </td> </tr> <tr> <td class="h" > <a name="2500">2500</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2501">2501</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($tag eq 'statusnet:origin') { </td> </tr> <tr> <td class="h" > <a name="2502">2502</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} = __('Geo location'); </td> </tr> <tr> <td class="h" > <a name="2503">2503</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'download'} = 0; </td> </tr> <tr> <td class="h" > <a name="2504">2504</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'priority'} = -101; # just after Geo location </td> </tr> <tr> <td class="h" > <a name="2505">2505</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2506">2506</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($tag eq 'sioc:has_discussion') { </td> </tr> <tr> <td class="h" > <a name="2507">2507</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} = __('Discussion'); </td> </tr> <tr> <td class="h" > <a name="2508">2508</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'download'} = 0; </td> </tr> <tr> <td class="h" > <a name="2509">2509</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2510">2510</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($tag eq 'wfw:commentrss') { </td> </tr> <tr> <td class="h" > <a name="2511">2511</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2511-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined (my $count = $self->item_elt_comments_count($item,$elt))) { </td> </tr> <tr> <td class="h" > <a name="2512">2512</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} = __x('RSS Comments({count})', count => $count); </td> </tr> <tr> <td class="h" > <a name="2513">2513</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="2514">2514</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} = __('RSS Comments'); </td> </tr> <tr> <td class="h" > <a name="2515">2515</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2516">2516</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'download'} = 0; </td> </tr> <tr> <td class="h" > <a name="2517">2517</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'priority'} = -10; </td> </tr> <tr> <td class="h" > <a name="2518">2518</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2519">2519</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($tag =~ /comment/) { # <comments> or <wfw:comment> </td> </tr> <tr> <td class="h" > <a name="2520">2520</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2520-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined (my $count = $self->item_elt_comments_count($item,$elt))) { </td> </tr> <tr> <td class="h" > <a name="2521">2521</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} = __x('Comments({count})', count => $count); </td> </tr> <tr> <td class="h" > <a name="2522">2522</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="2523">2523</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} = __('Comments'); </td> </tr> <tr> <td class="h" > <a name="2524">2524</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2525">2525</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'download'} = 0; </td> </tr> <tr> <td class="h" > <a name="2526">2526</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2527">2527</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2528">2528</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2529">2529</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Atom <link href="http:.."/> </td> </tr> <tr> <td class="h" > <a name="2530">2530</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # RSS <link>http:..</link> </td> </tr> <tr> <td class="h" > <a name="2531">2531</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # RSS <enclosure url="http:.."> </td> </tr> <tr> <td class="h" > <a name="2532">2532</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#2532-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $uri = (non_empty ($elt->att('atom:href')) # Atom <link> </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-3"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-4"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-5"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-6"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-7"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2533">2533</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // non_empty ($elt->att('href')) # Atom <link> </td> </tr> <tr> <td class="h" > <a name="2534">2534</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // non_empty ($elt->att('atom:src')) # Atom <content> </td> </tr> <tr> <td class="h" > <a name="2535">2535</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // non_empty ($elt->att('src')) # Atom <content> </td> </tr> <tr> <td class="h" > <a name="2536">2536</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // non_empty ($elt->att('url')) # RSS <enclosure> </td> </tr> <tr> <td class="h" > <a name="2537">2537</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <foaf:maker>, <statusnet:origin> rdf:resource="" </td> </tr> <tr> <td class="h" > <a name="2538">2538</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // non_empty ($elt->att('rdf:resource')) </td> </tr> <tr> <td class="h" > <a name="2539">2539</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // non_empty ($elt->trimmed_text) # RSS <link> </td> </tr> <tr> <td class="h" > <a name="2540">2540</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // next); </td> </tr> <tr> <td class="h" > <a name="2541">2541</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $uri = App::RSS2Leafnode::XML::Twig::Other::elt_xml_based_uri ($elt, $uri); </td> </tr> <tr> <td class="h" > <a name="2542">2542</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2543">2543</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'uri'} = $uri; </td> </tr> <tr> <td class="h" > <a name="2544">2544</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#2544-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} //= __('Link'); </td> </tr> <tr> <td class="h" > <a name="2545">2545</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2546">2546</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my @paren; </td> </tr> <tr> <td class="h" > <a name="2547">2547</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # show length if biggish, often provided on enclosures but not plain </td> </tr> <tr> <td class="h" > <a name="2548">2548</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # links </td> </tr> <tr> <td class="h" > <a name="2549">2549</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2549-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#2549-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined (my $length = ($elt->att('atom:length') </td> </tr> <tr> <td class="h" > <a name="2550">2550</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // $elt->att('length')))) { </td> </tr> <tr> <td class="h" > <a name="2551">2551</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> push @paren, $self->format_size_in_bytes($length); </td> </tr> <tr> <td class="h" > <a name="2552">2552</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2553">2553</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <itunes:duration> applies to <enclosure>. Just a number means </td> </tr> <tr> <td class="h" > <a name="2554">2554</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # seconds, otherwise MM:SS or HH:MM:SS. </td> </tr> <tr> <td class="h" > <a name="2555">2555</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2555-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#2555-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($tag eq 'enclosure' </td> </tr> <tr> <td class="h" > <a name="2556">2556</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> && defined (my $duration = non_empty ($item->first_child_text('itunes:duration')))) { </td> </tr> <tr> <td class="h" > <a name="2557">2557</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2557-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($duration !~ /:/) { </td> </tr> <tr> <td class="h" > <a name="2558">2558</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $duration = __px('s-for-seconds', '{duration}s', </td> </tr> <tr> <td class="h" > <a name="2559">2559</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> duration => $duration); </td> </tr> <tr> <td class="h" > <a name="2560">2560</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2561">2561</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> push @paren, $duration; </td> </tr> <tr> <td class="h" > <a name="2562">2562</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2563">2563</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#2563-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (@paren) { </td> </tr> <tr> <td class="h" > <a name="2564">2564</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $l->{'name'} .= '('.join(', ',@paren). ')'; </td> </tr> <tr> <td class="h" > <a name="2565">2565</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2566">2566</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2567">2567</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### push link: $l </td> </tr> <tr> <td class="h" > <a name="2568">2568</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> push @links, $l; </td> </tr> <tr> <td class="h" > <a name="2569">2569</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="2570">2570</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="2571">2571</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # eg. RSS <source url="http://foo.org/feed.rss">other feed name</source> </td> </tr> <tr> <td class="h" > <a name="2572">2572</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Atom <source> </td> </tr> <tr> <td class="h" > <a name="2573">2573</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <id>...url...</id> </td> </tr> <tr> <td class="h" > <a name="2574">2574</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <title>Feed Name
2575             #
2576             # ...image-url...
2577             #
2578             #
2579             #
2580 0           foreach my $elt ($item->children('source')) {
2581 0   0       my $str = non_empty (elt_to_rendered_line($elt->first_child('title')))
2582             // non_empty ($elt->trimmed_text);
2583 0 0         if (defined $str) {
2584             ### source: $str
2585 0           push @links, { name => __('Source') . ": $str",
2586             download => 0,
2587             priority => -200,
2588             };
2589             }
2590 0           foreach my $subelt
  0            
2591             ($elt,
2592             grep {$self->atom_link_is_rss($_)} $elt->children('link')
2593             ) {
2594 0 0 0       if (defined $subelt
      0        
      0        
2595             && defined (my $url = non_empty ($subelt->att('url'))
2596             // non_empty ($subelt->att('href'))
2597             // non_empty ($subelt->att('atom:href')))) {
2598 0           push @links, { name => __('Source RSS'),
2599             uri => App::RSS2Leafnode::XML::Twig::Other::elt_xml_based_uri($subelt,$url),
2600             download => 0,
2601             priority => -200,
2602             };
2603             }
2604             }
2605             }
2606              
2607             # Merge together duplicate urls, so as not to download two copies as
2608             # attachments, and so as to make it clear when there's only one
2609             # destination for two things.
2610             #
2611             # Have seen same url under and from sourceforge
2612             # http://sourceforge.net/export/rss2_keepsake.php?group_id=203650
2613             # or same url under and
2614             # http://abc.net.au/rn/podcast/feeds/sci.xml
2615             {
2616 0           my %seen;
  0            
2617 0           @links = grep {
2618 0           my $l = $_;
2619 0           my $want = 1;
2620 0 0         if (my $uri = $l->{'uri'}) {
2621 0           my $canonical = $uri->canonical;
2622 0           $canonical->fragment(undef); # ignore #foo anchor for uniqueness
2623 0 0         if (my $prev_l = $seen{$canonical}) {
2624 0           $want = 0;
2625 0   0       $prev_l->{'download'} ||= $l->{'download'};
2626 0   0       $l->{'priority'} = max ($l->{'priority'}||0,
      0        
2627             $prev_l->{'priority'}||0);
2628              
2629             # prefer no anchor if have both with and without
2630 0 0         if (is_empty($l->{'uri'}->fragment)) {
2631 0           $prev_l->{'uri'} = $l->{'uri'};
2632             }
2633              
2634 0 0         if ($prev_l->{'name'} eq __('Link')) {
    0          
    0          
2635             # name "Link" doesn't say much, prefer the other over "Link"
2636 0           $prev_l->{'name'} = $l->{'name'};
2637             } elsif ($l->{'name'} eq __('Link')) {
2638             # don't append "Link" to the previous
2639             } elsif ($l->{'name'} eq $prev_l->{'name'}) {
2640             # don't double the same name
2641             } else {
2642 0           $prev_l->{'name'} .= ", $l->{'name'}";
2643             }
2644             }
2645 0           $seen{$canonical} = $l;
2646             }
2647             $want
2648 0           } @links;
2649             }
2650 0           foreach my $l (@links) {
2651 0 0         if ($l->{'uri'}) {
2652 0           $l->{'name'} .= ':';
2653             }
2654             }
2655              
2656 0 0         if (defined (my $str = $self->item_to_lat_long_alt_str ($item))) {
2657 0           push @links, { name => $str,
2658             download => 0,
2659             priority => -100, # lat/long low priority
2660             };
2661             }
2662              
2663             # re:rank as for example from stackexchange.com
2664             # What does label="" usually show? Are parens like this good?
2665 0           foreach my $elt ($item->children('re:rank')) {
2666 0           my $label = $elt->att('label');
2667 0           my $value = elt_to_rendered_line($elt);
2668 0 0         push @links, { name => (defined $label
2669             ? __x('Rank: {value} ({label})', value => $value, label => $label)
2670             : __x('Rank: {value}', value => $value)),
2671             download => 0,
2672             priority => -200, # low priority
2673             };
2674             }
2675              
2676             # eg. AFP
2677             # is there any value in the role="" part?
2678 0           foreach my $elt ($item->children('media:credit')) {
2679 0           push @links, { name => __x('Credit: {who}',
2680             who => scalar(elt_to_rendered_line($elt))),
2681             download => 0,
2682             priority => -200, # very low priority
2683             };
2684             }
2685              
2686             # no
2687             #
2688             # Allow for empty as found
2689             # http://abc.net.au/rn/podcast/feeds/sci.xml
2690             #
2691 0           foreach my $elt ($item->children('itunes:explicit')) {
2692 0   0       my $line = elt_to_rendered_line($elt)
2693             // next; # skip empty
2694 0           push @links, { name => __x('Explicit: {value}', value => $line),
2695             download => 0,
2696             priority => -200, # very low priority
2697             };
2698             }
2699              
2700             # blasting-it-into-the-sun-is-not-a-viable-option
2701             # a fun kind of commentary thing
2702 0           foreach my $elt ($item->children('slash:department')) {
2703 0           push @links, { name => __x('Department: {department}',
2704             department => scalar(elt_to_rendered_line($elt))),
2705             download => 0,
2706             priority => -200, # very low priority
2707             };
2708             }
2709              
2710 0           return @links;
2711             }
2712             @known{qw(
2713             /channel/item/pheedo:origLink
2714             /channel/item/feedburner:origLink
2715              
2716             /channel/item/link
2717             /channel/item/enclosure
2718             /channel/item/dc:source
2719             /channel/item/comments
2720             /channel/item/wfw:comment
2721             /channel/item/wfw:commentRss
2722             /channel/item/slash:comments
2723             /channel/item/slash:hit_parade
2724             /channel/item/slash:department
2725             /channel/item/thr:total
2726             /channel/item/content --atom
2727             /channel/item/wiki:diff
2728             /channel/item/itunes:duration
2729             /channel/item/re:rank
2730              
2731             /channel/wiki:interwiki
2732             /channel/wiki:interwiki/rdf:Description
2733             /channel/wiki:interwiki/rdf:Description/rdf:value
2734             /channel/item/wiki:version
2735             /channel/item/wiki:status
2736             /channel/item/wiki:history
2737             /channel/item/foaf:maker
2738             /channel/item/sioc:has_creator
2739             /channel/item/sioc:has_discussion
2740             /channel/item/sioc:links_to
2741             /channel/item/sioc:reply_of
2742             /channel/item/media:credit
2743             /channel/item/itunes:explicit
2744             /channel/item/itunes:block
2745              
2746             --believed-to-be-duplicate-of-description
2747             /channel/item/media:content
2748             /channel/item/media:text
2749             )} = ();
2750              
2751             # sub any_link_replies_nonfeed {
2752             # foreach my $elt (@_) {
2753             # # ### any_link_replies_nonfeed(): ref $elt, "$elt", $elt->tag
2754             # # my $rel = ($elt->att('atom:rel') // $elt->att('rel') // '');
2755             # # my $type = ($elt->att('atom:type') // $elt->att('type') // '');
2756             # # ### $rel
2757             # # ### $type
2758             # if ($elt->tag eq 'link'
2759             # && (($elt->att('atom:rel') // $elt->att('rel') // '')
2760             # eq 'replies')
2761             # && (($elt->atom_link_is_rss($elt))) {
2762             # return 1;
2763             # }
2764             # }
2765             # return 0;
2766             # }
2767              
2768             # Return a string which is the latitude, longitude and possibly altitude
2769             # from the item. If no location in the item then return undef.
2770             #
2771             sub item_to_lat_long_alt_str {
2772 0     0 0   my ($self, $item) = @_;
2773 0 0         my ($lat, $long, $alt) = $self->item_to_lat_long_alt_values ($item)
2774             or return;
2775             ### $lat
2776             ### $long
2777             ### $alt
2778              
2779 0 0         if (Scalar::Util::looks_like_number($lat)) {
2780 0 0         $lat = ($lat >= 0
2781             # TRANSLATORS: the latin1/unicode degree symbol can be used here
2782             # instead of " deg", if it will be recognised in translation,
2783             # etc.
2784             ? __x('{latitude} deg N', latitude => $lat)
2785             : __x('{latitude} deg S', latitude => -$lat));
2786             }
2787 0 0         if (Scalar::Util::looks_like_number($long)) {
2788 0 0         $long = ($long >= 0
2789             ? __x('{longitude} deg E', longitude => $long)
2790             : __x('{longitude} deg W', longitude => -$long));
2791             }
2792              
2793 0 0         if (is_non_empty ($alt)) {
2794 0           return __x('Geo location: {latitude}, {longitude}, alt {altitude}m',
2795             latitude => $lat,
2796             longitude => $long,
2797             altitude => $alt);
2798             } else {
2799 0           return __x('Geo location: {latitude}, {longitude}',
2800             latitude => $lat,
2801             longitude => $long);
2802             }
2803             }
2804              
2805             # Return a list of values which are the latitude, longitude and possibly
2806             # altitude extracted from $item.
2807             #
2808             # ($latitude, $longitude, $altitude)
2809             # ($latitude, $longitude)
2810             # ()
2811             #
2812             # If no location then return an empty list. Some of the values returned
2813             # might be empty strings if say there's a but missing .
2814             #
2815             # Latitude is degrees North, or negative for South. Longitude is degrees
2816             # East, or negative for West. Both possibly with decimal places.
2817             #
2818             sub item_to_lat_long_alt_values {
2819 0     0 0   my ($self, $item) = @_;
2820              
2821             # per-item , eg. USGS earthquakes
2822             # http://earthquake.usgs.gov/eqcenter/recenteqsww/catalogs/eqs7day-M5.xml
2823             #
2824             # 11
2825             # 22
2826             #
2827             # or under geo:Point, maybe, eg. http://www.gdacs.org/xml/RSSTC.xml
2828             #
2829             #
2830             # 11
2831             # 22
2832             #
2833 0           foreach my $elt ($item, $item->children(qr/^geo:point$/i)) {
2834 0           my $lat = $elt->first_child_trimmed_text('geo:lat');
2835 0 0         if (is_non_empty ($lat)) {
2836 0           return ($lat,
2837             $elt->first_child_trimmed_text('geo:long'),
2838             non_empty ($elt->first_child_trimmed_text('geo:alt')));
2839             }
2840             }
2841              
2842             #
2843             # 46.183 -123.816
2844             # space separator per http://www.georss.org/Encodings
2845             {
2846 0           my $str = $item->first_child_trimmed_text ('georss:point');
  0            
2847 0 0         if (is_non_empty ($str)) {
2848 0           return split(/\s+/, $str, 2); # no altitude
2849             }
2850             }
2851              
2852             #
2853             #
2854             # rdf:resource="http://sws.geonames.org/2638077/">
2855             #
2856 0 0         if (my $elt = $item->first_child ('statusnet:origin')) {
2857 0 0         if (defined (my $lat = $elt->att('geo:lat'))) {
2858 0           my $long = $elt->att('geo:long');
2859 0           return ($lat, $long);
2860             }
2861             }
2862              
2863 0           return; # not found
2864             }
2865             @known{qw(/channel/item/geo:lat
2866             /channel/item/geo:long
2867             /channel/item/geo:alt
2868             /channel/item/geo:Point
2869             /channel/item/geo:Point/geo:lat
2870             /channel/item/geo:Point/geo:long
2871             /channel/item/georss:point
2872             /channel/item/statusnet:origin
2873             )} = ();
2874              
2875              
2876             sub links_to_html {
2877 0 0   0 0   @_ or return '';
2878              
2879             # on link lines to try to prevent the displayed URL being chopped
2880             # up by a line-wrap, which can make it hard to cut and paste.
 can 
2881             # prevent a line wrap, but it ends up treated as starting a paragraph,
2882             # separate from the 'name' part.
2883             #
2884 0           my $str = '';
2885 0           my $sep = "\n\n

\n";

2886 0           foreach my $l (@_) {
2887 0           $str .= "$sep$Entitize{$l->{'name'}}";
2888 0           $sep = "
\n";
2889              
2890 0 0         if (defined (my $uri = $l->{'uri'})) {
2891 0           $str .= " 
2892 0 0         if (defined (my $hreflang = $l->{'hreflang'})) {
2893 0           $str .= " hreflang=\"$Entitize{$hreflang}\"";
2894             }
2895 0 0         if (defined (my $type = $l->{'type'})) {
2896 0           $str .= " type=\"$Entitize{$type}\"";
2897             }
2898 0           $uri = $Entitize{$uri};
2899 0           $str .= " href=\"$uri\">$uri";
2900             }
2901 0           $str .= "\n";
2902             }
2903 0           return "$str

\n";
2904             }
2905              
2906             sub links_to_text {
2907 0     0 0   return join ('', map { join_non_empty (' ',
  0            
2908             $_->{'name'},
2909             $_->{'uri'}) . "\n" } @_);
2910             }
2911              
2912              
2913             #------------------------------------------------------------------------------
2914             # "From:" and email addresses
2915              
2916 1     1   11072 use constant DUMMY_EMAIL_ADDRESS => 'nobody@rss2leafnode.dummy';
  1         10  
  1         8161  
2917              
2918             {
2919             my %tag_to_link_name
2920             = (author => __('Author:'),
2921             creator => __('Creator:'),
2922             contributor => __('Contributor:'),
2923             managingEditor => __('Managing Editor:'),
2924             webMaster => __('Webmaster:'),
2925             publisher => __('Publisher:'),
2926             owner => __('Owner:'),
2927             username => __('User:'),
2928             );
2929              
2930             # Return ($from, $linkhash,$linkhash,...).
2931             # $from is a string like "foo@example.com".
2932             # Multiple authors are for example "foo@example.com, quux@example.com" as
2933             # per RFC5322 email, though currently no Sender: is picked out from among
2934             # them.
2935             #
2936             sub item_to_from {
2937 0     0 0   my ($self, $item) = @_;
2938             ### item_to_from() ...
2939 0           my $channel = item_to_channel($item);
2940              
2941             # is supposed to be an email address whereas is
2942             # looser. The RSS recommendation is when revealing an email
2943             # and when hiding it.
2944             #
2945             # is ahead of since has a url
2946             # attribute.
2947             #
2948             # appears in wiki: feeds as the item's author.
2949             #
2950             # can appear multiple times in Atom item. For now prefer
2951             # to show just the primary author or authors.
2952             #
2953             # The first
2954             #
2955 0           my @from;
2956             my @links;
2957 0           foreach my $try ([$item, 'author'],
2958             [$item, 'jf:author'],
2959             [$item, 'slate:author'],
2960             [$item, 'dc:creator'],
2961             [$item, 'dc:contributor'],
2962             [$item, 'wiki:username'],
2963             [$item, 'itunes:author'],
2964              
2965             [$channel, 'author'],
2966             [$channel, 'dc:creator'],
2967             [$channel, 'itunes:author'],
2968             [$channel, 'managingEditor'],
2969             [$channel, 'webMaster'],
2970              
2971             [$item , 'dc:publisher'],
2972             [$channel, 'dc:publisher'],
2973             [$channel, 'itunes:owner'],
2974             ) {
2975 0           my ($where, $tag) = @$try;
2976             ### $tag
2977              
2978 0 0         if (my @elts = $item->children($tag)) {
2979 0           foreach my $elt (@elts) {
2980             ### elt for From: $elt->sprint
2981 0           push @from, $self->elt_to_email($elt);
2982              
2983             # author's home page etc as a link
2984 0 0 0       if (my $uri =
      0        
2985             (# Atom
2986             #
2987             # Foo Bar
2988             # http://some.where
2989             #
2990             #
2991             non_empty ($elt->first_child_text('uri'))
2992              
2993             # slate.com
2994             # Joe Bloggs
2995             // non_empty ($elt->att('url'))
2996              
2997             # ModWiki dc:contributor example
2998             #
2999             # Foo Bar
3000             #
3001             # The text shows rss:link= and the example just link=.
3002             #
3003             // non_empty (do {
3004 0 0 0       my $child; ($child = $elt->first_child('rdf:Description'))
  0            
3005             && ($child->att('link') // $child->att('rss:link'))
3006             }))) {
3007 0           my $tag = $elt->tag;
3008 0           $tag =~ s/.*?://;
3009 0   0       push @links, { uri => URI->new($uri),
3010             name => ($tag_to_link_name{$tag} // "\u$tag:"),
3011             download => 0,
3012             priority => -20 };
3013             }
3014             }
3015             }
3016 0 0         last if @from;
3017             }
3018 0 0         if (! @from) {
3019             # Atom can have type="html" etc in the usual way, so render. </td> </tr> <tr> <td class="h" > <a name="3020">3020</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Hope the channel title is different from the item title. </td> </tr> <tr> <td class="h" > <a name="3021">3021</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @from = ($self->email_format (elt_to_rendered_line </td> </tr> <tr> <td class="h" > <a name="3022">3022</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ($channel->first_child('title')))); </td> </tr> <tr> <td class="h" > <a name="3023">3023</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3024">3024</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3024-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! @from) { </td> </tr> <tr> <td class="h" > <a name="3025">3025</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @from = ('nobody@'.$self->uri_to_host); </td> </tr> <tr> <td class="h" > <a name="3026">3026</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3027">3027</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3028">3028</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### @from </td> </tr> <tr> <td class="h" > <a name="3029">3029</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return (join(', ',@from), </td> </tr> <tr> <td class="h" > <a name="3030">3030</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @links); </td> </tr> <tr> <td class="h" > <a name="3031">3031</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3032">3032</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @known{qw(/channel/author </td> </tr> <tr> <td class="h" > <a name="3033">3033</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/author/name --atom </td> </tr> <tr> <td class="h" > <a name="3034">3034</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/author/uri --atom </td> </tr> <tr> <td class="h" > <a name="3035">3035</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/author/url --atom-typo-maybe </td> </tr> <tr> <td class="h" > <a name="3036">3036</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/author/email --atom </td> </tr> <tr> <td class="h" > <a name="3037">3037</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/managingEditor </td> </tr> <tr> <td class="h" > <a name="3038">3038</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/webMaster </td> </tr> <tr> <td class="h" > <a name="3039">3039</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/dc:publisher </td> </tr> <tr> <td class="h" > <a name="3040">3040</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/dc:creator </td> </tr> <tr> <td class="h" > <a name="3041">3041</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/itunes:author </td> </tr> <tr> <td class="h" > <a name="3042">3042</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3043">3043</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/author </td> </tr> <tr> <td class="h" > <a name="3044">3044</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/author/name --atom </td> </tr> <tr> <td class="h" > <a name="3045">3045</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/author/uri --atom </td> </tr> <tr> <td class="h" > <a name="3046">3046</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/author/url --atom-typo-maybe </td> </tr> <tr> <td class="h" > <a name="3047">3047</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/author/email --atom </td> </tr> <tr> <td class="h" > <a name="3048">3048</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/author/gd:extendedProperty --good-dinner </td> </tr> <tr> <td class="h" > <a name="3049">3049</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/dc:creator </td> </tr> <tr> <td class="h" > <a name="3050">3050</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/dc:publisher </td> </tr> <tr> <td class="h" > <a name="3051">3051</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/wiki:username </td> </tr> <tr> <td class="h" > <a name="3052">3052</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/itunes:author </td> </tr> <tr> <td class="h" > <a name="3053">3053</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/dc:contributor </td> </tr> <tr> <td class="h" > <a name="3054">3054</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/dc:contributor/rdf:Description </td> </tr> <tr> <td class="h" > <a name="3055">3055</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/dc:contributor/rdf:Description/rdf:value </td> </tr> <tr> <td class="h" > <a name="3056">3056</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/jf:author </td> </tr> <tr> <td class="h" > <a name="3057">3057</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/slate:author </td> </tr> <tr> <td class="h" > <a name="3058">3058</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3059">3059</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/contributor --atom </td> </tr> <tr> <td class="h" > <a name="3060">3060</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/contributor/name </td> </tr> <tr> <td class="h" > <a name="3061">3061</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/contributor/uri </td> </tr> <tr> <td class="h" > <a name="3062">3062</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/contributor/url --atom-typo-maybe </td> </tr> <tr> <td class="h" > <a name="3063">3063</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/contributor/email </td> </tr> <tr> <td class="h" > <a name="3064">3064</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3065">3065</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/activity:actor </td> </tr> <tr> <td class="h" > <a name="3066">3066</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/activity:verb --usually-post-or-something </td> </tr> <tr> <td class="h" > <a name="3067">3067</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/activity:object-type --is-this-anything </td> </tr> <tr> <td class="h" > <a name="3068">3068</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> )} = (); </td> </tr> <tr> <td class="h" > <a name="3069">3069</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3070">3070</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3071">3071</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $elt is an XML::Twig::Elt </td> </tr> <tr> <td class="h" > <a name="3072">3072</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Return an email address, either just the text part of $elt or Atom </td> </tr> <tr> <td class="h" > <a name="3073">3073</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # sub-elements <name> and <email>. </td> </tr> <tr> <td class="h" > <a name="3074">3074</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # If $elt is empty then return an empty list. </td> </tr> <tr> <td class="h" > <a name="3075">3075</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3076">3076</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub elt_to_email { </td> </tr> <tr> <td class="h" > <a name="3077">3077</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3077-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3077-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $elt) = @_; </td> </tr> <tr> <td class="h" > <a name="3078">3078</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3078-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return unless defined $elt; </td> </tr> <tr> <td class="h" > <a name="3079">3079</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3080">3080</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <email> - under Atom </td> </tr> <tr> <td class="h" > <a name="3081">3081</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <itunes:email> - under <itunes:owner> </td> </tr> <tr> <td class="h" > <a name="3082">3082</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $email = elt_to_rendered_line ($elt->first_child(qr/^(itunes:)?email$/)); </td> </tr> <tr> <td class="h" > <a name="3083">3083</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3084">3084</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <name> - under Atom </td> </tr> <tr> <td class="h" > <a name="3085">3085</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <itunes:name> - under <itunes:owner> </td> </tr> <tr> <td class="h" > <a name="3086">3086</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3086-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $display = elt_to_rendered_line ($elt->first_child(qr/^(itunes:)?name$/)) </td> </tr> <tr> <td class="h" > <a name="3087">3087</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // ''; </td> </tr> <tr> <td class="h" > <a name="3088">3088</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3089">3089</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $maybe = join </td> </tr> <tr> <td class="h" > <a name="3090">3090</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (' ', </td> </tr> <tr> <td class="h" > <a name="3091">3091</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> non_empty ($elt->text_only), </td> </tr> <tr> <td class="h" > <a name="3092">3092</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> non_empty (do { </td> </tr> <tr> <td class="h" > <a name="3093">3093</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <rdf:Description><rdf:value>...</></> under dc authors etc </td> </tr> <tr> <td class="h" > <a name="3094">3094</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3094-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $rdfdesc; ($rdfdesc = $elt->first_child('rdf:Description')) </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3095">3095</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> && $rdfdesc->first_child_text('rdf:value') </td> </tr> <tr> <td class="h" > <a name="3096">3096</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> })); </td> </tr> <tr> <td class="h" > <a name="3097">3097</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3098">3098</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $self->email_format_maybe ($maybe, $display, $email); </td> </tr> <tr> <td class="h" > <a name="3099">3099</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3100">3100</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3101">3101</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $mailbox_re is a mailbox with domain, like "foo@example.com" </td> </tr> <tr> <td class="h" > <a name="3102">3102</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Allows no dots like "foo@localhost". </td> </tr> <tr> <td class="h" > <a name="3103">3103</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Allows dashes like "www-something@example.com". </td> </tr> <tr> <td class="h" > <a name="3104">3104</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3105">3105</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $mailbox_with_comment_re allows an optional paren comment part like </td> </tr> <tr> <td class="h" > <a name="3106">3106</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # "foo@example.com (Foo)" </td> </tr> <tr> <td class="h" > <a name="3107">3107</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3108">3108</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # cf Email::Address $addr_spec, but its version 1.890 loosened to allow a </td> </tr> <tr> <td class="h" > <a name="3109">3109</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # domain-less bare "foo", which is no good </td> </tr> <tr> <td class="h" > <a name="3110">3110</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3111">3111</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $words_with_dots_re = qr/[[:word:]-]+(\.[[:word:]-]+)*/; </td> </tr> <tr> <td class="h" > <a name="3112">3112</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $mailbox_re = qr/$words_with_dots_re\@$words_with_dots_re/o; </td> </tr> <tr> <td class="h" > <a name="3113">3113</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $mailbox_with_comment_re = qr/$mailbox_re(\s*\([^\)]*\))?/os; </td> </tr> <tr> <td class="h" > <a name="3114">3114</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3115">3115</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $maybe is some free-form author part possibly including a foo@example.com </td> </tr> <tr> <td class="h" > <a name="3116">3116</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $display is a display part for the email like "Foo", possibly empty "" </td> </tr> <tr> <td class="h" > <a name="3117">3117</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $email is a mailbox "foo@example.com", or undef </td> </tr> <tr> <td class="h" > <a name="3118">3118</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return an rfc822 "Foo <foo@example.com>" </td> </tr> <tr> <td class="h" > <a name="3119">3119</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3120">3120</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub email_format_maybe { </td> </tr> <tr> <td class="h" > <a name="3121">3121</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3121-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3121-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $maybe, $display, $email) = @_; </td> </tr> <tr> <td class="h" > <a name="3122">3122</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### email_format_maybe() start </td> </tr> <tr> <td class="h" > <a name="3123">3123</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### $maybe </td> </tr> <tr> <td class="h" > <a name="3124">3124</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### $display </td> </tr> <tr> <td class="h" > <a name="3125">3125</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### $email </td> </tr> <tr> <td class="h" > <a name="3126">3126</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3127">3127</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # look also at $display the same in case Atom no <email> but a <name> </td> </tr> <tr> <td class="h" > <a name="3128">3128</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # which is a mailbox and can be corrected, </td> </tr> <tr> <td class="h" > <a name="3129">3129</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # eg. http://www.weather.gov/alerts-beta/hi.php?x=0 </td> </tr> <tr> <td class="h" > <a name="3130">3130</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3131">3131</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Or $maybe full email like </td> </tr> <tr> <td class="h" > <a name="3132">3132</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3132-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (is_empty($email)) { </td> </tr> <tr> <td class="h" > <a name="3133">3133</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach ($maybe, $display) { </td> </tr> <tr> <td class="h" > <a name="3134">3134</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3135">3135</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3135-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3135-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (/^\s*(mailto:)?($mailbox_with_comment_re)\s*$/o) { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3136">3136</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### maybe or display is a mailbox </td> </tr> <tr> <td class="h" > <a name="3137">3137</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # "foo@example.com" </td> </tr> <tr> <td class="h" > <a name="3138">3138</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # "mailto:foo@example.com" </td> </tr> <tr> <td class="h" > <a name="3139">3139</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # "foo@example.com (Foo)" </td> </tr> <tr> <td class="h" > <a name="3140">3140</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $email = $2; </td> </tr> <tr> <td class="h" > <a name="3141">3141</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> undef $_; </td> </tr> <tr> <td class="h" > <a name="3142">3142</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> last; </td> </tr> <tr> <td class="h" > <a name="3143">3143</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3144">3144</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif (/(.*)\((mailto:)?($mailbox_re)\)\s*$/o </td> </tr> <tr> <td class="h" > <a name="3145">3145</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || /(.*)<(mailto:)?($mailbox_re)>\s*$/o) { </td> </tr> <tr> <td class="h" > <a name="3146">3146</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### maybe or display part is display plus mailbox </td> </tr> <tr> <td class="h" > <a name="3147">3147</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # "Foo (mailto:foo@example.com)" </td> </tr> <tr> <td class="h" > <a name="3148">3148</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # "Foo (foo@example.com)" </td> </tr> <tr> <td class="h" > <a name="3149">3149</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # "Foo <foo@example.com>" </td> </tr> <tr> <td class="h" > <a name="3150">3150</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3151">3151</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $_ = $1; </td> </tr> <tr> <td class="h" > <a name="3152">3152</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $email = $3; </td> </tr> <tr> <td class="h" > <a name="3153">3153</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> last; </td> </tr> <tr> <td class="h" > <a name="3154">3154</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3155">3155</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3156">3156</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3157">3157</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3158">3158</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3158-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $display .= ' '.($maybe//''); </td> </tr> <tr> <td class="h" > <a name="3159">3159</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $ret; </td> </tr> <tr> <td class="h" > <a name="3160">3160</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3160-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3160-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (is_empty($email) && $display =~ /^$mailbox_re$/o) { </td> </tr> <tr> <td class="h" > <a name="3161">3161</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # display or maybe is a "foo@example.com" or "foo@example.com (Foo)", </td> </tr> <tr> <td class="h" > <a name="3162">3162</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return it as-is, in particular leave it in "(Foo)" style comment </td> </tr> <tr> <td class="h" > <a name="3163">3163</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $ret = $display; </td> </tr> <tr> <td class="h" > <a name="3164">3164</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="3165">3165</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $ret = $self->email_format ($display, $email); </td> </tr> <tr> <td class="h" > <a name="3166">3166</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3167">3167</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3168">3168</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Collapse whitespace against possible tabs and newlines in an <author> as </td> </tr> <tr> <td class="h" > <a name="3169">3169</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # from googlegroups for instance. MIME::Entity seems to collapse </td> </tr> <tr> <td class="h" > <a name="3170">3170</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # newlines, but not tabs. </td> </tr> <tr> <td class="h" > <a name="3171">3171</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return non_empty (collapse_whitespace ($ret)); </td> </tr> <tr> <td class="h" > <a name="3172">3172</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3173">3173</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3174">3174</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $display is a display part for the email "Foo", possibly empty "" </td> </tr> <tr> <td class="h" > <a name="3175">3175</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $email is a mailbox "foo@example.com", or undef or empty "" </td> </tr> <tr> <td class="h" > <a name="3176">3176</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return an rfc822 "Foo <foo@example.com>" </td> </tr> <tr> <td class="h" > <a name="3177">3177</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3178">3178</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub email_format { </td> </tr> <tr> <td class="h" > <a name="3179">3179</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3179-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3179-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $display, $email) = @_; </td> </tr> <tr> <td class="h" > <a name="3180">3180</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### $display </td> </tr> <tr> <td class="h" > <a name="3181">3181</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $display = Text::Trim::trim($display); </td> </tr> <tr> <td class="h" > <a name="3182">3182</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $email = Text::Trim::trim($email); </td> </tr> <tr> <td class="h" > <a name="3183">3183</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3183-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (is_empty($display)) { </td> </tr> <tr> <td class="h" > <a name="3184">3184</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3184-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (is_empty($email)) { </td> </tr> <tr> <td class="h" > <a name="3185">3185</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return; </td> </tr> <tr> <td class="h" > <a name="3186">3186</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="3187">3187</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $email; </td> </tr> <tr> <td class="h" > <a name="3188">3188</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3189">3189</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3190">3190</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3190-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (is_empty($email)) { </td> </tr> <tr> <td class="h" > <a name="3191">3191</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # think can't have empty <> or omitted, otherwise the quoted part is </td> </tr> <tr> <td class="h" > <a name="3192">3192</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # still parsed as an address, certainly it's not rfc822 compliant to </td> </tr> <tr> <td class="h" > <a name="3193">3193</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # omit </td> </tr> <tr> <td class="h" > <a name="3194">3194</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $email = 'nobody@'.$self->uri_to_host; </td> </tr> <tr> <td class="h" > <a name="3195">3195</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="3196">3196</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $email = $email; </td> </tr> <tr> <td class="h" > <a name="3197">3197</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3198">3198</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return email_phrase_quote_maybe($display) . " <$email>"; </td> </tr> <tr> <td class="h" > <a name="3199">3199</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3200">3200</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3201">3201</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return $str with quotes like "Foo Bar" if it needs them to go in an email </td> </tr> <tr> <td class="h" > <a name="3202">3202</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # display part </td> </tr> <tr> <td class="h" > <a name="3203">3203</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub email_phrase_quote_maybe { </td> </tr> <tr> <td class="h" > <a name="3204">3204</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3204-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3204-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($str) = @_; </td> </tr> <tr> <td class="h" > <a name="3205">3205</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3205-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return if ! defined $str; </td> </tr> <tr> <td class="h" > <a name="3206">3206</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3207">3207</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # RFC2822 "atext" characters, with "-" last </td> </tr> <tr> <td class="h" > <a name="3208">3208</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3208-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($str =~ m<[^[:alnum:][:space:]!#\$%&'*+/=?^_`{|}~-]>) { </td> </tr> <tr> <td class="h" > <a name="3209">3209</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # strange chars, need to quote </td> </tr> <tr> <td class="h" > <a name="3210">3210</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return email_phrase_quote($str); </td> </tr> <tr> <td class="h" > <a name="3211">3211</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="3212">3212</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # alphanumeric and whitespace, no quotes </td> </tr> <tr> <td class="h" > <a name="3213">3213</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $str; </td> </tr> <tr> <td class="h" > <a name="3214">3214</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3215">3215</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3216">3216</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub email_phrase_quote { </td> </tr> <tr> <td class="h" > <a name="3217">3217</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3217-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3217-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($str) = @_; </td> </tr> <tr> <td class="h" > <a name="3218">3218</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3218-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return if ! defined $str; </td> </tr> <tr> <td class="h" > <a name="3219">3219</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $str =~ s/^"(.*)"$/$1/; # strip existing quotes </td> </tr> <tr> <td class="h" > <a name="3220">3220</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $str =~ s/(["\\])/\\$1/g; # escape internal quotes and backslashes </td> </tr> <tr> <td class="h" > <a name="3221">3221</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return "\"$str\""; </td> </tr> <tr> <td class="h" > <a name="3222">3222</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3223">3223</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3224">3224</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3225">3225</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> #------------------------------------------------------------------------------ </td> </tr> <tr> <td class="h" > <a name="3226">3226</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # rss_newest_only </td> </tr> <tr> <td class="h" > <a name="3227">3227</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3228">3228</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="3229">3229</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my %multiplier = (minute => 60, </td> </tr> <tr> <td class="h" > <a name="3230">3230</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> hour => 3600, </td> </tr> <tr> <td class="h" > <a name="3231">3231</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> day => 86400, </td> </tr> <tr> <td class="h" > <a name="3232">3232</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> week => 86400 * 7, </td> </tr> <tr> <td class="h" > <a name="3233">3233</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> month => 365.25 * 86400 / 12, </td> </tr> <tr> <td class="h" > <a name="3234">3234</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> year => 365.25 * 86400, </td> </tr> <tr> <td class="h" > <a name="3235">3235</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ); </td> </tr> <tr> <td class="h" > <a name="3236">3236</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return a target time_t, or undef </td> </tr> <tr> <td class="h" > <a name="3237">3237</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub rss_newest_only_timet { </td> </tr> <tr> <td class="h" > <a name="3238">3238</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3238-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3238-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self) = @_; </td> </tr> <tr> <td class="h" > <a name="3239">3239</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="3240">3240</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3240-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined (my $str = $self->{'rss_newest_only'})) { </td> </tr> <tr> <td class="h" > <a name="3241">3241</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3241-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($str =~ /^\s*(\d+)\s*(minute|hour|day|week|month|year)s?\s*$/) { </td> </tr> <tr> <td class="h" > <a name="3242">3242</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return time() - $1*$multiplier{$2}; </td> </tr> <tr> <td class="h" > <a name="3243">3243</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3244">3244</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3245">3245</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return undef; </td> </tr> <tr> <td class="h" > <a name="3246">3246</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3247">3247</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3248">3248</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3249">3249</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return a number, or undef </td> </tr> <tr> <td class="h" > <a name="3250">3250</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub rss_newest_only_count { </td> </tr> <tr> <td class="h" > <a name="3251">3251</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3251-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3251-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self) = @_; </td> </tr> <tr> <td class="h" > <a name="3252">3252</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3252-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined (my $str = $self->{'rss_newest_only'})) { </td> </tr> <tr> <td class="h" > <a name="3253">3253</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3253-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (Scalar::Util::looks_like_number($str)) { </td> </tr> <tr> <td class="h" > <a name="3254">3254</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### rss_newest_only number: $str </td> </tr> <tr> <td class="h" > <a name="3255">3255</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $str; </td> </tr> <tr> <td class="h" > <a name="3256">3256</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3257">3257</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3258">3258</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return undef; </td> </tr> <tr> <td class="h" > <a name="3259">3259</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3260">3260</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3261">3261</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return @items restricted or filtered by rss_newest_only </td> </tr> <tr> <td class="h" > <a name="3262">3262</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub rss_newest_only_items { </td> </tr> <tr> <td class="h" > <a name="3263">3263</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3263-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3263-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, @items) = @_; </td> </tr> <tr> <td class="h" > <a name="3264">3264</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3265">3265</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3265-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined (my $count = $self->rss_newest_only_count)) { </td> </tr> <tr> <td class="h" > <a name="3266">3266</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3266-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($count == 0) { </td> </tr> <tr> <td class="h" > <a name="3267">3267</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # rss_newest_only=>0 means don't apply a newest </td> </tr> <tr> <td class="h" > <a name="3268">3268</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return @items; </td> </tr> <tr> <td class="h" > <a name="3269">3269</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3270">3270</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $before = scalar(@items); </td> </tr> <tr> <td class="h" > <a name="3271">3271</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require Sort::Key::Top; </td> </tr> <tr> <td class="h" > <a name="3272">3272</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3272-1"> 0 </a> </td> <td >   </td> <td >   </td> <td class="s"> @items = Sort::Key::Top::rnkeytop (sub { $self->item_to_timet($_) }, </td> </tr> <tr> <td class="h" > <a name="3273">3273</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $count, @items); </td> </tr> <tr> <td class="h" > <a name="3274">3274</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3275">3275</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $after = scalar(@items); </td> </tr> <tr> <td class="h" > <a name="3276">3276</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3276-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($before != $after) { </td> </tr> <tr> <td class="h" > <a name="3277">3277</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (1, " rss_newest_only reduce by count from $before items to $after items"); </td> </tr> <tr> <td class="h" > <a name="3278">3278</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3279">3279</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return @items; </td> </tr> <tr> <td class="h" > <a name="3280">3280</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3281">3281</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3282">3282</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3282-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined (my $target_timet = $self->rss_newest_only_timet)) { </td> </tr> <tr> <td class="h" > <a name="3283">3283</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $before = scalar(@items); </td> </tr> <tr> <td class="h" > <a name="3284">3284</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @items = grep { my $got_timet = $self->item_to_timet($_); </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3285">3285</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3285-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ! defined $got_timet || $got_timet >= $target_timet } </td> </tr> <tr> <td class="h" > <a name="3286">3286</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @items; </td> </tr> <tr> <td class="h" > <a name="3287">3287</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $after = scalar(@items); </td> </tr> <tr> <td class="h" > <a name="3288">3288</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3288-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($before != $after) { </td> </tr> <tr> <td class="h" > <a name="3289">3289</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (1, " rss_newest_only reduce by age from $before to $after items"); </td> </tr> <tr> <td class="h" > <a name="3290">3290</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3291">3291</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return @items; </td> </tr> <tr> <td class="h" > <a name="3292">3292</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3293">3293</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3294">3294</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3294-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined (my $str = $self->{'rss_newest_only'})) { </td> </tr> <tr> <td class="h" > <a name="3295">3295</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> die "rss2leafnode: unrecognised rss_newest_only: ",$str; </td> </tr> <tr> <td class="h" > <a name="3296">3296</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3297">3297</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return @items; </td> </tr> <tr> <td class="h" > <a name="3298">3298</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3299">3299</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3300">3300</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3301">3301</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> #------------------------------------------------------------------------------ </td> </tr> <tr> <td class="h" > <a name="3302">3302</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # fetch RSS </td> </tr> <tr> <td class="h" > <a name="3303">3303</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3304">3304</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $map_xmlns </td> </tr> <tr> <td class="h" > <a name="3305">3305</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> = { </td> </tr> <tr> <td class="h" > <a name="3306">3306</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://purl.org/rss/1.0/' => 'rss', </td> </tr> <tr> <td class="h" > <a name="3307">3307</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://www.w3.org/2005/Atom' => 'atom', </td> </tr> <tr> <td class="h" > <a name="3308">3308</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' => 'rdf', </td> </tr> <tr> <td class="h" > <a name="3309">3309</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://purl.org/rss/1.0/modules/content/' => 'content', </td> </tr> <tr> <td class="h" > <a name="3310">3310</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://purl.org/rss/1.0/modules/slash/' => 'slash', </td> </tr> <tr> <td class="h" > <a name="3311">3311</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://purl.org/rss/1.0/modules/syndication/' => 'syn', </td> </tr> <tr> <td class="h" > <a name="3312">3312</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://purl.org/syndication/thread/1.0' => 'thr', </td> </tr> <tr> <td class="h" > <a name="3313">3313</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://wellformedweb.org/CommentAPI/' => 'wfw', </td> </tr> <tr> <td class="h" > <a name="3314">3314</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://www.w3.org/1999/xhtml' => 'xhtml', </td> </tr> <tr> <td class="h" > <a name="3315">3315</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://www.itunes.com/dtds/podcast-1.0.dtd' => 'itunes', </td> </tr> <tr> <td class="h" > <a name="3316">3316</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://rssnamespace.org/feedburner/ext/1.0' => 'feedburner', </td> </tr> <tr> <td class="h" > <a name="3317">3317</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3318">3318</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # http://www.rssboard.org/media-rss </td> </tr> <tr> <td class="h" > <a name="3319">3319</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://search.yahoo.com/mrss' => 'media', </td> </tr> <tr> <td class="h" > <a name="3320">3320</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3321">3321</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://www.w3.org/2003/01/geo/wgs84_pos#' => 'geo', </td> </tr> <tr> <td class="h" > <a name="3322">3322</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://www.georss.org/georss' => 'georss', </td> </tr> <tr> <td class="h" > <a name="3323">3323</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://www.pheedo.com/namespace/pheedo' => 'pheedo', </td> </tr> <tr> <td class="h" > <a name="3324">3324</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://api.twitter.com' => 'twitter', </td> </tr> <tr> <td class="h" > <a name="3325">3325</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://xmlns.com/foaf/0.1/' => 'foaf', </td> </tr> <tr> <td class="h" > <a name="3326">3326</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://status.net/ont/' => 'statusnet', </td> </tr> <tr> <td class="h" > <a name="3327">3327</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://rdfs.org/sioc/ns#' => 'sioc', </td> </tr> <tr> <td class="h" > <a name="3328">3328</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://www.slate.com' => 'slate', </td> </tr> <tr> <td class="h" > <a name="3329">3329</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://activitystrea.ms/spec/1.0/' => 'activity', </td> </tr> <tr> <td class="h" > <a name="3330">3330</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://ostatus.org/schema/1.0' => 'ostatus', </td> </tr> <tr> <td class="h" > <a name="3331">3331</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3332">3332</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # http://tools.ietf.org/html/draft-snell-atompub-feed-index-10 </td> </tr> <tr> <td class="h" > <a name="3333">3333</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://purl.org/atompub/rank/1.0' => 're', </td> </tr> <tr> <td class="h" > <a name="3334">3334</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3335">3335</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # per http://docs.jivesoftware.com/latest/documentation/rss.html#output </td> </tr> <tr> <td class="h" > <a name="3336">3336</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://www.jivesoftware.com/xmlns/jiveforums/rss' => 'jf', </td> </tr> <tr> <td class="h" > <a name="3337">3337</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3338">3338</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # these two are different, but treat the same for now </td> </tr> <tr> <td class="h" > <a name="3339">3339</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://backend.userland.com/creativeCommonsRssModule'=>'creativeCommons', </td> </tr> <tr> <td class="h" > <a name="3340">3340</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://creativecommons.org/ns#' =>'creativeCommons', </td> </tr> <tr> <td class="h" > <a name="3341">3341</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3342">3342</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Common Alerts Protocol </td> </tr> <tr> <td class="h" > <a name="3343">3343</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'urn:oasis:names:tc:emergency:cap:1.1' => 'cap', </td> </tr> <tr> <td class="h" > <a name="3344">3344</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3345">3345</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # central bank exchange rates format, </td> </tr> <tr> <td class="h" > <a name="3346">3346</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # spec http://www.cbwiki.net/wiki/index.php/RSS-CBMain </td> </tr> <tr> <td class="h" > <a name="3347">3347</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # eg. RBA http://www.rba.gov.au/rss/rss-cb-exchange-rates.xml </td> </tr> <tr> <td class="h" > <a name="3348">3348</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://www.cbwiki.net/wiki/index.php/Specification_1.1' => 'cb', </td> </tr> <tr> <td class="h" > <a name="3349">3349</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3350">3350</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # earthquakes </td> </tr> <tr> <td class="h" > <a name="3351">3351</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # eg. http://earthquake.usgs.gov/earthquakes/shakemap/rss.xml </td> </tr> <tr> <td class="h" > <a name="3352">3352</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://earthquake.usgs.gov/rss/1.0/' => 'eq', </td> </tr> <tr> <td class="h" > <a name="3353">3353</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3354">3354</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://purl.org/dc/elements/1.1/' => 'dc', </td> </tr> <tr> <td class="h" > <a name="3355">3355</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://purl.org/dc/terms/' => 'dcterms', </td> </tr> <tr> <td class="h" > <a name="3356">3356</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3357">3357</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # purl.org might be supposed to be the home for wiki:, but it's a 404 </td> </tr> <tr> <td class="h" > <a name="3358">3358</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # and usemod.com suggests its page instead </td> </tr> <tr> <td class="h" > <a name="3359">3359</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Spec at http://www.meatballwiki.org/wiki/ModWiki </td> </tr> <tr> <td class="h" > <a name="3360">3360</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://purl.org/rss/1.0/modules/wiki/' => 'wiki', </td> </tr> <tr> <td class="h" > <a name="3361">3361</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://www.usemod.com/cgi-bin/mb.pl?ModWiki' => 'wiki', </td> </tr> <tr> <td class="h" > <a name="3362">3362</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3363">3363</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # not sure if this is supposed to be necessary, but without it </td> </tr> <tr> <td class="h" > <a name="3364">3364</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # "xml:lang" attributes are turned into "lang" </td> </tr> <tr> <td class="h" > <a name="3365">3365</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'http://www.w3.org/XML/1998/namespace' => 'xml', </td> </tr> <tr> <td class="h" > <a name="3366">3366</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> }; </td> </tr> <tr> <td class="h" > <a name="3367">3367</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3368">3368</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub twig_parse { </td> </tr> <tr> <td class="h" > <a name="3369">3369</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3369-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3369-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $xml) = @_; </td> </tr> <tr> <td class="h" > <a name="3370">3370</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### twig_parse() ... </td> </tr> <tr> <td class="h" > <a name="3371">3371</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3372">3372</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # default "discard_spaces" chucks leading and trailing space on content, </td> </tr> <tr> <td class="h" > <a name="3373">3373</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # which is usually a good thing </td> </tr> <tr> <td class="h" > <a name="3374">3374</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3375">3375</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require XML::Twig; </td> </tr> <tr> <td class="h" > <a name="3376">3376</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> XML::Twig->VERSION('3.34'); # for att_exists() </td> </tr> <tr> <td class="h" > <a name="3377">3377</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $twig = XML::Twig->new (map_xmlns => $map_xmlns, </td> </tr> <tr> <td class="h" > <a name="3378">3378</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> pretty_print => 'wrapped'); </td> </tr> <tr> <td class="h" > <a name="3379">3379</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $twig->safe_parse ($xml); </td> </tr> <tr> <td class="h" > <a name="3380">3380</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $err = $@; </td> </tr> <tr> <td class="h" > <a name="3381">3381</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### $err </td> </tr> <tr> <td class="h" > <a name="3382">3382</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3383">3383</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Try to fix bad non-ascii chars by putting it through Encode::from_to(). </td> </tr> <tr> <td class="h" > <a name="3384">3384</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Encode::FB_DEFAULT substitutes U+FFFD when going to unicode, or question </td> </tr> <tr> <td class="h" > <a name="3385">3385</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # mark "?" going to non-unicode. Mozilla does some sort of similar </td> </tr> <tr> <td class="h" > <a name="3386">3386</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # liberal byte interpretation so as to at least display something from a </td> </tr> <tr> <td class="h" > <a name="3387">3387</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # dodgy feed. </td> </tr> <tr> <td class="h" > <a name="3388">3388</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3389">3389</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3389-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3389-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($err && $err =~ /not well-formed \(invalid token\) at (line \d+, column \d+, byte (\d+))/) { </td> </tr> <tr> <td class="h" > <a name="3390">3390</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $where = $1; </td> </tr> <tr> <td class="h" > <a name="3391">3391</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $byte = ord(substr($xml,$2,1)); </td> </tr> <tr> <td class="h" > <a name="3392">3392</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3392-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($byte >= 128) { </td> </tr> <tr> <td class="h" > <a name="3393">3393</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3393-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $charset = $twig->encoding // 'utf-8'; </td> </tr> <tr> <td class="h" > <a name="3394">3394</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (1, sprintf ("parse error, attempt re-code $charset for byte 0x%02X\n", $byte)); </td> </tr> <tr> <td class="h" > <a name="3395">3395</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require Encode; </td> </tr> <tr> <td class="h" > <a name="3396">3396</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $recoded_xml = $xml; </td> </tr> <tr> <td class="h" > <a name="3397">3397</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Encode::from_to($recoded_xml, $charset, $charset, Encode::FB_DEFAULT()); </td> </tr> <tr> <td class="h" > <a name="3398">3398</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3399">3399</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $twig = XML::Twig->new (map_xmlns => $map_xmlns); </td> </tr> <tr> <td class="h" > <a name="3400">3400</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3400-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($twig->safe_parse ($recoded_xml)) { </td> </tr> <tr> <td class="h" > <a name="3401">3401</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $twig->root->set_att('rss2leafnode:fixup', </td> </tr> <tr> <td class="h" > <a name="3402">3402</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> "Recoded bad bytes to charset $charset"); </td> </tr> <tr> <td class="h" > <a name="3403">3403</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> print __x("Feed {url}\n recoded {charset} to parse, expect substitutions for bad non-ascii\n ({where})\n", </td> </tr> <tr> <td class="h" > <a name="3404">3404</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> url => $self->{'uri'}, </td> </tr> <tr> <td class="h" > <a name="3405">3405</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> charset => $charset, </td> </tr> <tr> <td class="h" > <a name="3406">3406</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> where => $where); </td> </tr> <tr> <td class="h" > <a name="3407">3407</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> undef $err; </td> </tr> <tr> <td class="h" > <a name="3408">3408</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3409">3409</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3410">3410</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3411">3411</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3412">3412</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Or attempt to put it through XML::Liberal, if available. </td> </tr> <tr> <td class="h" > <a name="3413">3413</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3414">3414</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3414-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($err) { </td> </tr> <tr> <td class="h" > <a name="3415">3415</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $liberal_xml = $self->xml_liberal_correction($xml); </td> </tr> <tr> <td class="h" > <a name="3416">3416</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3416-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined $liberal_xml) { </td> </tr> <tr> <td class="h" > <a name="3417">3417</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### reparse xml liberal fixup with twig ... </td> </tr> <tr> <td class="h" > <a name="3418">3418</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $twig = XML::Twig->new (map_xmlns => $map_xmlns); </td> </tr> <tr> <td class="h" > <a name="3419">3419</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3419-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($twig->safe_parse ($liberal_xml)) { </td> </tr> <tr> <td class="h" > <a name="3420">3420</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### now ok ... </td> </tr> <tr> <td class="h" > <a name="3421">3421</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $err = Text::Trim::trim($err); </td> </tr> <tr> <td class="h" > <a name="3422">3422</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $twig->root->set_att('rss2leafnode:fixup', </td> </tr> <tr> <td class="h" > <a name="3423">3423</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> "XML::Liberal fixed: {error}", </td> </tr> <tr> <td class="h" > <a name="3424">3424</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> error => $err); </td> </tr> <tr> <td class="h" > <a name="3425">3425</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> print __x("Feed {url}\n parse error: {error}\n continuing with repairs by XML::Liberal\n", </td> </tr> <tr> <td class="h" > <a name="3426">3426</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> url => $self->{'uri'}, </td> </tr> <tr> <td class="h" > <a name="3427">3427</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> error => $err); </td> </tr> <tr> <td class="h" > <a name="3428">3428</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> undef $err; </td> </tr> <tr> <td class="h" > <a name="3429">3429</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3430">3430</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3431">3431</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### now err: $err </td> </tr> <tr> <td class="h" > <a name="3432">3432</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3433">3433</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3434">3434</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3434-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($err) { </td> </tr> <tr> <td class="h" > <a name="3435">3435</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # XML::Parser seems to stick some spurious leading whitespace on the error </td> </tr> <tr> <td class="h" > <a name="3436">3436</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $err = Text::Trim::trim($err); </td> </tr> <tr> <td class="h" > <a name="3437">3437</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3438">3438</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (1, __x("Parse error on URL {url}\n{error}", </td> </tr> <tr> <td class="h" > <a name="3439">3439</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> url => $self->{'uri'}, </td> </tr> <tr> <td class="h" > <a name="3440">3440</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> error => $err)); </td> </tr> <tr> <td class="h" > <a name="3441">3441</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return (undef, $err); </td> </tr> <tr> <td class="h" > <a name="3442">3442</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3443">3443</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3444">3444</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Strip any explicit "rss:" or "atom:" namespace down to bare part. </td> </tr> <tr> <td class="h" > <a name="3445">3445</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Should be unambiguous and is easier than giving tag names both with and </td> </tr> <tr> <td class="h" > <a name="3446">3446</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # without the namespace. Undocumented set_ns_as_default() might do this </td> </tr> <tr> <td class="h" > <a name="3447">3447</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # ... or might not. </td> </tr> <tr> <td class="h" > <a name="3448">3448</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3449">3449</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $root = $twig->root; </td> </tr> <tr> <td class="h" > <a name="3450">3450</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> App::RSS2Leafnode::XML::Twig::Other::elt_tree_strip_prefix ($root, 'atom'); </td> </tr> <tr> <td class="h" > <a name="3451">3451</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> App::RSS2Leafnode::XML::Twig::Other::elt_tree_strip_prefix ($root, 'rss'); </td> </tr> <tr> <td class="h" > <a name="3452">3452</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3453">3453</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # somehow map_xmlns mangles default attributes like "decimals=...", prefer </td> </tr> <tr> <td class="h" > <a name="3454">3454</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # to see them without rss: or atom: -- maybe </td> </tr> <tr> <td class="h" > <a name="3455">3455</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # foreach my $child ($root->descendants_or_self) { </td> </tr> <tr> <td class="h" > <a name="3456">3456</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # foreach my $attname ($child->att_names) { </td> </tr> <tr> <td class="h" > <a name="3457">3457</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # if ($attname =~ /^(atom|rss):(.*)/) { </td> </tr> <tr> <td class="h" > <a name="3458">3458</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $child->change_att_name($attname, $2); </td> </tr> <tr> <td class="h" > <a name="3459">3459</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # } </td> </tr> <tr> <td class="h" > <a name="3460">3460</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # } </td> </tr> <tr> <td class="h" > <a name="3461">3461</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # } </td> </tr> <tr> <td class="h" > <a name="3462">3462</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3463">3463</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### add xml base </td> </tr> <tr> <td class="h" > <a name="3464">3464</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3464-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3464-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined $self->{'uri'} && ! $root->att_exists('xml:base')) { </td> </tr> <tr> <td class="h" > <a name="3465">3465</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $root->set_att ('xml:base', $self->{'uri'}); </td> </tr> <tr> <td class="h" > <a name="3466">3466</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3467">3467</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3468">3468</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### success </td> </tr> <tr> <td class="h" > <a name="3469">3469</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return ($twig, undef); </td> </tr> <tr> <td class="h" > <a name="3470">3470</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3471">3471</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3472">3472</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub item_to_channel { </td> </tr> <tr> <td class="h" > <a name="3473">3473</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3473-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3473-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($item) = @_; </td> </tr> <tr> <td class="h" > <a name="3474">3474</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # parent for RSS or Atom, but sibling "channel" for RDF </td> </tr> <tr> <td class="h" > <a name="3475">3475</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $channel = $item->parent; </td> </tr> <tr> <td class="h" > <a name="3476">3476</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3476-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return ($channel->first_child('channel') </td> </tr> <tr> <td class="h" > <a name="3477">3477</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // $channel); </td> </tr> <tr> <td class="h" > <a name="3478">3478</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3479">3479</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3480">3480</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return a Message-ID string for this $item coming from $self->{'uri'} </td> </tr> <tr> <td class="h" > <a name="3481">3481</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3482">3482</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub item_to_msgid { </td> </tr> <tr> <td class="h" > <a name="3483">3483</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3483-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3483-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $item) = @_; </td> </tr> <tr> <td class="h" > <a name="3484">3484</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3485">3485</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3485-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (is_non_empty (my $id = $item->first_child_text('id'))) { </td> </tr> <tr> <td class="h" > <a name="3486">3486</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Atom <id> is supposed to be a url </td> </tr> <tr> <td class="h" > <a name="3487">3487</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $self->url_to_msgid ($id, $item->first_child_text('updated')); </td> </tr> <tr> <td class="h" > <a name="3488">3488</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3489">3489</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3490">3490</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $guid; </td> </tr> <tr> <td class="h" > <a name="3491">3491</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $isPermaLink = 0; </td> </tr> <tr> <td class="h" > <a name="3492">3492</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3492-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (my $elt = $item->first_child('guid')) { </td> </tr> <tr> <td class="h" > <a name="3493">3493</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # ignore empty <guid isPermaLink="false"/> seen once from </td> </tr> <tr> <td class="h" > <a name="3494">3494</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # http://abc.net.au/rn/podcast/feeds/sci.xml </td> </tr> <tr> <td class="h" > <a name="3495">3495</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3495-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (is_non_empty (my $str = collapse_whitespace ($elt->text))) { </td> </tr> <tr> <td class="h" > <a name="3496">3496</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $guid = $str; </td> </tr> <tr> <td class="h" > <a name="3497">3497</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3497-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $isPermaLink = (lc($elt->att('isPermaLink') // 'true') eq 'true'); </td> </tr> <tr> <td class="h" > <a name="3498">3498</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3499">3499</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3500">3500</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3501">3501</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3501-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($isPermaLink) { # <guid isPermaLink="true"> </td> </tr> <tr> <td class="h" > <a name="3502">3502</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $self->url_to_msgid ($guid); </td> </tr> <tr> <td class="h" > <a name="3503">3503</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3504">3504</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3504-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (my $link = item_yahoo_permalink ($item)) { </td> </tr> <tr> <td class="h" > <a name="3505">3505</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $self->url_to_msgid ($link); </td> </tr> <tr> <td class="h" > <a name="3506">3506</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3507">3507</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3507-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined $guid) { # <guid isPermaLink="false"> </td> </tr> <tr> <td class="h" > <a name="3508">3508</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $self->url_to_msgid ($self->{'uri'}, $guid); </td> </tr> <tr> <td class="h" > <a name="3509">3509</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3510">3510</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3511">3511</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # nothing in the item, use the feed url and MD5 of some fields which </td> </tr> <tr> <td class="h" > <a name="3512">3512</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # will hopefully distinguish it from other items at this url </td> </tr> <tr> <td class="h" > <a name="3513">3513</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, ' msgid from MD5'); </td> </tr> <tr> <td class="h" > <a name="3514">3514</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $self->url_to_msgid </td> </tr> <tr> <td class="h" > <a name="3515">3515</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ($self->{'uri'}, </td> </tr> <tr> <td class="h" > <a name="3516">3516</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> md5_of_utf8 (join_non_empty ('', </td> </tr> <tr> <td class="h" > <a name="3517">3517</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> map {$item->first_child_text($_)} </td> </tr> <tr> <td class="h" > <a name="3518">3518</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> qw(title </td> </tr> <tr> <td class="h" > <a name="3519">3519</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> author </td> </tr> <tr> <td class="h" > <a name="3520">3520</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> dc:creator </td> </tr> <tr> <td class="h" > <a name="3521">3521</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> description </td> </tr> <tr> <td class="h" > <a name="3522">3522</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> content </td> </tr> <tr> <td class="h" > <a name="3523">3523</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> link </td> </tr> <tr> <td class="h" > <a name="3524">3524</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> pubDate </td> </tr> <tr> <td class="h" > <a name="3525">3525</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> published </td> </tr> <tr> <td class="h" > <a name="3526">3526</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> updated </td> </tr> <tr> <td class="h" > <a name="3527">3527</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> )))); </td> </tr> <tr> <td class="h" > <a name="3528">3528</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3529">3529</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # FIXME: is <wordzilla:id> anything that can be used ? </td> </tr> <tr> <td class="h" > <a name="3530">3530</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <slate:id> not needed, its feed has a guid. </td> </tr> <tr> <td class="h" > <a name="3531">3531</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @known{qw(/channel/item/guid </td> </tr> <tr> <td class="h" > <a name="3532">3532</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/id </td> </tr> <tr> <td class="h" > <a name="3533">3533</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/wordzilla:id </td> </tr> <tr> <td class="h" > <a name="3534">3534</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/slate:id </td> </tr> <tr> <td class="h" > <a name="3535">3535</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> )} = (); </td> </tr> <tr> <td class="h" > <a name="3536">3536</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3537">3537</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Return an "In-Reply-To:" value for $item, being a space-separated list of </td> </tr> <tr> <td class="h" > <a name="3538">3538</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Message-ID strings including angles <>, or undef if nothing. The message </td> </tr> <tr> <td class="h" > <a name="3539">3539</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # ids match up to an Atom <id> element in a parent item. </td> </tr> <tr> <td class="h" > <a name="3540">3540</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3541">3541</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # RFC 4685 has <thr:in-reply-to>. There can be multiple such elements if a </td> </tr> <tr> <td class="h" > <a name="3542">3542</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # reply to multiple originals. </td> </tr> <tr> <td class="h" > <a name="3543">3543</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3544">3544</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Eg. comment feeds under </td> </tr> <tr> <td class="h" > <a name="3545">3545</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # http://wickedgooddinner.blogspot.com/feeds/posts/default </td> </tr> <tr> <td class="h" > <a name="3546">3546</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3547">3547</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub item_to_in_reply_to { </td> </tr> <tr> <td class="h" > <a name="3548">3548</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3548-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3548-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $item) = @_; </td> </tr> <tr> <td class="h" > <a name="3549">3549</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3550">3550</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my @ids; </td> </tr> <tr> <td class="h" > <a name="3551">3551</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $elt ($item->children('thr:in-reply-to')) { </td> </tr> <tr> <td class="h" > <a name="3552">3552</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3552-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $ref = ($elt->att('thr:ref') </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-3"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3553">3553</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // $elt->att('ref') </td> </tr> <tr> <td class="h" > <a name="3554">3554</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // $elt->att('atom:ref') # comes out atom: under map_xmlns ... </td> </tr> <tr> <td class="h" > <a name="3555">3555</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // next); </td> </tr> <tr> <td class="h" > <a name="3556">3556</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # probably shouldn't be relative actually ... </td> </tr> <tr> <td class="h" > <a name="3557">3557</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $ref = App::RSS2Leafnode::XML::Twig::Other::elt_xml_based_uri ($elt, $ref); </td> </tr> <tr> <td class="h" > <a name="3558">3558</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> push @ids, $self->url_to_msgid ($ref); </td> </tr> <tr> <td class="h" > <a name="3559">3559</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3560">3560</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3560-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (@ids) { </td> </tr> <tr> <td class="h" > <a name="3561">3561</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return join (' ', @ids); </td> </tr> <tr> <td class="h" > <a name="3562">3562</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="3563">3563</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return undef; </td> </tr> <tr> <td class="h" > <a name="3564">3564</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3565">3565</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3566">3566</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @known{qw(/channel/item/thr:in-reply-to </td> </tr> <tr> <td class="h" > <a name="3567">3567</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> )} = (); </td> </tr> <tr> <td class="h" > <a name="3568">3568</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3569">3569</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Return a string of comma separated keywords per RFC1036 and RFC2822. </td> </tr> <tr> <td class="h" > <a name="3570">3570</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3571">3571</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # RSS <category>Foo</category> is often present with no other keywords, work </td> </tr> <tr> <td class="h" > <a name="3572">3572</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # that in as a bit of a fallback, being better than nothing for </td> </tr> <tr> <td class="h" > <a name="3573">3573</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # classification. </td> </tr> <tr> <td class="h" > <a name="3574">3574</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3575">3575</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Atom <category term="key" label="human readable"/> with the "label" </td> </tr> <tr> <td class="h" > <a name="3576">3576</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # attribute being the displayable part. Have seen only the "term" attribute </td> </tr> <tr> <td class="h" > <a name="3577">3577</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # though. </td> </tr> <tr> <td class="h" > <a name="3578">3578</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3579">3579</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <itunes:category> might be covered by <itunes:keywords> anyway, but work </td> </tr> <tr> <td class="h" > <a name="3580">3580</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # it in for more classification for now. Can have child <itunes:category> </td> </tr> <tr> <td class="h" > <a name="3581">3581</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # elements as sub-categories, but don't worry about them, haven't seen any </td> </tr> <tr> <td class="h" > <a name="3582">3582</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # real ones, only the sample at </td> </tr> <tr> <td class="h" > <a name="3583">3583</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # http://www.apple.com/itunes/podcasts/specs.html#example </td> </tr> <tr> <td class="h" > <a name="3584">3584</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3585">3585</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <slash:section> is slightly borderline. Sometimes it's a repeat of </td> </tr> <tr> <td class="h" > <a name="3586">3586</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <dc:subject>, which is fine. Sometimes it's just "news" which is not </td> </tr> <tr> <td class="h" > <a name="3587">3587</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # particularly informative. </td> </tr> <tr> <td class="h" > <a name="3588">3588</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3589">3589</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <cap:category> is "Geo", "Met", "Safety", "Fire" etc. Not sure if it </td> </tr> <tr> <td class="h" > <a name="3590">3590</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # should be in the keywords if it's also in the body text, but at least </td> </tr> <tr> <td class="h" > <a name="3591">3591</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # offers a bit of classification in the headers. </td> </tr> <tr> <td class="h" > <a name="3592">3592</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3593">3593</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <dc:subject> is supposed to be from a "restricted vocabulary" so might </td> </tr> <tr> <td class="h" > <a name="3594">3594</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # want a bit of decoding. Not much used, but for instance </td> </tr> <tr> <td class="h" > <a name="3595">3595</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # http://www.gdacs.org/xml/RSSTC.xml </td> </tr> <tr> <td class="h" > <a name="3596">3596</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # http://earthquake.usgs.gov/eqcenter/recenteqsww/catalogs/eqs7day-M5.xml </td> </tr> <tr> <td class="h" > <a name="3597">3597</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3598">3598</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # How much value is there in the channel keywords? </td> </tr> <tr> <td class="h" > <a name="3599">3599</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3600">3600</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="3601">3601</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $re = qr/^(category </td> </tr> <tr> <td class="h" > <a name="3602">3602</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |itunes:category </td> </tr> <tr> <td class="h" > <a name="3603">3603</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |cap:category </td> </tr> <tr> <td class="h" > <a name="3604">3604</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |itunes:keywords </td> </tr> <tr> <td class="h" > <a name="3605">3605</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |media:keywords </td> </tr> <tr> <td class="h" > <a name="3606">3606</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |dc:subject </td> </tr> <tr> <td class="h" > <a name="3607">3607</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |slash:section </td> </tr> <tr> <td class="h" > <a name="3608">3608</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |slate:topic </td> </tr> <tr> <td class="h" > <a name="3609">3609</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> )$/x; </td> </tr> <tr> <td class="h" > <a name="3610">3610</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub item_to_keywords { </td> </tr> <tr> <td class="h" > <a name="3611">3611</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3611-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3611-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $item) = @_; </td> </tr> <tr> <td class="h" > <a name="3612">3612</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $channel = item_to_channel($item); </td> </tr> <tr> <td class="h" > <a name="3613">3613</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3614">3614</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return join_non_empty </td> </tr> <tr> <td class="h" > <a name="3615">3615</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (', ', </td> </tr> <tr> <td class="h" > <a name="3616">3616</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> List::MoreUtils::uniq </td> </tr> <tr> <td class="h" > <a name="3617">3617</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (map { collapse_whitespace($_) } </td> </tr> <tr> <td class="h" > <a name="3618">3618</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3618-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> map { split /,/ } </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-3"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-4"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-5"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-6"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3619">3619</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> map { ($_->att('text') # itunes:category </td> </tr> <tr> <td class="h" > <a name="3620">3620</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // $_->att('itunes:text') # itunes:category </td> </tr> <tr> <td class="h" > <a name="3621">3621</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // $_->att('atom:label') # atom <category> </td> </tr> <tr> <td class="h" > <a name="3622">3622</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // $_->att('label') # atom <category> </td> </tr> <tr> <td class="h" > <a name="3623">3623</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // $_->att('atom:term') # atom <category>, if no "label" </td> </tr> <tr> <td class="h" > <a name="3624">3624</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // $_->att('term') # atom <category>, if no "label" </td> </tr> <tr> <td class="h" > <a name="3625">3625</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // $_->text) } # other </td> </tr> <tr> <td class="h" > <a name="3626">3626</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ($item->children($re), </td> </tr> <tr> <td class="h" > <a name="3627">3627</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $channel->children($re), </td> </tr> <tr> <td class="h" > <a name="3628">3628</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <cb:news> etc sub-element <cb:category> </td> </tr> <tr> <td class="h" > <a name="3629">3629</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> map {$_->children('cb:keyword')} $item->children, </td> </tr> <tr> <td class="h" > <a name="3630">3630</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ))); </td> </tr> <tr> <td class="h" > <a name="3631">3631</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3632">3632</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # maybe could show <slate:section> like "Health and Science" as a keyword </td> </tr> <tr> <td class="h" > <a name="3633">3633</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # too, for now just omit </td> </tr> <tr> <td class="h" > <a name="3634">3634</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @known{qw(/channel/category </td> </tr> <tr> <td class="h" > <a name="3635">3635</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/itunes:category </td> </tr> <tr> <td class="h" > <a name="3636">3636</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/itunes:category/itunes:category </td> </tr> <tr> <td class="h" > <a name="3637">3637</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3638">3638</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/category </td> </tr> <tr> <td class="h" > <a name="3639">3639</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/itunes:keywords </td> </tr> <tr> <td class="h" > <a name="3640">3640</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/media:keywords </td> </tr> <tr> <td class="h" > <a name="3641">3641</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/slash:section </td> </tr> <tr> <td class="h" > <a name="3642">3642</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/slate:topic </td> </tr> <tr> <td class="h" > <a name="3643">3643</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/slate:section </td> </tr> <tr> <td class="h" > <a name="3644">3644</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> )} = (); </td> </tr> <tr> <td class="h" > <a name="3645">3645</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3646">3646</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3647">3647</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="3648">3648</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Feturn a string for the "Importance:" header of RFC 1911, RFC 2156 </td> </tr> <tr> <td class="h" > <a name="3649">3649</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # voice and X.400 messaging. Possible values 'high', 'normal', 'low'. </td> </tr> <tr> <td class="h" > <a name="3650">3650</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # 'normal' is the header default, return undef in that case in the </td> </tr> <tr> <td class="h" > <a name="3651">3651</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # interests of not junking up headers with defaults </td> </tr> <tr> <td class="h" > <a name="3652">3652</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3653">3653</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my %cap_severity_high = (extreme => 1, </td> </tr> <tr> <td class="h" > <a name="3654">3654</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> severe => 1); </td> </tr> <tr> <td class="h" > <a name="3655">3655</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my %cap_severity_normal = (moderate => 1); </td> </tr> <tr> <td class="h" > <a name="3656">3656</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my %cap_severity_low = (minor => 1); </td> </tr> <tr> <td class="h" > <a name="3657">3657</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3658">3658</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub item_to_importance { </td> </tr> <tr> <td class="h" > <a name="3659">3659</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3659-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3659-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $item) = @_; </td> </tr> <tr> <td class="h" > <a name="3660">3660</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3661">3661</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3661-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $cap_severity = lc($item->first_child_trimmed_text('cap:severity') </td> </tr> <tr> <td class="h" > <a name="3662">3662</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // ''); </td> </tr> <tr> <td class="h" > <a name="3663">3663</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3663-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $wiki_importance = ($item->first_child_trimmed_text('wiki:importance') </td> </tr> <tr> <td class="h" > <a name="3664">3664</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // ''); </td> </tr> <tr> <td class="h" > <a name="3665">3665</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3665-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($cap_severity) { </td> </tr> <tr> <td class="h" > <a name="3666">3666</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, " CAP severity: ",$cap_severity); </td> </tr> <tr> <td class="h" > <a name="3667">3667</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, " Wiki importance: ",$wiki_importance); </td> </tr> <tr> <td class="h" > <a name="3668">3668</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3669">3669</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3670">3670</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3670-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($cap_severity_high{$cap_severity}) { </td> </tr> <tr> <td class="h" > <a name="3671">3671</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 'high'; </td> </tr> <tr> <td class="h" > <a name="3672">3672</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3673">3673</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3673-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($cap_severity_normal{$cap_severity}) { </td> </tr> <tr> <td class="h" > <a name="3674">3674</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return undef; # default "normal" </td> </tr> <tr> <td class="h" > <a name="3675">3675</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3676">3676</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3676-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3676-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($cap_severity_low{$cap_severity} </td> </tr> <tr> <td class="h" > <a name="3677">3677</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || $wiki_importance eq 'minor') { </td> </tr> <tr> <td class="h" > <a name="3678">3678</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 'low'; </td> </tr> <tr> <td class="h" > <a name="3679">3679</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3680">3680</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return undef; # unknown </td> </tr> <tr> <td class="h" > <a name="3681">3681</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3682">3682</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @known{qw(/channel/item/wiki:importance </td> </tr> <tr> <td class="h" > <a name="3683">3683</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> )} = (); </td> </tr> <tr> <td class="h" > <a name="3684">3684</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3685">3685</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="3686">3686</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Return a string for the "Priority:" header of RFC 1327, RFC 2156. </td> </tr> <tr> <td class="h" > <a name="3687">3687</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Possible values 'urgent', 'normal', 'non-urgent'. </td> </tr> <tr> <td class="h" > <a name="3688">3688</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # 'normal' is the header default, return undef in that case in the </td> </tr> <tr> <td class="h" > <a name="3689">3689</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # interests of not junking up headers with defaults </td> </tr> <tr> <td class="h" > <a name="3690">3690</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3691">3691</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <cap:urgency> is "Immediate", "Expected", "Future", "Past", "Unknown", </td> </tr> <tr> <td class="h" > <a name="3692">3692</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # for when response action should be taken. Is the <cap:severity> the </td> </tr> <tr> <td class="h" > <a name="3693">3693</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # better indicator of transmission priority? </td> </tr> <tr> <td class="h" > <a name="3694">3694</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3695">3695</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my %cap_severity_urgent = (extreme => 1, </td> </tr> <tr> <td class="h" > <a name="3696">3696</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> severe => 1); </td> </tr> <tr> <td class="h" > <a name="3697">3697</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my %cap_severity_normal = (moderate => 1); </td> </tr> <tr> <td class="h" > <a name="3698">3698</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3699">3699</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub item_to_priority { </td> </tr> <tr> <td class="h" > <a name="3700">3700</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3700-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3700-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $item) = @_; </td> </tr> <tr> <td class="h" > <a name="3701">3701</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3702">3702</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3702-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $cap_severity = lc($item->first_child_trimmed_text('cap:severity') </td> </tr> <tr> <td class="h" > <a name="3703">3703</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // ''); </td> </tr> <tr> <td class="h" > <a name="3704">3704</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3705">3705</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3705-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($cap_severity_urgent{$cap_severity}) { </td> </tr> <tr> <td class="h" > <a name="3706">3706</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 'urgent'; </td> </tr> <tr> <td class="h" > <a name="3707">3707</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3708">3708</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3708-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($cap_severity_normal{$cap_severity}) { </td> </tr> <tr> <td class="h" > <a name="3709">3709</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return undef; # default "normal" </td> </tr> <tr> <td class="h" > <a name="3710">3710</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3711">3711</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (0) { # nothing for this yet </td> </tr> <tr> <td class="h" > <a name="3712">3712</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 'non-urgent'; </td> </tr> <tr> <td class="h" > <a name="3713">3713</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3714">3714</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return undef; # unknown </td> </tr> <tr> <td class="h" > <a name="3715">3715</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3716">3716</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3717">3717</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3718">3718</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return a string for the slightly unofficial "Precedence:" header </td> </tr> <tr> <td class="h" > <a name="3719">3719</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # might be able to identify lists gatewayed to RSS and give "list" for them </td> </tr> <tr> <td class="h" > <a name="3720">3720</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # maybe "bulk" would suit low priority stuff </td> </tr> <tr> <td class="h" > <a name="3721">3721</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # for now nothing </td> </tr> <tr> <td class="h" > <a name="3722">3722</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3723">3723</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # sub item_to_precedence { </td> </tr> <tr> <td class="h" > <a name="3724">3724</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # my ($self, $item) = @_; </td> </tr> <tr> <td class="h" > <a name="3725">3725</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return undef; # nothing </td> </tr> <tr> <td class="h" > <a name="3726">3726</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # } </td> </tr> <tr> <td class="h" > <a name="3727">3727</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3728">3728</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return the host part of $self->{'uri'}, or "localhost" if none </td> </tr> <tr> <td class="h" > <a name="3729">3729</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub uri_to_host { </td> </tr> <tr> <td class="h" > <a name="3730">3730</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3730-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3730-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self) = @_; </td> </tr> <tr> <td class="h" > <a name="3731">3731</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $uri = $self->{'uri'}; </td> </tr> <tr> <td class="h" > <a name="3732">3732</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### uri_to_host(): $uri </td> </tr> <tr> <td class="h" > <a name="3733">3733</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3733-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return (non_empty ($uri && $uri->can('host') && $uri->host) </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3734">3734</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // 'localhost'); </td> </tr> <tr> <td class="h" > <a name="3735">3735</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3736">3736</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3737">3737</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub item_to_subject { </td> </tr> <tr> <td class="h" > <a name="3738">3738</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3738-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3738-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $item) = @_; </td> </tr> <tr> <td class="h" > <a name="3739">3739</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3740">3740</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Atom <title> can have type="html" etc in the usual way. </td> </tr> <tr> <td class="h" > <a name="3741">3741</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return </td> </tr> <tr> <td class="h" > <a name="3742">3742</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3742-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (elt_to_rendered_line ($item->first_child('title')) </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-3"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-4"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3743">3743</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3744">3744</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <dc:title> is probably pointless within an item, would it ever be </td> </tr> <tr> <td class="h" > <a name="3745">3745</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # present without a plain <title>? </td> </tr> <tr> <td class="h" > <a name="3746">3746</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3747">3747</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // elt_to_rendered_line ($item->first_child('dc:title')) </td> </tr> <tr> <td class="h" > <a name="3748">3748</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3749">3749</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # eg. https://archive.org/services/collection-rss.php has <media:title> </td> </tr> <tr> <td class="h" > <a name="3750">3750</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # in addition to plain <title>. Probably would never have </td> </tr> <tr> <td class="h" > <a name="3751">3751</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <media:title> without plain <title>, but check anyway. </td> </tr> <tr> <td class="h" > <a name="3752">3752</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3753">3753</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // elt_to_rendered_line ($item->first_child('media:title')) </td> </tr> <tr> <td class="h" > <a name="3754">3754</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3755">3755</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <dc:subject> is supposed to be a keyword type thing, but might be </td> </tr> <tr> <td class="h" > <a name="3756">3756</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # better than nothing. Not sure have ever actually seen <dc:subject> </td> </tr> <tr> <td class="h" > <a name="3757">3757</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # without <title>, so perhaps this is pointless. </td> </tr> <tr> <td class="h" > <a name="3758">3758</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3759">3759</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // elt_to_rendered_line ($item->first_child('dc:subject')) </td> </tr> <tr> <td class="h" > <a name="3760">3760</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3761">3761</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // __('no subject')); </td> </tr> <tr> <td class="h" > <a name="3762">3762</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3763">3763</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @known{qw(/channel/title </td> </tr> <tr> <td class="h" > <a name="3764">3764</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/dc:subject </td> </tr> <tr> <td class="h" > <a name="3765">3765</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/subtitle </td> </tr> <tr> <td class="h" > <a name="3766">3766</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/itunes:subtitle </td> </tr> <tr> <td class="h" > <a name="3767">3767</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3768">3768</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/dc:subject </td> </tr> <tr> <td class="h" > <a name="3769">3769</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/title </td> </tr> <tr> <td class="h" > <a name="3770">3770</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/media:title </td> </tr> <tr> <td class="h" > <a name="3771">3771</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/dc:title </td> </tr> <tr> <td class="h" > <a name="3772">3772</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/itunes:title </td> </tr> <tr> <td class="h" > <a name="3773">3773</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/itunes:subtitle --not-using-this-as-yet </td> </tr> <tr> <td class="h" > <a name="3774">3774</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/slate:menuline --copy-of-subject-it-seems </td> </tr> <tr> <td class="h" > <a name="3775">3775</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/slate:rubric --blog-title </td> </tr> <tr> <td class="h" > <a name="3776">3776</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/slate:blog --blog-title </td> </tr> <tr> <td class="h" > <a name="3777">3777</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/slate:legacy_url --same-as-link-it-seems </td> </tr> <tr> <td class="h" > <a name="3778">3778</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> )} = (); </td> </tr> <tr> <td class="h" > <a name="3779">3779</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3780">3780</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3781">3781</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return language code string for Content-Language, or undef </td> </tr> <tr> <td class="h" > <a name="3782">3782</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return is per RFC 1766, RFC 3066, RFC 4646 </td> </tr> <tr> <td class="h" > <a name="3783">3783</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3784">3784</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # xml:lang is defined to be per RFC 4646, no mangling needed </td> </tr> <tr> <td class="h" > <a name="3785">3785</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # RSS <language> seems close enough http://www.rssboard.org/rss-language-codes </td> </tr> <tr> <td class="h" > <a name="3786">3786</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <dc:language> is recommended as RFC 4646 </td> </tr> <tr> <td class="h" > <a name="3787">3787</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # cf. I18N::LangTags if mangling might be needed one day </td> </tr> <tr> <td class="h" > <a name="3788">3788</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3789">3789</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub item_to_language { </td> </tr> <tr> <td class="h" > <a name="3790">3790</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3790-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3790-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $item) = @_; </td> </tr> <tr> <td class="h" > <a name="3791">3791</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $lang; </td> </tr> <tr> <td class="h" > <a name="3792">3792</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3793">3793</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3793-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (my $elt = $item->first_child('content')) { </td> </tr> <tr> <td class="h" > <a name="3794">3794</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $lang = non_empty ($elt->att('xml:lang')); </td> </tr> <tr> <td class="h" > <a name="3795">3795</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3796">3796</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Either <language>, <dc:language>, <twitter:lang> sub-element or </td> </tr> <tr> <td class="h" > <a name="3797">3797</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # xml:lang="" tag, in the item itself or in channel, and maybe xml:lang in </td> </tr> <tr> <td class="h" > <a name="3798">3798</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # toplevel <feed>. $elt->inherit_att() is close, but looks only at </td> </tr> <tr> <td class="h" > <a name="3799">3799</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # xml:lang, not a <language> subelement. </td> </tr> <tr> <td class="h" > <a name="3800">3800</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> for ( ; $item; $item = $item->parent) { </td> </tr> <tr> <td class="h" > <a name="3801">3801</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3801-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $lang //= (non_empty ($item->first_child_trimmed_text </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-3"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3802">3802</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (qr/^((dc:)?language|twitter:lang)$/)) </td> </tr> <tr> <td class="h" > <a name="3803">3803</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // non_empty ($item->att('xml:lang')) </td> </tr> <tr> <td class="h" > <a name="3804">3804</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // next); </td> </tr> <tr> <td class="h" > <a name="3805">3805</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3806">3806</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3806-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return ($lang // $self->{'resp'}->content_language); </td> </tr> <tr> <td class="h" > <a name="3807">3807</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3808">3808</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @known{qw(/channel/language </td> </tr> <tr> <td class="h" > <a name="3809">3809</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/dc:language </td> </tr> <tr> <td class="h" > <a name="3810">3810</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/twitter:lang </td> </tr> <tr> <td class="h" > <a name="3811">3811</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/language </td> </tr> <tr> <td class="h" > <a name="3812">3812</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/dc:language </td> </tr> <tr> <td class="h" > <a name="3813">3813</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/twitter:lang </td> </tr> <tr> <td class="h" > <a name="3814">3814</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> )} = (); </td> </tr> <tr> <td class="h" > <a name="3815">3815</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3816">3816</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return arrayref of copyright strings </td> </tr> <tr> <td class="h" > <a name="3817">3817</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Keep all of multiple rights/license/etc in the interests of preserving all </td> </tr> <tr> <td class="h" > <a name="3818">3818</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # statements. </td> </tr> <tr> <td class="h" > <a name="3819">3819</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub item_to_copyright { </td> </tr> <tr> <td class="h" > <a name="3820">3820</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3820-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3820-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $item) = @_; </td> </tr> <tr> <td class="h" > <a name="3821">3821</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $channel = item_to_channel($item); </td> </tr> <tr> <td class="h" > <a name="3822">3822</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3823">3823</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <dcterms:license> supposedly supercedes <dc:rights>, maybe should </td> </tr> <tr> <td class="h" > <a name="3824">3824</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # suppress the latter in the presence of the former (dcterms: collapsed to </td> </tr> <tr> <td class="h" > <a name="3825">3825</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # dc: by the map_xmlns). </td> </tr> <tr> <td class="h" > <a name="3826">3826</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3827">3827</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Atom <rights> can be type="html" etc in its usual way, but think RSS is </td> </tr> <tr> <td class="h" > <a name="3828">3828</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # always plain text </td> </tr> <tr> <td class="h" > <a name="3829">3829</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3830">3830</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $re = qr/^(rights # Atom </td> </tr> <tr> <td class="h" > <a name="3831">3831</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |copyright # RSS, don't think entity-encoded html allowed there </td> </tr> <tr> <td class="h" > <a name="3832">3832</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |dcterms:license </td> </tr> <tr> <td class="h" > <a name="3833">3833</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |dc:rights </td> </tr> <tr> <td class="h" > <a name="3834">3834</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> |creativeCommons:licen[cs]e </td> </tr> <tr> <td class="h" > <a name="3835">3835</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> )$/x; </td> </tr> <tr> <td class="h" > <a name="3836">3836</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Atom sub-elem <source><rights>...</rights> </td> </tr> <tr> <td class="h" > <a name="3837">3837</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my @parents = ($item, $channel, $item->children('source')); </td> </tr> <tr> <td class="h" > <a name="3838">3838</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3839">3839</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my @strings; </td> </tr> <tr> <td class="h" > <a name="3840">3840</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $elt (map {$_->children($re)} @parents) { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3841">3841</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> push @strings, </td> </tr> <tr> <td class="h" > <a name="3842">3842</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> join_non_empty(' ', </td> </tr> <tr> <td class="h" > <a name="3843">3843</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> elt_to_rendered_line($elt), </td> </tr> <tr> <td class="h" > <a name="3844">3844</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # eg. <creativeCommons:licence rdf:resource="http://..."/> </td> </tr> <tr> <td class="h" > <a name="3845">3845</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $elt->att('rdf:resource')); </td> </tr> <tr> <td class="h" > <a name="3846">3846</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3847">3847</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3848">3848</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <link rel="license" href="..."> </td> </tr> <tr> <td class="h" > <a name="3849">3849</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $link (map {$_->children('link')} @parents) { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3850">3850</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### link for copyright: $link->sprint </td> </tr> <tr> <td class="h" > <a name="3851">3851</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3851-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3851-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (($link->att('atom:rel')//$link->att('rel')//'') eq 'license') { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3852">3852</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3852-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> push @strings, $link->att('atom:href')//$link->att('href'); </td> </tr> <tr> <td class="h" > <a name="3853">3853</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3854">3854</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3855">3855</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### @strings </td> </tr> <tr> <td class="h" > <a name="3856">3856</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return [ List::MoreUtils::uniq(grep {defined} @strings) ]; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3857">3857</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3858">3858</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @known{qw(/channel/copyright </td> </tr> <tr> <td class="h" > <a name="3859">3859</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/rights </td> </tr> <tr> <td class="h" > <a name="3860">3860</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/dc:rights </td> </tr> <tr> <td class="h" > <a name="3861">3861</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/dc:license </td> </tr> <tr> <td class="h" > <a name="3862">3862</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/creativeCommons:licence </td> </tr> <tr> <td class="h" > <a name="3863">3863</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/creativeCommons:license </td> </tr> <tr> <td class="h" > <a name="3864">3864</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/dc:rights </td> </tr> <tr> <td class="h" > <a name="3865">3865</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/dc:license </td> </tr> <tr> <td class="h" > <a name="3866">3866</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/creativeCommons:licence </td> </tr> <tr> <td class="h" > <a name="3867">3867</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/creativeCommons:license </td> </tr> <tr> <td class="h" > <a name="3868">3868</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> )} = (); </td> </tr> <tr> <td class="h" > <a name="3869">3869</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # /channel/item/media:credit --nothing-much-in-this-one </td> </tr> <tr> <td class="h" > <a name="3870">3870</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3871">3871</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3872">3872</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return string or undef </td> </tr> <tr> <td class="h" > <a name="3873">3873</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub item_to_generator { </td> </tr> <tr> <td class="h" > <a name="3874">3874</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3874-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3874-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $item) = @_; </td> </tr> <tr> <td class="h" > <a name="3875">3875</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $channel = item_to_channel($item); </td> </tr> <tr> <td class="h" > <a name="3876">3876</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my @strings; </td> </tr> <tr> <td class="h" > <a name="3877">3877</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3878">3878</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # both RSS and Atom use <generator> </td> </tr> <tr> <td class="h" > <a name="3879">3879</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Atom can include version="" and uri="" </td> </tr> <tr> <td class="h" > <a name="3880">3880</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3880-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (my $generator = $channel->first_child('generator')) { </td> </tr> <tr> <td class="h" > <a name="3881">3881</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> push @strings, join_non_empty (' ', </td> </tr> <tr> <td class="h" > <a name="3882">3882</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $generator->text, </td> </tr> <tr> <td class="h" > <a name="3883">3883</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $generator->att('atom:version'), </td> </tr> <tr> <td class="h" > <a name="3884">3884</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $generator->att('version'), </td> </tr> <tr> <td class="h" > <a name="3885">3885</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $generator->att('atom:uri'), </td> </tr> <tr> <td class="h" > <a name="3886">3886</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $generator->att('uri')); </td> </tr> <tr> <td class="h" > <a name="3887">3887</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3888">3888</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3889">3889</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # FIXME: is this bit right? </td> </tr> <tr> <td class="h" > <a name="3890">3890</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <statusnet:notice_info local_id="54790448" </td> </tr> <tr> <td class="h" > <a name="3891">3891</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # source="<a href="http://nongnu.org/identica-mode/" rel="nofollow">Emacs Identica-mode</a>" </td> </tr> <tr> <td class="h" > <a name="3892">3892</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # source_link="http://nongnu.org/identica-mode/"></statusnet:notice_info> </td> </tr> <tr> <td class="h" > <a name="3893">3893</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3894">3894</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3894-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (my $notice = $item->first_child('statusnet:notice_info')) { </td> </tr> <tr> <td class="h" > <a name="3895">3895</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3895-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined (my $html = $notice->att('atom:source'))) { </td> </tr> <tr> <td class="h" > <a name="3896">3896</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> push @strings, join_non_empty (' ', </td> </tr> <tr> <td class="h" > <a name="3897">3897</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> html_to_rendered_line($html), </td> </tr> <tr> <td class="h" > <a name="3898">3898</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $notice->att('atom:source_link')); </td> </tr> <tr> <td class="h" > <a name="3899">3899</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3900">3900</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3901">3901</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3902">3902</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return collapse_whitespace (join_non_empty (', ', @strings)); </td> </tr> <tr> <td class="h" > <a name="3903">3903</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3904">3904</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @known{qw(/channel/item/statusnet:notice_info </td> </tr> <tr> <td class="h" > <a name="3905">3905</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> )} = (); </td> </tr> <tr> <td class="h" > <a name="3906">3906</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3907">3907</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # return URL string or undef/empty </td> </tr> <tr> <td class="h" > <a name="3908">3908</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub item_to_feedburner { </td> </tr> <tr> <td class="h" > <a name="3909">3909</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3909-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3909-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $item) = @_; </td> </tr> <tr> <td class="h" > <a name="3910">3910</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $channel = item_to_channel($item); </td> </tr> <tr> <td class="h" > <a name="3911">3911</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3911-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $elt = $channel->first_child('feedburner:info') || return; </td> </tr> <tr> <td class="h" > <a name="3912">3912</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3912-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $uri = $elt->att('uri') // return; </td> </tr> <tr> <td class="h" > <a name="3913">3913</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return URI->new_abs ($uri, 'http://feeds.feedburner.com/')->as_string; </td> </tr> <tr> <td class="h" > <a name="3914">3914</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3915">3915</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3916">3916</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $elt is an Atom <content> </td> </tr> <tr> <td class="h" > <a name="3917">3917</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub atom_content_flavour { </td> </tr> <tr> <td class="h" > <a name="3918">3918</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3918-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3918-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($elt) = @_; </td> </tr> <tr> <td class="h" > <a name="3919">3919</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3919-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! defined $elt) { return ''; } </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3920">3920</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3920-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $type = ($elt->att('atom:type') // $elt->att('type')); </td> </tr> <tr> <td class="h" > <a name="3921">3921</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3921-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3921-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($elt->att('atom:src') || $elt->att('src')) { </td> </tr> <tr> <td class="h" > <a name="3922">3922</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <content src=""> external </td> </tr> <tr> <td class="h" > <a name="3923">3923</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 'link'; </td> </tr> <tr> <td class="h" > <a name="3924">3924</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3925">3925</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3925-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3925-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! defined $type </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-3"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-4"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3926">3926</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || $type eq 'html' </td> </tr> <tr> <td class="h" > <a name="3927">3927</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || $type eq 'xhtml' </td> </tr> <tr> <td class="h" > <a name="3928">3928</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || $type eq 'application/xhtml+xml' </td> </tr> <tr> <td class="h" > <a name="3929">3929</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || $type =~ m{^text/}) { </td> </tr> <tr> <td class="h" > <a name="3930">3930</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 'body'; </td> </tr> <tr> <td class="h" > <a name="3931">3931</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3932">3932</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 'attach'; </td> </tr> <tr> <td class="h" > <a name="3933">3933</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3934">3934</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3935">3935</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub html_wrap_fragment { </td> </tr> <tr> <td class="h" > <a name="3936">3936</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3936-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3936-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($item, $fragment, $language) = @_; </td> </tr> <tr> <td class="h" > <a name="3937">3937</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3937-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $charset = (is_ascii($fragment) ? 'us-ascii' : 'utf-8'); </td> </tr> <tr> <td class="h" > <a name="3938">3938</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $base_uri = App::RSS2Leafnode::XML::Twig::Other::elt_xml_base($item); </td> </tr> <tr> <td class="h" > <a name="3939">3939</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3939-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $base_header = (defined $base_uri </td> </tr> <tr> <td class="h" > <a name="3940">3940</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ? " <base href=\"$Entitize{$base_uri}\">\n" </td> </tr> <tr> <td class="h" > <a name="3941">3941</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> : ''); </td> </tr> <tr> <td class="h" > <a name="3942">3942</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3942-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (is_non_empty ($language)) { </td> </tr> <tr> <td class="h" > <a name="3943">3943</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $language = " lang=\"$Entitize{$language}\""; </td> </tr> <tr> <td class="h" > <a name="3944">3944</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="3945">3945</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $language = ''; </td> </tr> <tr> <td class="h" > <a name="3946">3946</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3947">3947</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return (<<"HERE", $charset); </td> </tr> <tr> <td class="h" > <a name="3948">3948</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> </td> </tr> <tr> <td class="h" > <a name="3949">3949</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> <html$language> </td> </tr> <tr> <td class="h" > <a name="3950">3950</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> <head> </td> </tr> <tr> <td class="h" > <a name="3951">3951</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> <meta http-equiv=Content-Type content="text/html; charset=$charset"> </td> </tr> <tr> <td class="h" > <a name="3952">3952</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $base_header</head> </td> </tr> <tr> <td class="h" > <a name="3953">3953</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> <body> </td> </tr> <tr> <td class="h" > <a name="3954">3954</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $fragment </td> </tr> <tr> <td class="h" > <a name="3955">3955</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </body></html> </td> </tr> <tr> <td class="h" > <a name="3956">3956</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> HERE </td> </tr> <tr> <td class="h" > <a name="3957">3957</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3958">3958</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3959">3959</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $self->{'rss_charset_override'}, if set, means the bytes are actually in </td> </tr> <tr> <td class="h" > <a name="3960">3960</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # that charset. Enforce this by replacing the "<?xml encoding=" in the </td> </tr> <tr> <td class="h" > <a name="3961">3961</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # bytes. Do a decode() and re-encode() to cope with non-ascii like say </td> </tr> <tr> <td class="h" > <a name="3962">3962</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # utf-16. </td> </tr> <tr> <td class="h" > <a name="3963">3963</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3964">3964</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # XML::RSS::LibXML has an "encoding" option on its new(), but that's for </td> </tr> <tr> <td class="h" > <a name="3965">3965</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # feed creation or something, a parse() still follows the <?xml> tag. </td> </tr> <tr> <td class="h" > <a name="3966">3966</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="3967">3967</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub enforce_rss_charset_override { </td> </tr> <tr> <td class="h" > <a name="3968">3968</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3968-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3968-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $xml) = @_; </td> </tr> <tr> <td class="h" > <a name="3969">3969</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3969-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (my $charset = $self->{'rss_charset_override'}) { </td> </tr> <tr> <td class="h" > <a name="3970">3970</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $xml = Encode::decode ($charset, $xml); </td> </tr> <tr> <td class="h" > <a name="3971">3971</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3971-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($xml =~ s/(<\?xml[^>]*encoding="?)([^">]+)/$1$charset/i) { </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3972">3972</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, "replace encoding=$2 tag with encoding=$charset"); </td> </tr> <tr> <td class="h" > <a name="3973">3973</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($xml =~ s/(<\?xml[^?>]*)/$1 encoding="$charset"/i) { </td> </tr> <tr> <td class="h" > <a name="3974">3974</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, "insert encoding=\"$charset\""); </td> </tr> <tr> <td class="h" > <a name="3975">3975</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="3976">3976</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $str = "<?xml version=\"1.0\" encoding=\"$charset\"?>\n"; </td> </tr> <tr> <td class="h" > <a name="3977">3977</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, "insert $str"); </td> </tr> <tr> <td class="h" > <a name="3978">3978</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $xml = $str . $xml; </td> </tr> <tr> <td class="h" > <a name="3979">3979</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3980">3980</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (3, "xml now:\n$xml\n"); </td> </tr> <tr> <td class="h" > <a name="3981">3981</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $xml = Encode::encode ($charset, $xml); </td> </tr> <tr> <td class="h" > <a name="3982">3982</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3983">3983</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $xml; </td> </tr> <tr> <td class="h" > <a name="3984">3984</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3985">3985</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="3986">3986</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # slightly experimental extract of "cap" fields as from </td> </tr> <tr> <td class="h" > <a name="3987">3987</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # http://www.nws.noaa.gov/alerts-beta/ </td> </tr> <tr> <td class="h" > <a name="3988">3988</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # http://www.weather.gov/alerts-beta/ca.php?x=0 </td> </tr> <tr> <td class="h" > <a name="3989">3989</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub item_common_alert_protocol { </td> </tr> <tr> <td class="h" > <a name="3990">3990</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3990-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#3990-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $item, $want_html) = @_; </td> </tr> <tr> <td class="h" > <a name="3991">3991</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my @fields; </td> </tr> <tr> <td class="h" > <a name="3992">3992</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $elt ($item->children(qr/^cap:/)) { </td> </tr> <tr> <td class="h" > <a name="3993">3993</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (my $field = $elt->name) =~ s/^cap://; </td> </tr> <tr> <td class="h" > <a name="3994">3994</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#3994-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#3994-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($field eq 'geocode' || $field eq 'parameter') { </td> </tr> <tr> <td class="h" > <a name="3995">3995</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # dunno how to show these yet ... </td> </tr> <tr> <td class="h" > <a name="3996">3996</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> next; </td> </tr> <tr> <td class="h" > <a name="3997">3997</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="3998">3998</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $known{'/channel/item/'.$elt->name} = undef; </td> </tr> <tr> <td class="h" > <a name="3999">3999</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4000">4000</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $value = elt_to_rendered_line ($elt); </td> </tr> <tr> <td class="h" > <a name="4001">4001</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $value = Text::Trim::trim ($value); </td> </tr> <tr> <td class="h" > <a name="4002">4002</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4002-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (is_non_empty ($value)) { </td> </tr> <tr> <td class="h" > <a name="4003">4003</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> push @fields, [ "\u$field: ", $value ]; </td> </tr> <tr> <td class="h" > <a name="4004">4004</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4005">4005</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4006">4006</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4006-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! @fields) { </td> </tr> <tr> <td class="h" > <a name="4007">4007</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return ''; </td> </tr> <tr> <td class="h" > <a name="4008">4008</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4009">4009</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # FIXME: This $width padding doesn't come out in html, only in text. The </td> </tr> <tr> <td class="h" > <a name="4010">4010</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # NOAA is Atom plain text, so that one is ok at least. </td> </tr> <tr> <td class="h" > <a name="4011">4011</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $width = max(map {length $_->[0]} @fields); </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4012">4012</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @fields = map { my $field = $_->[0]; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4013">4013</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $value = $_->[1]; </td> </tr> <tr> <td class="h" > <a name="4014">4014</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $field = sprintf ('%-*s', $width, $field); </td> </tr> <tr> <td class="h" > <a name="4015">4015</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->text_wrap ($value, $field) </td> </tr> <tr> <td class="h" > <a name="4016">4016</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } @fields; </td> </tr> <tr> <td class="h" > <a name="4017">4017</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4017-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($want_html) { </td> </tr> <tr> <td class="h" > <a name="4018">4018</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return "<p>\n" </td> </tr> <tr> <td class="h" > <a name="4019">4019</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> . join("<br>\n", map {$Entitize{$_}} @fields) </td> </tr> <tr> <td class="h" > <a name="4020">4020</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> . "\n</p>\n"; </td> </tr> <tr> <td class="h" > <a name="4021">4021</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="4022">4022</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return "\n" </td> </tr> <tr> <td class="h" > <a name="4023">4023</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> . join("\n", @fields) </td> </tr> <tr> <td class="h" > <a name="4024">4024</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> . "\n"; </td> </tr> <tr> <td class="h" > <a name="4025">4025</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4026">4026</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4027">4027</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4028">4028</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub item_unknowns { </td> </tr> <tr> <td class="h" > <a name="4029">4029</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#4029-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#4029-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $item, $want_html) = @_; </td> </tr> <tr> <td class="h" > <a name="4030">4030</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### item_unknowns() ... </td> </tr> <tr> <td class="h" > <a name="4031">4031</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4032">4032</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $xml = ''; </td> </tr> <tr> <td class="h" > <a name="4033">4033</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4033-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $elt (map {$_->tag eq 'media:group' # descend into media:group </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4034">4034</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ? $_->children : $_} </td> </tr> <tr> <td class="h" > <a name="4035">4035</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $item->children) { </td> </tr> <tr> <td class="h" > <a name="4036">4036</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4036-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> next if $elt->tag =~ /^#/; # text </td> </tr> <tr> <td class="h" > <a name="4037">4037</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4037-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> next if App::RSS2Leafnode::XML::Twig::Other::elt_is_empty($elt); </td> </tr> <tr> <td class="h" > <a name="4038">4038</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $path = $elt->path; </td> </tr> <tr> <td class="h" > <a name="4039">4039</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $path =~ s{^/(rss|channel)/channel}{/channel}; </td> </tr> <tr> <td class="h" > <a name="4040">4040</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $path =~ s{^/(feed|rdf:RDF)}{/channel}; </td> </tr> <tr> <td class="h" > <a name="4041">4041</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $path =~ s{^/channel/entry}{/channel/item}; </td> </tr> <tr> <td class="h" > <a name="4042">4042</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4042-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> next if $path =~ m{/xhtml}; </td> </tr> <tr> <td class="h" > <a name="4043">4043</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4043-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> next if $path =~ m{^/channel/item/(description|content:encoded)/}; </td> </tr> <tr> <td class="h" > <a name="4044">4044</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4044-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> next if exists $known{$path}; </td> </tr> <tr> <td class="h" > <a name="4045">4045</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### unknown path: $path </td> </tr> <tr> <td class="h" > <a name="4046">4046</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4047">4047</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require Text::Wrap; </td> </tr> <tr> <td class="h" > <a name="4048">4048</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $part = do { </td> </tr> <tr> <td class="h" > <a name="4049">4049</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local $Text::Wrap::columns = $self->{'render_width'} + 1 + 4; </td> </tr> <tr> <td class="h" > <a name="4050">4050</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local $Text::Wrap::huge = 'overflow'; # don't break long words </td> </tr> <tr> <td class="h" > <a name="4051">4051</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local $Text::Wrap::unexpand = 0; # no tabs in output </td> </tr> <tr> <td class="h" > <a name="4052">4052</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $elt->sprint </td> </tr> <tr> <td class="h" > <a name="4053">4053</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> }; </td> </tr> <tr> <td class="h" > <a name="4054">4054</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $part =~ s/^ //mg; # indentation from element depth </td> </tr> <tr> <td class="h" > <a name="4055">4055</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $part =~ s/^\n+//; # leading blank lines </td> </tr> <tr> <td class="h" > <a name="4056">4056</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $xml .= $part; </td> </tr> <tr> <td class="h" > <a name="4057">4057</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4058">4058</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4058-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($xml eq '') { </td> </tr> <tr> <td class="h" > <a name="4059">4059</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return ''; </td> </tr> <tr> <td class="h" > <a name="4060">4060</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4061">4061</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### $xml </td> </tr> <tr> <td class="h" > <a name="4062">4062</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4063">4063</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4063-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($want_html) { </td> </tr> <tr> <td class="h" > <a name="4064">4064</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return "\n<p>\n" . __('Further feed XML:') . "<br>\n" </td> </tr> <tr> <td class="h" > <a name="4065">4065</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> . "<pre>$Entitize{$xml}</pre>\n</p>\n"; </td> </tr> <tr> <td class="h" > <a name="4066">4066</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="4067">4067</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return "\n" . __('Further feed XML:') . "\n" . $xml; </td> </tr> <tr> <td class="h" > <a name="4068">4068</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4069">4069</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4070">4070</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4071">4071</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @known{qw(/channel/item/media:group/media:title </td> </tr> <tr> <td class="h" > <a name="4072">4072</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/media:group/media:description </td> </tr> <tr> <td class="h" > <a name="4073">4073</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/media:group/media:credit </td> </tr> <tr> <td class="h" > <a name="4074">4074</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/media:group/media:player </td> </tr> <tr> <td class="h" > <a name="4075">4075</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/media:group/media:thumbnail </td> </tr> <tr> <td class="h" > <a name="4076">4076</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/media:group/media:content </td> </tr> <tr> <td class="h" > <a name="4077">4077</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/media:group/media:copyright </td> </tr> <tr> <td class="h" > <a name="4078">4078</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4079">4079</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> --ENHANCE-ME--nothing-for-these-yet </td> </tr> <tr> <td class="h" > <a name="4080">4080</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/media:group/media:category </td> </tr> <tr> <td class="h" > <a name="4081">4081</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/media:group/media:rating </td> </tr> <tr> <td class="h" > <a name="4082">4082</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> )} = (); # hash slice </td> </tr> <tr> <td class="h" > <a name="4083">4083</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4084">4084</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub media_group_to_html { </td> </tr> <tr> <td class="h" > <a name="4085">4085</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#4085-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#4085-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $group) = @_; </td> </tr> <tr> <td class="h" > <a name="4086">4086</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### media_group_to_html(): "$group" </td> </tr> <tr> <td class="h" > <a name="4087">4087</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4088">4088</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $ret = "<p>\n"; </td> </tr> <tr> <td class="h" > <a name="4089">4089</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my @lines; </td> </tr> <tr> <td class="h" > <a name="4090">4090</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4091">4091</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $elt ($group->children('media:title'), </td> </tr> <tr> <td class="h" > <a name="4092">4092</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $group->children('media:description')) { </td> </tr> <tr> <td class="h" > <a name="4093">4093</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> push @lines, elt_to_html($elt); </td> </tr> <tr> <td class="h" > <a name="4094">4094</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4095">4095</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4096">4096</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $elt ($group->children('media:credit')) { </td> </tr> <tr> <td class="h" > <a name="4097">4097</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $html = elt_to_html($elt); </td> </tr> <tr> <td class="h" > <a name="4098">4098</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4098-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined (my $role = non_empty($elt->att('role')))) { </td> </tr> <tr> <td class="h" > <a name="4099">4099</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $html .= " ($Entitize{$role})"; </td> </tr> <tr> <td class="h" > <a name="4100">4100</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4101">4101</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> push @lines, $html; </td> </tr> <tr> <td class="h" > <a name="4102">4102</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4103">4103</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $elt ($group->children('media:player'), </td> </tr> <tr> <td class="h" > <a name="4104">4104</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $group->children('media:thumbnail'), </td> </tr> <tr> <td class="h" > <a name="4105">4105</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $group->children('media:content')) { </td> </tr> <tr> <td class="h" > <a name="4106">4106</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#4106-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $url = $elt->att('url') // next; </td> </tr> <tr> <td class="h" > <a name="4107">4107</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $abs_url = App::RSS2Leafnode::XML::Twig::Other::elt_xml_based_uri </td> </tr> <tr> <td class="h" > <a name="4108">4108</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ($group, $url); </td> </tr> <tr> <td class="h" > <a name="4109">4109</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4110">4110</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $html = "<a href=\"$Entitize{$abs_url}\""; </td> </tr> <tr> <td class="h" > <a name="4111">4111</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4111-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined (my $type = non_empty($elt->att('type')))) { </td> </tr> <tr> <td class="h" > <a name="4112">4112</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $html .= " type=\"$Entitize{$type}\""; </td> </tr> <tr> <td class="h" > <a name="4113">4113</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4114">4114</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4114-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined (my $lang = non_empty($elt->att('lang')))) { </td> </tr> <tr> <td class="h" > <a name="4115">4115</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $html .= " hreflang=\"$Entitize{$lang}\""; </td> </tr> <tr> <td class="h" > <a name="4116">4116</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4117">4117</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $html .= ">$Entitize{$url}$url</a>"; </td> </tr> <tr> <td class="h" > <a name="4118">4118</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="4119">4119</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my @paren; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4120">4120</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4120-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined (my $size = non_empty($elt->att('fileSize')))) { </td> </tr> <tr> <td class="h" > <a name="4121">4121</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> push @paren, $self->format_size_in_bytes($size); </td> </tr> <tr> <td class="h" > <a name="4122">4122</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4123">4123</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4123-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined (my $duration = non_empty($elt->att('duration')))) { </td> </tr> <tr> <td class="h" > <a name="4124">4124</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4124-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($duration !~ /:/) { </td> </tr> <tr> <td class="h" > <a name="4125">4125</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $duration = __px('s-for-seconds', '{duration}s', </td> </tr> <tr> <td class="h" > <a name="4126">4126</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> duration => $duration); </td> </tr> <tr> <td class="h" > <a name="4127">4127</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4128">4128</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> push @paren, $duration; </td> </tr> <tr> <td class="h" > <a name="4129">4129</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4130">4130</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4130-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (@paren) { </td> </tr> <tr> <td class="h" > <a name="4131">4131</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $html .= $Entitize{' (' . join(', ',@paren). ')'}; </td> </tr> <tr> <td class="h" > <a name="4132">4132</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4133">4133</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4134">4134</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $html .= "\n"; </td> </tr> <tr> <td class="h" > <a name="4135">4135</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> push @lines, $html; </td> </tr> <tr> <td class="h" > <a name="4136">4136</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4137">4137</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4138">4138</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $elt ($group->children('media:copyright')) { </td> </tr> <tr> <td class="h" > <a name="4139">4139</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> push @lines, "Copyright: ".elt_to_html($elt); </td> </tr> <tr> <td class="h" > <a name="4140">4140</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4141">4141</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4142">4142</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### total lines: scalar(@lines) </td> </tr> <tr> <td class="h" > <a name="4143">4143</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return "<p>\n" . join("<br>\n",@lines) . "\n</p>\n"; </td> </tr> <tr> <td class="h" > <a name="4144">4144</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4145">4145</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4146">4146</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub elt_to_html { </td> </tr> <tr> <td class="h" > <a name="4147">4147</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#4147-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#4147-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($elt) = @_; </td> </tr> <tr> <td class="h" > <a name="4148">4148</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4148-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> defined $elt or return; </td> </tr> <tr> <td class="h" > <a name="4149">4149</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> </td> </tr> <tr> <td class="h" > <a name="4150">4150</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $type = elt_content_type ($elt); </td> </tr> <tr> <td class="h" > <a name="4151">4151</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4151-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($type eq 'xhtml') { </td> </tr> <tr> <td class="h" > <a name="4152">4152</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return elt_xhtml_to_html($elt); </td> </tr> <tr> <td class="h" > <a name="4153">4153</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4154">4154</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $str = elt_subtext($elt); </td> </tr> <tr> <td class="h" > <a name="4155">4155</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4155-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($type eq 'html') { </td> </tr> <tr> <td class="h" > <a name="4156">4156</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $str; </td> </tr> <tr> <td class="h" > <a name="4157">4157</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="4158">4158</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $Entitize{$str}; </td> </tr> <tr> <td class="h" > <a name="4159">4159</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4160">4160</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4161">4161</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4162">4162</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $body construction below </td> </tr> <tr> <td class="h" > <a name="4163">4163</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @known{qw(/channel/item/description </td> </tr> <tr> <td class="h" > <a name="4164">4164</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/dc:description </td> </tr> <tr> <td class="h" > <a name="4165">4165</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/itunes:summary </td> </tr> <tr> <td class="h" > <a name="4166">4166</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/content:encoded </td> </tr> <tr> <td class="h" > <a name="4167">4167</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> /channel/item/summary </td> </tr> <tr> <td class="h" > <a name="4168">4168</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> )} = (); </td> </tr> <tr> <td class="h" > <a name="4169">4169</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4170">4170</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $item is an XML::Twig::Elt </td> </tr> <tr> <td class="h" > <a name="4171">4171</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="4172">4172</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub fetch_rss_process_one_item { </td> </tr> <tr> <td class="h" > <a name="4173">4173</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#4173-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#4173-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $item) = @_; </td> </tr> <tr> <td class="h" > <a name="4174">4174</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $subject = $self->item_to_subject ($item); </td> </tr> <tr> <td class="h" > <a name="4175">4175</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (1, ' ', __x('item: {subject}', subject => $subject)); </td> </tr> <tr> <td class="h" > <a name="4176">4176</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4177">4177</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $msgid = $self->item_to_msgid ($item); </td> </tr> <tr> <td class="h" > <a name="4178">4178</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $new = 0; </td> </tr> <tr> <td class="h" > <a name="4179">4179</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4180">4180</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4180-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! $self->nntp_message_id_exists ($msgid)) { </td> </tr> <tr> <td class="h" > <a name="4181">4181</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $channel = item_to_channel($item); </td> </tr> <tr> <td class="h" > <a name="4182">4182</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my ($from, @from_links) = $self->item_to_from($item); </td> </tr> <tr> <td class="h" > <a name="4183">4183</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my @links = ($self->item_to_links ($item), </td> </tr> <tr> <td class="h" > <a name="4184">4184</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @from_links); </td> </tr> <tr> <td class="h" > <a name="4185">4185</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4186">4186</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # For comments feeds show "Re: Foo" as the subject. Haven't seen a </td> </tr> <tr> <td class="h" > <a name="4187">4187</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # comments feed with anything useful in the <title>. Could think about </td> </tr> <tr> <td class="h" > <a name="4188">4188</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # including it at the start of the message body if it was any good. </td> </tr> <tr> <td class="h" > <a name="4189">4189</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="4190">4190</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="4191">4191</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # http://www.netzpolitik.org/feed/ has <wfw:commentRss> feeds with <title> </td> </tr> <tr> <td class="h" > <a name="4192">4192</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # just "Von: Foo" where Foo is the poster's name. </td> </tr> <tr> <td class="h" > <a name="4193">4193</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="4194">4194</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # my $dummy = $self->DUMMY_EMAIL_ADDRESS; </td> </tr> <tr> <td class="h" > <a name="4195">4195</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # if ($from =~ /(.*) <\Q$dummy\E>$/ </td> </tr> <tr> <td class="h" > <a name="4196">4196</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # && $subject eq "Von: $1") { </td> </tr> <tr> <td class="h" > <a name="4197">4197</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $subject = $self->{'getting_rss_comments'}; </td> </tr> <tr> <td class="h" > <a name="4198">4198</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # } </td> </tr> <tr> <td class="h" > <a name="4199">4199</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="4200">4200</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4200-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined $self->{'getting_rss_comments'}) { </td> </tr> <tr> <td class="h" > <a name="4201">4201</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $subject = $self->{'getting_rss_comments'}; </td> </tr> <tr> <td class="h" > <a name="4202">4202</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4203">4203</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4204">4204</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $list_post = googlegroups_link_email(@links); </td> </tr> <tr> <td class="h" > <a name="4205">4205</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4205-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $precedence = (defined $list_post ? 'list' : undef); </td> </tr> <tr> <td class="h" > <a name="4206">4206</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $language = $self->item_to_language($item); </td> </tr> <tr> <td class="h" > <a name="4207">4207</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4208">4208</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # RSS <rating> PICS-Label </td> </tr> <tr> <td class="h" > <a name="4209">4209</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # http://www.w3.org/TR/REC-PICS-labels </td> </tr> <tr> <td class="h" > <a name="4210">4210</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # ENHANCE-ME: Maybe transform <itunes:explicit> "yes","no","clean" into </td> </tr> <tr> <td class="h" > <a name="4211">4211</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # PICS too maybe, unless it only applies to the enclosure as such. Maybe </td> </tr> <tr> <td class="h" > <a name="4212">4212</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <media:adult> likewise. </td> </tr> <tr> <td class="h" > <a name="4213">4213</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $pics_label = collapse_whitespace ($channel->first_child_text('rating')); </td> </tr> <tr> <td class="h" > <a name="4214">4214</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4215">4215</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Crib: an undef value for a header means omit that header, which is good </td> </tr> <tr> <td class="h" > <a name="4216">4216</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # for say the merely optional "Content-Language" </td> </tr> <tr> <td class="h" > <a name="4217">4217</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="4218">4218</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # there can be multiple "feed" links from Atom ... </td> </tr> <tr> <td class="h" > <a name="4219">4219</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # 'X-RSS-Feed-Link:' => $channel->{'link'}, </td> </tr> <tr> <td class="h" > <a name="4220">4220</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="4221">4221</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my %headers </td> </tr> <tr> <td class="h" > <a name="4222">4222</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> = ('Path:' => scalar ($self->uri_to_host), </td> </tr> <tr> <td class="h" > <a name="4223">4223</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'Newsgroups:' => $self->{'nntp_group'}, </td> </tr> <tr> <td class="h" > <a name="4224">4224</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> From => $from, </td> </tr> <tr> <td class="h" > <a name="4225">4225</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Subject => $subject, </td> </tr> <tr> <td class="h" > <a name="4226">4226</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Keywords => scalar ($self->item_to_keywords($item)), </td> </tr> <tr> <td class="h" > <a name="4227">4227</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Date => scalar ($self->item_to_date($item)), </td> </tr> <tr> <td class="h" > <a name="4228">4228</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'In-Reply-To:' => scalar ($self->item_to_in_reply_to($item)), </td> </tr> <tr> <td class="h" > <a name="4229">4229</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> References => $self->{'References:'}, </td> </tr> <tr> <td class="h" > <a name="4230">4230</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'Message-ID' => $msgid, </td> </tr> <tr> <td class="h" > <a name="4231">4231</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'Content-Language:' => $language, </td> </tr> <tr> <td class="h" > <a name="4232">4232</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'Importance:' => scalar ($self->item_to_importance($item)), </td> </tr> <tr> <td class="h" > <a name="4233">4233</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'Priority:' => scalar ($self->item_to_priority($item)), </td> </tr> <tr> <td class="h" > <a name="4234">4234</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'Face:' => scalar ($self->item_to_face($item)), </td> </tr> <tr> <td class="h" > <a name="4235">4235</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'List-Post:' => $list_post, </td> </tr> <tr> <td class="h" > <a name="4236">4236</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'Precedence:' => $precedence, </td> </tr> <tr> <td class="h" > <a name="4237">4237</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'PICS-Label:' => $pics_label, </td> </tr> <tr> <td class="h" > <a name="4238">4238</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'X-Copyright:' => scalar ($self->item_to_copyright($item)), </td> </tr> <tr> <td class="h" > <a name="4239">4239</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'X-RSS-URL:' => scalar ($self->{'uri'}->as_string), </td> </tr> <tr> <td class="h" > <a name="4240">4240</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'X-RSS-Feedburner:' => scalar ($self->item_to_feedburner($item)), </td> </tr> <tr> <td class="h" > <a name="4241">4241</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 'X-RSS-Generator:' => scalar ($self->item_to_generator($item)), </td> </tr> <tr> <td class="h" > <a name="4242">4242</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ); </td> </tr> <tr> <td class="h" > <a name="4243">4243</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4244">4244</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $attach_elt; </td> </tr> <tr> <td class="h" > <a name="4245">4245</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4246">4246</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <media:text> is another possibility, but have seen it from Yahoo as just </td> </tr> <tr> <td class="h" > <a name="4247">4247</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # a copy of <description>, with type="html" to make the format clear. </td> </tr> <tr> <td class="h" > <a name="4248">4248</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="4249">4249</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # ENHANCE-ME: <itunes:subtitle> might be worthwhile showing at the start </td> </tr> <tr> <td class="h" > <a name="4250">4250</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # as well as <itunes:summary>. </td> </tr> <tr> <td class="h" > <a name="4251">4251</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="4252">4252</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $body = ( </td> </tr> <tr> <td class="h" > <a name="4253">4253</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <content:encoded> generally bigger or better than </td> </tr> <tr> <td class="h" > <a name="4254">4254</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <description>, so prefer that </td> </tr> <tr> <td class="h" > <a name="4255">4255</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $item->first_child('content:encoded') </td> </tr> <tr> <td class="h" > <a name="4256">4256</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || $item->first_child('description') </td> </tr> <tr> <td class="h" > <a name="4257">4257</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || $item->first_child('dc:description') </td> </tr> <tr> <td class="h" > <a name="4258">4258</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || $item->first_child('itunes:summary') </td> </tr> <tr> <td class="h" > <a name="4259">4259</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#4259-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || do { </td> </tr> <tr> <td class="h" > <a name="4260">4260</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Atom spec is for no more than one <content>. </td> </tr> <tr> <td class="h" > <a name="4261">4261</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Exclude "link", and leave "attach" to code below. </td> </tr> <tr> <td class="h" > <a name="4262">4262</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $elt = $item->first_child('content'); </td> </tr> <tr> <td class="h" > <a name="4263">4263</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $flavour = atom_content_flavour($elt); </td> </tr> <tr> <td class="h" > <a name="4264">4264</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ($flavour eq 'link' ? undef </td> </tr> <tr> <td class="h" > <a name="4265">4265</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> : $flavour eq 'attach' ? do { $attach_elt = $elt; undef } </td> </tr> <tr> <td class="h" > <a name="4266">4266</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> : $elt) </td> </tr> <tr> <td class="h" > <a name="4267">4267</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4268">4268</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || $item->first_child('summary')); # Atom </td> </tr> <tr> <td class="h" > <a name="4269">4269</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4270">4270</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $body_type = elt_content_type ($body); </td> </tr> <tr> <td class="h" > <a name="4271">4271</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (3, ' body_type from elt: ', $body_type); </td> </tr> <tr> <td class="h" > <a name="4272">4272</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $body_charset = 'utf-8'; </td> </tr> <tr> <td class="h" > <a name="4273">4273</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $body_base_url = App::RSS2Leafnode::XML::Twig::Other::elt_xml_base ($body); </td> </tr> <tr> <td class="h" > <a name="4274">4274</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4274-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! defined $body_type) { # no $body element at all </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-3"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-4"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#-5"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4275">4275</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $body = ''; </td> </tr> <tr> <td class="h" > <a name="4276">4276</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $body_type = 'text/plain'; </td> </tr> <tr> <td class="h" > <a name="4277">4277</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4278">4278</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($body_type eq 'xhtml') { # Atom </td> </tr> <tr> <td class="h" > <a name="4279">4279</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $body = elt_xhtml_to_html ($body); </td> </tr> <tr> <td class="h" > <a name="4280">4280</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $body_type = 'html'; </td> </tr> <tr> <td class="h" > <a name="4281">4281</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4282">4282</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($body_type eq 'html') { # RSS or Atom </td> </tr> <tr> <td class="h" > <a name="4283">4283</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $body = elt_subtext($body); </td> </tr> <tr> <td class="h" > <a name="4284">4284</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4285">4285</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($body_type eq 'text') { # Atom 'text' to be flowed </td> </tr> <tr> <td class="h" > <a name="4286">4286</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # should be text-only, no sub-elements, but extract sub-elements to </td> </tr> <tr> <td class="h" > <a name="4287">4287</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # cope with dodgy feeds with improperly escaped html etc </td> </tr> <tr> <td class="h" > <a name="4288">4288</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $body = $self->text_wrap (elt_subtext ($body)); </td> </tr> <tr> <td class="h" > <a name="4289">4289</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $body_type = 'text/plain'; </td> </tr> <tr> <td class="h" > <a name="4290">4290</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } elsif ($body_type =~ m{^text/}) { # Atom mime text type </td> </tr> <tr> <td class="h" > <a name="4291">4291</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $body = elt_subtext ($body); </td> </tr> <tr> <td class="h" > <a name="4292">4292</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4293">4293</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { # Atom base64 something </td> </tr> <tr> <td class="h" > <a name="4294">4294</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $body = MIME::Base64::decode ($body->text); </td> </tr> <tr> <td class="h" > <a name="4295">4295</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $body_charset = undef; </td> </tr> <tr> <td class="h" > <a name="4296">4296</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4297">4297</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#4297-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (3, " body: $body_type charset=", </td> </tr> <tr> <td class="h" > <a name="4298">4298</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $body_charset//'undef', "\n", </td> </tr> <tr> <td class="h" > <a name="4299">4299</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> "$body\n"); </td> </tr> <tr> <td class="h" > <a name="4300">4300</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4301">4301</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#4301-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $body_is_html = ($body_type eq 'html'|| $body_type eq 'text/html'); </td> </tr> <tr> <td class="h" > <a name="4302">4302</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#4302-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $links_want_html = ($body_is_html && ! $self->{'render'}); </td> </tr> <tr> <td class="h" > <a name="4303">4303</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4303-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (3, " links_want_html: ", </td> </tr> <tr> <td class="h" > <a name="4304">4304</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ($links_want_html ? "yes" : "no")); </td> </tr> <tr> <td class="h" > <a name="4305">4305</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4306">4306</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # sort downloadables to the start, then by "priority" </td> </tr> <tr> <td class="h" > <a name="4307">4307</a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td class="c3" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#4307-1"> 1 </a> </td> <td >   </td> <td > 1208 </td> <td class="s"> use sort 'stable'; </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 636 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c3" > 1 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td > 6 </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4308">4308</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4308-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#4308-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @links = sort {($b->{'download'}||0) <=> ($a->{'download'}||0) </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-3"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-4"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4309">4309</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> || ($b->{'priority'}||0) <=> ($a->{'priority'}||0)} </td> </tr> <tr> <td class="h" > <a name="4310">4310</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @links; </td> </tr> <tr> <td class="h" > <a name="4311">4311</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4311-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $links_str = ($links_want_html </td> </tr> <tr> <td class="h" > <a name="4312">4312</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ? links_to_html(@links) </td> </tr> <tr> <td class="h" > <a name="4313">4313</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> : links_to_text(@links)); </td> </tr> <tr> <td class="h" > <a name="4314">4314</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $links_str .= $self->item_common_alert_protocol($item, $links_want_html); </td> </tr> <tr> <td class="h" > <a name="4315">4315</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my @parts; </td> </tr> <tr> <td class="h" > <a name="4316">4316</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4317">4317</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <media:group> elements as either a html part or in the text links </td> </tr> <tr> <td class="h" > <a name="4318">4318</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> { </td> </tr> <tr> <td class="h" > <a name="4319">4319</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $content = join ("\n", </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4320">4320</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> map {$self->media_group_to_html($_)} </td> </tr> <tr> <td class="h" > <a name="4321">4321</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $item->children('media:group')); </td> </tr> <tr> <td class="h" > <a name="4322">4322</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4322-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (is_non_empty($content)) { </td> </tr> <tr> <td class="h" > <a name="4323">4323</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ($content, my $charset) = html_wrap_fragment ($item, $content); </td> </tr> <tr> <td class="h" > <a name="4324">4324</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $content_type = 'text/html'; </td> </tr> <tr> <td class="h" > <a name="4325">4325</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ($content, $content_type, $charset, my $rendered) </td> </tr> <tr> <td class="h" > <a name="4326">4326</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> = $self->render_maybe ($content, $content_type, $charset, </td> </tr> <tr> <td class="h" > <a name="4327">4327</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $body_base_url); </td> </tr> <tr> <td class="h" > <a name="4328">4328</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### media group content: $content </td> </tr> <tr> <td class="h" > <a name="4329">4329</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4329-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($content_type eq 'text/plain') { </td> </tr> <tr> <td class="h" > <a name="4330">4330</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $links_str .= $content; </td> </tr> <tr> <td class="h" > <a name="4331">4331</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="4332">4332</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $content = Encode::encode ($charset, $content); </td> </tr> <tr> <td class="h" > <a name="4333">4333</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> push @parts, $self->mime_build ({}, # headers </td> </tr> <tr> <td class="h" > <a name="4334">4334</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Type => $content_type, </td> </tr> <tr> <td class="h" > <a name="4335">4335</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Charset => $charset, </td> </tr> <tr> <td class="h" > <a name="4336">4336</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Data => $content); </td> </tr> <tr> <td class="h" > <a name="4337">4337</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4338">4338</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4339">4339</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4340">4340</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4341">4341</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4341-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (is_non_empty(my $content </td> </tr> <tr> <td class="h" > <a name="4342">4342</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> = $self->item_unknowns($item, $links_want_html))) { </td> </tr> <tr> <td class="h" > <a name="4343">4343</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4343-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $content_type = ($links_want_html ? 'text/html' : 'text/plain'); </td> </tr> <tr> <td class="h" > <a name="4344">4344</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4344-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (@parts) { </td> </tr> <tr> <td class="h" > <a name="4345">4345</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4345-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $charset = (is_ascii($content) ? 'us-ascii' : 'utf-8'); </td> </tr> <tr> <td class="h" > <a name="4346">4346</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $content = Encode::encode ($charset, $content); </td> </tr> <tr> <td class="h" > <a name="4347">4347</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> push @parts, $self->mime_build ({}, # headers </td> </tr> <tr> <td class="h" > <a name="4348">4348</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Type => $content_type, </td> </tr> <tr> <td class="h" > <a name="4349">4349</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Charset => $charset, </td> </tr> <tr> <td class="h" > <a name="4350">4350</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Data => $content); </td> </tr> <tr> <td class="h" > <a name="4351">4351</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="4352">4352</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $links_str .= $content; </td> </tr> <tr> <td class="h" > <a name="4353">4353</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4354">4354</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4355">4355</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4356">4356</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4356-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($self->{'rss_get_links'}) { </td> </tr> <tr> <td class="h" > <a name="4357">4357</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $l (@links) { </td> </tr> <tr> <td class="h" > <a name="4358">4358</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4358-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> next if ! $l->{'download'}; </td> </tr> <tr> <td class="h" > <a name="4359">4359</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $url = $l->{'uri'}; </td> </tr> <tr> <td class="h" > <a name="4360">4360</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (1, ' ', __x('link: "{name}" {url}', </td> </tr> <tr> <td class="h" > <a name="4361">4361</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> name => $l->{'name'}, </td> </tr> <tr> <td class="h" > <a name="4362">4362</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> url => $url)); </td> </tr> <tr> <td class="h" > <a name="4363">4363</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require HTTP::Request; </td> </tr> <tr> <td class="h" > <a name="4364">4364</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $req = HTTP::Request->new (GET => $url); </td> </tr> <tr> <td class="h" > <a name="4365">4365</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $resp = $self->ua->request($req); </td> </tr> <tr> <td class="h" > <a name="4366">4366</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $resp = $self->aireview_follow ($url, $resp); </td> </tr> <tr> <td class="h" > <a name="4367">4367</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4368">4368</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4368-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! $resp->is_success) { </td> </tr> <tr> <td class="h" > <a name="4369">4369</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> print __x("rss2leafnode: {url}\n {status}\n", </td> </tr> <tr> <td class="h" > <a name="4370">4370</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> url => $l->{'uri'}, </td> </tr> <tr> <td class="h" > <a name="4371">4371</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> status => $resp->status_line); </td> </tr> <tr> <td class="h" > <a name="4372">4372</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $msg = __x("Cannot download link {url}\n {status}", </td> </tr> <tr> <td class="h" > <a name="4373">4373</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> url => $l->{'uri'}, </td> </tr> <tr> <td class="h" > <a name="4374">4374</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> status => $resp->status_line); </td> </tr> <tr> <td class="h" > <a name="4375">4375</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4375-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($links_want_html) { </td> </tr> <tr> <td class="h" > <a name="4376">4376</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $msg = $Entitize{$msg}; </td> </tr> <tr> <td class="h" > <a name="4377">4377</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $msg =~ s/\n/<br>/; </td> </tr> <tr> <td class="h" > <a name="4378">4378</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $links_str .= "<p> $msg\n</p>\n"; </td> </tr> <tr> <td class="h" > <a name="4379">4379</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="4380">4380</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $links_str .= "\n$msg\n"; </td> </tr> <tr> <td class="h" > <a name="4381">4381</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4382">4382</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> next; </td> </tr> <tr> <td class="h" > <a name="4383">4383</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4384">4384</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4385">4385</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # suspect little value in a description when inlined </td> </tr> <tr> <td class="h" > <a name="4386">4386</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # 'Content-Description:' => mimewords_non_ascii($l->{'title'}) </td> </tr> <tr> <td class="h" > <a name="4387">4387</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # favicon used for Face if nothing in the item </td> </tr> <tr> <td class="h" > <a name="4388">4388</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="4389">4389</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->enforce_html_charset_from_content ($resp); </td> </tr> <tr> <td class="h" > <a name="4390">4390</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#4390-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $headers{'Face:'} ||= $self->http_resp_to_face($resp); </td> </tr> <tr> <td class="h" > <a name="4391">4391</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->http_resp_extract_main($resp); </td> </tr> <tr> <td class="h" > <a name="4392">4392</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> push @parts, $self->mime_part_from_response($resp); </td> </tr> <tr> <td class="h" > <a name="4393">4393</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4394">4394</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4395">4395</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4395-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#4395-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($links_want_html && $body_type eq 'html') { </td> </tr> <tr> <td class="h" > <a name="4396">4396</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # append to html fragment </td> </tr> <tr> <td class="h" > <a name="4397">4397</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $body .= $links_str; </td> </tr> <tr> <td class="h" > <a name="4398">4398</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> undef $links_str; </td> </tr> <tr> <td class="h" > <a name="4399">4399</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4400">4400</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4401">4401</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4401-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($body_type eq 'html') { </td> </tr> <tr> <td class="h" > <a name="4402">4402</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ($body, $body_charset) = html_wrap_fragment ($item, $body, $language); </td> </tr> <tr> <td class="h" > <a name="4403">4403</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $body_type = 'text/html'; </td> </tr> <tr> <td class="h" > <a name="4404">4404</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4405">4405</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4405-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined $body_charset) { </td> </tr> <tr> <td class="h" > <a name="4406">4406</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $body = Encode::encode ($body_charset, $body); </td> </tr> <tr> <td class="h" > <a name="4407">4407</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4408">4408</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4409">4409</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ($body, $body_type, $body_charset) </td> </tr> <tr> <td class="h" > <a name="4410">4410</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> = $self->render_maybe ($body, $body_type, $body_charset, $body_base_url); </td> </tr> <tr> <td class="h" > <a name="4411">4411</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4412">4412</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4412-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($body_type eq 'text/plain') { </td> </tr> <tr> <td class="h" > <a name="4413">4413</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # remove trailing whitespace from any text </td> </tr> <tr> <td class="h" > <a name="4414">4414</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $body =~ s/\s+$//; </td> </tr> <tr> <td class="h" > <a name="4415">4415</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $body .= "\n"; </td> </tr> <tr> <td class="h" > <a name="4416">4416</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4417">4417</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4417-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! $links_want_html) { </td> </tr> <tr> <td class="h" > <a name="4418">4418</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # append to text/plain, either atom type=text or rendered html </td> </tr> <tr> <td class="h" > <a name="4419">4419</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4419-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> unless (is_empty ($links_str)) { </td> </tr> <tr> <td class="h" > <a name="4420">4420</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $links_str = Encode::encode ($body_charset, $links_str); </td> </tr> <tr> <td class="h" > <a name="4421">4421</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $body .= "\n$links_str\n"; </td> </tr> <tr> <td class="h" > <a name="4422">4422</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4423">4423</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> undef $links_str; </td> </tr> <tr> <td class="h" > <a name="4424">4424</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4425">4425</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4426">4426</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4427">4427</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4427-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> unless (is_empty ($links_str)) { </td> </tr> <tr> <td class="h" > <a name="4428">4428</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $links_type; </td> </tr> <tr> <td class="h" > <a name="4429">4429</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $links_charset; </td> </tr> <tr> <td class="h" > <a name="4430">4430</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4430-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($links_want_html) { </td> </tr> <tr> <td class="h" > <a name="4431">4431</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $links_type = 'text/html'; </td> </tr> <tr> <td class="h" > <a name="4432">4432</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ($links_str, $links_charset) = html_wrap_fragment ($item, $links_str); </td> </tr> <tr> <td class="h" > <a name="4433">4433</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="4434">4434</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $links_type = 'text/plain'; </td> </tr> <tr> <td class="h" > <a name="4435">4435</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4435-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $links_charset = (is_ascii($links_str) ? 'us-ascii' : 'utf-8'); </td> </tr> <tr> <td class="h" > <a name="4436">4436</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4437">4437</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $links_str = Encode::encode ($links_charset, $links_str); </td> </tr> <tr> <td class="h" > <a name="4438">4438</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> unshift @parts, $self->mime_build ({}, </td> </tr> <tr> <td class="h" > <a name="4439">4439</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Type => $links_type, </td> </tr> <tr> <td class="h" > <a name="4440">4440</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Encoding => $links_charset, </td> </tr> <tr> <td class="h" > <a name="4441">4441</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Data => $links_str); </td> </tr> <tr> <td class="h" > <a name="4442">4442</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4443">4443</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4444">4444</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4445">4445</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $top = $self->mime_build (\%headers, </td> </tr> <tr> <td class="h" > <a name="4446">4446</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Top => 1, </td> </tr> <tr> <td class="h" > <a name="4447">4447</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Type => $body_type, </td> </tr> <tr> <td class="h" > <a name="4448">4448</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Charset => $body_charset, </td> </tr> <tr> <td class="h" > <a name="4449">4449</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Data => $body); </td> </tr> <tr> <td class="h" > <a name="4450">4450</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4451">4451</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Atom <content> of a non-text type </td> </tr> <tr> <td class="h" > <a name="4452">4452</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4452-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($attach_elt) { </td> </tr> <tr> <td class="h" > <a name="4453">4453</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # ENHANCE-ME: this decodes base64 from the xml and then re-encodes for </td> </tr> <tr> <td class="h" > <a name="4454">4454</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # the mime, is it possible to pass straight in? </td> </tr> <tr> <td class="h" > <a name="4455">4455</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#4455-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> unshift @parts, $self->mime_build </td> </tr> <tr> <td class="h" > <a name="4456">4456</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ({ 'Content-Location:' => $self->{'uri'}->as_string }, </td> </tr> <tr> <td class="h" > <a name="4457">4457</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Type => scalar ($attach_elt->att('atom:type') </td> </tr> <tr> <td class="h" > <a name="4458">4458</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // $attach_elt->att('type')), </td> </tr> <tr> <td class="h" > <a name="4459">4459</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Encoding => 'base64', </td> </tr> <tr> <td class="h" > <a name="4460">4460</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Data => MIME::Base64::decode($attach_elt->text)); </td> </tr> <tr> <td class="h" > <a name="4461">4461</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4462">4462</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4463">4463</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, 'parts count: ',scalar(@parts)); </td> </tr> <tr> <td class="h" > <a name="4464">4464</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $part (@parts) { </td> </tr> <tr> <td class="h" > <a name="4465">4465</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $top->make_multipart; </td> </tr> <tr> <td class="h" > <a name="4466">4466</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $top->add_part ($part); </td> </tr> <tr> <td class="h" > <a name="4467">4467</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4468">4468</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4469">4469</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> mime_entity_lines($top); </td> </tr> <tr> <td class="h" > <a name="4470">4470</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4470-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->nntp_post($top) || return 0; </td> </tr> <tr> <td class="h" > <a name="4471">4471</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (1, ' ', __('posted')); </td> </tr> <tr> <td class="h" > <a name="4472">4472</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $new++; </td> </tr> <tr> <td class="h" > <a name="4473">4473</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4474">4474</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4475">4475</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # ENHANCE-ME: check the replies count to see if more to fetch </td> </tr> <tr> <td class="h" > <a name="4476">4476</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4476-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($self->{'rss_get_comments'}) { </td> </tr> <tr> <td class="h" > <a name="4477">4477</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my ($comments_rss_url, $comments_count) </td> </tr> <tr> <td class="h" > <a name="4478">4478</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> = $self->item_to_comments_rss($item); </td> </tr> <tr> <td class="h" > <a name="4479">4479</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ### rss_get_comments: $comments_rss_url, $comments_count </td> </tr> <tr> <td class="h" > <a name="4480">4480</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4480-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined $comments_rss_url) { </td> </tr> <tr> <td class="h" > <a name="4481">4481</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4482">4482</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # ENHANCE-ME: There's also a thr:updated in RFC 4685, but haven't seen </td> </tr> <tr> <td class="h" > <a name="4483">4483</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # that ever actually used. </td> </tr> <tr> <td class="h" > <a name="4484">4484</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $status = $self->status_geturl ($comments_rss_url); </td> </tr> <tr> <td class="h" > <a name="4485">4485</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4485-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#4485-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined $status->{'comments_count'} </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4486">4486</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> && defined $comments_count </td> </tr> <tr> <td class="h" > <a name="4487">4487</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> && $status->{'comments_count'} == $comments_count) { </td> </tr> <tr> <td class="h" > <a name="4488">4488</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (1, ' ', __x('comments count unchanged: {count}', </td> </tr> <tr> <td class="h" > <a name="4489">4489</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> count => $comments_count)); </td> </tr> <tr> <td class="h" > <a name="4490">4490</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4491">4491</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="4492">4492</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local $self->{'rss_get_links'} = 0; </td> </tr> <tr> <td class="h" > <a name="4493">4493</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local $self->{'rss_get_comments'} = 0; </td> </tr> <tr> <td class="h" > <a name="4494">4494</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local $self->{'comments_count'} = $comments_count; </td> </tr> <tr> <td class="h" > <a name="4495">4495</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # "Re:" is not translated, variants of that are very annoying </td> </tr> <tr> <td class="h" > <a name="4496">4496</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local $self->{'getting_rss_comments'} = "Re: $subject"; </td> </tr> <tr> <td class="h" > <a name="4497">4497</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local $self->{'References:'} = $msgid; </td> </tr> <tr> <td class="h" > <a name="4498">4498</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $new += fetch_rss ($self, $self->{'nntp_group'}, $comments_rss_url); </td> </tr> <tr> <td class="h" > <a name="4499">4499</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4500">4500</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4501">4501</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4502">4502</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $new; </td> </tr> <tr> <td class="h" > <a name="4503">4503</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4504">4504</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4505">4505</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub item_to_comments_rss { </td> </tr> <tr> <td class="h" > <a name="4506">4506</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#4506-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#4506-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $item) = @_; </td> </tr> <tr> <td class="h" > <a name="4507">4507</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my ($url, $url_elt); </td> </tr> <tr> <td class="h" > <a name="4508">4508</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4509">4509</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # Atom <link rel='replies' type='application/atom+xml' </td> </tr> <tr> <td class="h" > <a name="4510">4510</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # href='http:/...' /> </td> </tr> <tr> <td class="h" > <a name="4511">4511</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $elt ($item->children('link')) { </td> </tr> <tr> <td class="h" > <a name="4512">4512</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#4512-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $rel = ($elt->att('rel') </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4513">4513</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // $elt->att('atom:rel') </td> </tr> <tr> <td class="h" > <a name="4514">4514</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // next); </td> </tr> <tr> <td class="h" > <a name="4515">4515</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4515-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $rel eq 'replies' or next; </td> </tr> <tr> <td class="h" > <a name="4516">4516</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4516-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->atom_link_is_rss($elt) or next; </td> </tr> <tr> <td class="h" > <a name="4517">4517</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#4517-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $href = ($elt->att('href') </td> </tr> <tr> <td class="h" > <a name="4518">4518</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // $elt->att('atom:href')); </td> </tr> <tr> <td class="h" > <a name="4519">4519</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4519-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (is_non_empty ($href)) { </td> </tr> <tr> <td class="h" > <a name="4520">4520</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $url = $href; </td> </tr> <tr> <td class="h" > <a name="4521">4521</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $elt = $url_elt; </td> </tr> <tr> <td class="h" > <a name="4522">4522</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4523">4523</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4524">4524</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4525">4525</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <wfw:commentRss>http://...</wfw:commentRss> </td> </tr> <tr> <td class="h" > <a name="4526">4526</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # it appeared in the spec page as wfw:commentRSS, so ignore case </td> </tr> <tr> <td class="h" > <a name="4527">4527</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4527-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! defined $url) { </td> </tr> <tr> <td class="h" > <a name="4528">4528</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $u = $item->first_child_trimmed_text (qr/^wfw:commentRss$/i); </td> </tr> <tr> <td class="h" > <a name="4529">4529</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4529-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (is_non_empty ($u)) { </td> </tr> <tr> <td class="h" > <a name="4530">4530</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $url = $u; </td> </tr> <tr> <td class="h" > <a name="4531">4531</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4532">4532</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4533">4533</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4534">4534</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#4534-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return ($url, </td> </tr> <tr> <td class="h" > <a name="4535">4535</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (defined($url) && $self->item_elt_comments_count($item,$url_elt))); </td> </tr> <tr> <td class="h" > <a name="4536">4536</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4537">4537</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4538">4538</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # <jf:replyCount> is merely informational about how many other <item>s there </td> </tr> <tr> <td class="h" > <a name="4539">4539</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # are which are replies, there's no comments link as such for it to refer </td> </tr> <tr> <td class="h" > <a name="4540">4540</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # to, it seems </td> </tr> <tr> <td class="h" > <a name="4541">4541</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub item_elt_comments_count { </td> </tr> <tr> <td class="h" > <a name="4542">4542</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#4542-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#4542-1"> 0 </a> </td> <td >   </td> <td class="s"> my ($self, $item, $elt) = @_; </td> </tr> <tr> <td class="h" > <a name="4543">4543</a> </td> <td class="c0" > 0 </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#4543-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return (($elt && $elt->att('thr:count')) </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-2"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-3"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-4"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-5"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-6"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a > </a> </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#-7"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4544">4544</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // ($elt && $elt->att('count')) </td> </tr> <tr> <td class="h" > <a name="4545">4545</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // ($elt && $elt->att('atom:count')) </td> </tr> <tr> <td class="h" > <a name="4546">4546</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // non_empty ($item->first_child_trimmed_text('thr:total')) </td> </tr> <tr> <td class="h" > <a name="4547">4547</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> // non_empty ($item->first_child_trimmed_text('slash:comments'))); </td> </tr> <tr> <td class="h" > <a name="4548">4548</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4549">4549</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @known{qw(/channel/item/jf:replyCount </td> </tr> <tr> <td class="h" > <a name="4550">4550</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> )} = (); </td> </tr> <tr> <td class="h" > <a name="4551">4551</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4552">4552</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $group is a string, the name of a local newsgroup </td> </tr> <tr> <td class="h" > <a name="4553">4553</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $url is a string, an RSS feed to be read </td> </tr> <tr> <td class="h" > <a name="4554">4554</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # </td> </tr> <tr> <td class="h" > <a name="4555">4555</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> sub fetch_rss { </td> </tr> <tr> <td class="h" > <a name="4556">4556</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#4556-1"> 0 </a> </td> <td class="c3" > <a href="blib-lib-App-RSS2Leafnode-pm--subroutine.html#4556-1"> 1 </a> </td> <td >   </td> <td class="s"> my ($self, $group, $url, %options) = @_; </td> </tr> <tr> <td class="h" > <a name="4557">4557</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local @{$self}{keys %options} = values %options; # hash slice </td> </tr> <tr> <td class="h" > <a > </a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4558">4558</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, "fetch_rss: $group $url"); </td> </tr> <tr> <td class="h" > <a name="4559">4559</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4560">4560</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $group_uri = URI->new($group,'news'); </td> </tr> <tr> <td class="h" > <a name="4561">4561</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local $self->{'nntp_host'} = uri_to_nntp_host ($group_uri); </td> </tr> <tr> <td class="h" > <a name="4562">4562</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local $self->{'nntp_group'} = $group = $group_uri->group; </td> </tr> <tr> <td class="h" > <a name="4563">4563</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4563-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->nntp_group_check($group) or return 0; </td> </tr> <tr> <td class="h" > <a name="4564">4564</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4565">4565</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # an in-memory cookie jar, used only per-RSS feed and then discarded, </td> </tr> <tr> <td class="h" > <a name="4566">4566</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # which means only kept for fetching for $self->{'rss_get_links'} from a </td> </tr> <tr> <td class="h" > <a name="4567">4567</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # feed </td> </tr> <tr> <td class="h" > <a name="4568">4568</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->ua->cookie_jar({}); </td> </tr> <tr> <td class="h" > <a name="4569">4569</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4570">4570</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4570-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined $self->{'getting_rss_comments'}) { </td> </tr> <tr> <td class="h" > <a name="4571">4571</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (1, ' ', __x('rss comments: {url}', url => $url)); </td> </tr> <tr> <td class="h" > <a name="4572">4572</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="4573">4573</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (1, __x('feed: {url}', url => $url)); </td> </tr> <tr> <td class="h" > <a name="4574">4574</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4575">4575</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require HTTP::Request; </td> </tr> <tr> <td class="h" > <a name="4576">4576</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $req = HTTP::Request->new (GET => $url); </td> </tr> <tr> <td class="h" > <a name="4577">4577</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4577-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->status_etagmod_req($req,1) || return 0; </td> </tr> <tr> <td class="h" > <a name="4578">4578</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4579">4579</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # $req->uri can be a URI object or a string </td> </tr> <tr> <td class="h" > <a name="4580">4580</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local $self->{'uri'} = URI->new ($req->uri); </td> </tr> <tr> <td class="h" > <a name="4581">4581</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4582">4582</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $resp = $self->ua->request($req); </td> </tr> <tr> <td class="h" > <a name="4583">4583</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4583-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($resp->code == 304) { </td> </tr> <tr> <td class="h" > <a name="4584">4584</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->status_unchanged ($url); </td> </tr> <tr> <td class="h" > <a name="4585">4585</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 0; </td> </tr> <tr> <td class="h" > <a name="4586">4586</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4587">4587</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4587-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (! $resp->is_success) { </td> </tr> <tr> <td class="h" > <a name="4588">4588</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> print __x("rss2leafnode: {url}\n {status}\n", </td> </tr> <tr> <td class="h" > <a name="4589">4589</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> url => $url, </td> </tr> <tr> <td class="h" > <a name="4590">4590</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> status => $resp->status_line); </td> </tr> <tr> <td class="h" > <a name="4591">4591</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 0; </td> </tr> <tr> <td class="h" > <a name="4592">4592</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4593">4593</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> local $self->{'resp'} = $resp; </td> </tr> <tr> <td class="h" > <a name="4594">4594</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4595">4595</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (3, "response:", $resp->dump, "\n"); # extra newline </td> </tr> <tr> <td class="h" > <a name="4596">4596</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4596-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $resp->decode </td> </tr> <tr> <td class="h" > <a name="4597">4597</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> or die "Oops, cannot decode Content-Encoding: ", </td> </tr> <tr> <td class="h" > <a name="4598">4598</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->header("Content-Encoding"); </td> </tr> <tr> <td class="h" > <a name="4599">4599</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4600">4600</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $xml = $resp->content; # raw bytes </td> </tr> <tr> <td class="h" > <a name="4601">4601</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $xml = $self->enforce_rss_charset_override ($xml); </td> </tr> <tr> <td class="h" > <a name="4602">4602</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4603">4603</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my ($twig, $err) = $self->twig_parse($xml); </td> </tr> <tr> <td class="h" > <a name="4604">4604</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4604-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if (defined $err) { </td> </tr> <tr> <td class="h" > <a name="4605">4605</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $message = __x("XML::Twig parse error on\n\n {url}\n\n", </td> </tr> <tr> <td class="h" > <a name="4606">4606</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> url => $url); </td> </tr> <tr> <td class="h" > <a name="4607">4607</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4607-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($resp->request->uri ne $url) { </td> </tr> <tr> <td class="h" > <a name="4608">4608</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $message .= __x("which redirected to\n\n {url}\n\n", </td> </tr> <tr> <td class="h" > <a name="4609">4609</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> url => $resp->request->uri); </td> </tr> <tr> <td class="h" > <a name="4610">4610</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4611">4611</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $message .= $err . "\n\n" . __("Raw XML below.\n") . "\n"; </td> </tr> <tr> <td class="h" > <a name="4612">4612</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->error_message </td> </tr> <tr> <td class="h" > <a name="4613">4613</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> (__x("Error parsing {url}", url => $url), </td> </tr> <tr> <td class="h" > <a name="4614">4614</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $message, $xml); </td> </tr> <tr> <td class="h" > <a name="4615">4615</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # after successful error message to news </td> </tr> <tr> <td class="h" > <a name="4616">4616</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->status_etagmod_resp ($url, $resp); </td> </tr> <tr> <td class="h" > <a name="4617">4617</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return 0; </td> </tr> <tr> <td class="h" > <a name="4618">4618</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4619">4619</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4619-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($self->{'verbose'} >= 3) { </td> </tr> <tr> <td class="h" > <a name="4620">4620</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> require Data::Dumper; </td> </tr> <tr> <td class="h" > <a name="4621">4621</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (3, </td> </tr> <tr> <td class="h" > <a name="4622">4622</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> Data::Dumper->new([$twig->root],['root']) </td> </tr> <tr> <td class="h" > <a name="4623">4623</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> ->Indent(1)->Sortkeys(1)->Dump); </td> </tr> <tr> <td class="h" > <a name="4624">4624</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4625">4625</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4626">4626</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> # "item" for RSS/RDF, "entry" for Atom </td> </tr> <tr> <td class="h" > <a name="4627">4627</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my @items = $twig->descendants(qr/^(item|entry)$/); </td> </tr> <tr> <td class="h" > <a name="4628">4628</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4629">4629</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> @items = $self->rss_newest_only_items(@items); </td> </tr> <tr> <td class="h" > <a name="4630">4630</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4631">4631</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $new = 0; </td> </tr> <tr> <td class="h" > <a name="4632">4632</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> foreach my $item (@items) { </td> </tr> <tr> <td class="h" > <a name="4633">4633</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $new += $self->fetch_rss_process_one_item ($item); </td> </tr> <tr> <td class="h" > <a name="4634">4634</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4635">4635</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4636">4636</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4636-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($self->{'verbose'} >= 2) { </td> </tr> <tr> <td class="h" > <a name="4637">4637</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> my $jar = $self->ua->cookie_jar; </td> </tr> <tr> <td class="h" > <a name="4638">4638</a> </td> <td class="c0" > 0 </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--branch.html#4638-1"> 0 </a> </td> <td class="c0" > <a href="blib-lib-App-RSS2Leafnode-pm--condition.html#4638-1"> 0 </a> </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> if ($jar && (my $str = $jar->as_string ne '')) { </td> </tr> <tr> <td class="h" > <a name="4639">4639</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, "accumulated cookies from this feed:\n", $str); </td> </tr> <tr> <td class="h" > <a name="4640">4640</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } else { </td> </tr> <tr> <td class="h" > <a name="4641">4641</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->verbose (2, 'no cookies from this feed'); </td> </tr> <tr> <td class="h" > <a name="4642">4642</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4643">4643</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4644">4644</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->ua->cookie_jar (undef); </td> </tr> <tr> <td class="h" > <a name="4645">4645</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4646">4646</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $self->status_etagmod_resp ($url, $resp, $twig); </td> </tr> <tr> <td class="h" > <a name="4647">4647</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> say __xn('{group}: {count} new article', </td> </tr> <tr> <td class="h" > <a name="4648">4648</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> '{group}: {count} new articles', </td> </tr> <tr> <td class="h" > <a name="4649">4649</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> $new, </td> </tr> <tr> <td class="h" > <a name="4650">4650</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> group => $group, </td> </tr> <tr> <td class="h" > <a name="4651">4651</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> count => $new); </td> </tr> <tr> <td class="h" > <a name="4652">4652</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4653">4653</a> </td> <td class="c0" > 0 </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> return $new; </td> </tr> <tr> <td class="h" > <a name="4654">4654</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> } </td> </tr> <tr> <td class="h" > <a name="4655">4655</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s">   </td> </tr> <tr> <td class="h" > <a name="4656">4656</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> 1; </td> </tr> <tr> <td class="h" > <a name="4657">4657</a> </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td >   </td> <td class="s"> __END__ </td> </tr> </table> </body> </html>