Some RSS feeds (diveintomark, Scripting News, Jason Kottke) have no
<link> tag for their individual items. Instead, they use a <guid>.
This trivial patch against the latest CVS version makes AmphetaDesk
use the <guid> if it exists and the <link> doesn't. I supposed it
could check to make sure that the <guid> actually looks like a URL,
but I've yet to find a case when it's not.
Hopefully this list doesn't mangle attachments...
It's included after my signature just in case...
Jeremy
--
Jeremy D. Zawodny | Perl, Web, MySQL, Linux Magazine, Yahoo!
<Jeremy@...> | http://jeremy.zawodny.com/
Index: Channels.pm
===================================================================
RCS file: /cvsroot/amphetadesk/AmphetaDesk/lib/AmphetaDesk/Channels.pm,v
retrieving revision 1.18
diff -u -u -r1.18 Channels.pm
--- Channels.pm 24 Sep 2003 00:36:13 -0000 1.18
+++ Channels.pm 28 Nov 2003 04:20:55 -0000
@@ -172,6 +172,9 @@
undef $data->{channel}->{item}; # remove this hierarchy.
unless (ref $items_copy->{item} ne 'ARRAY') {
foreach my $item (@{$items_copy->{item}}) {
+ if (not defined $item->{link}) {
+ $item->{link} = $item->{guid} if $item->{guid};
+ }
push(@{$data->{item}}, $item);
}
}
@@ -260,4 +263,4 @@
=cut
-1;
\ No newline at end of file
+1;
|