Subject: | Atom 1.0 feeds: uniq_item |
As far as I can see, uniq_item should (at least for Atom 1.0 feeds, I
haven't looked at any other spec) be unique by id and not by its link
attribute (especially since the link attribute is optional in Atom 1.0
and id is not.)
cheers
-- vbi
# HG changeset patch
# User avbidder@fortytwo.ch
# Date 1208258767 -7200
# Node ID 2f91438567b62d9a39e9fc6f717c1bca71900c31
# Parent f14f4473e5b3efc91d85a6b693dbc8062bbb8ed0
Atom 1.0: Articles should be unique by id, not by the link attribute.
diff -r f14f4473e5b3 -r 2f91438567b6 lib/XML/FeedPP.pm
--- a/lib/XML/FeedPP.pm Tue Apr 15 13:26:07 2008 +0200
+++ b/lib/XML/FeedPP.pm Tue Apr 15 13:26:07 2008 +0200
@@ -1429,8 +1429,8 @@
my $check = {};
my $uniq = [];
foreach my $item (@$list) {
- my $link = $item->link();
- push( @$uniq, $item ) unless $check->{$link}++;
+ my $id = $item->guid();
+ push( @$uniq, $item ) unless $check->{$id}++;
}
@$list = @$uniq;
}
bi