Hi I'm a bit stumped with duplication of items -

I am using an RSS feed from a simple Google news search.
And have a block created that correctly lists story titles as they come in.

My problem is I get duplicate stories all the time,

to fix this I click "remove items" , then "refresh"
and the duplicated items are gone.

Is there anyway to automate this process?

Or do I not have things set up correctly?
I am using a "feed" node not a lightweight item, (would that be better? )

-Also when I go to the node of the feed on my site
along the bottom of page I see the links
"News items" "feed items" and "link to site"

"news items" list my stories, but "feed items" goes to a fault page -
Is that a problem, and what are feed items?
I realise these questions may be a little basic but despite reading FeedAPI readme file
I am having trouble finding basic setup help anywhere.

running drupal 5
with Modules
FeedAPI
FeedAPI Aggregator
FeedAPI Inherit
FeedAPI Node Views
FeedAPI Node
SimplePie parser

Comments

fluxline’s picture

i would check the actual item that is duplicated. i have seen the same problem with ap feeds. the problem is syndication. ap provides stories to affiliates that also provide them with content. ap publishes an article with a title but the actual link will be from one of their syndicates so the id changes over time. i think this is to give their affiliate exposure. if you actually click on the different duplicates i think you will find that it actually changes where it goes. i've not actually looked at the google feed but you might check

when i was looking at the feedapi code i thought i saw that it was also checking on the title, but i've not checked back. something on my todo list.

scrubba’s picture

I agree fluxline - many of my feeds are the same title from a sydicated news outlet like AAP here in Australia and then all the other news services copy the story with the same title. not sure what can be done about that, but for some reason the duplicates disapear after remove items flush out and a refresh.

But i still feel there maybe a way of automating the "remove items" and then "refresh" using cron somehow?
Unfortunately I'm no programmer - but this seems theoretically simple enough.

fluxline’s picture

the only solution for now i see is to actually take the feed from one of the affiliates that pumps out the entire syndicated feed and tag it as coming from the syndicate, if you are tagging them. watch out, some affiliates seem to only take a subset.

i would prefer that the items never get created in the first place rather than creating and then removing, cron time should not be given out to added work. when i get a chance in a few weeks i will look into the title duplicate check and contribute what i come up with (unless the maintainers pipe in and say it's done or do it themselves), been awhile since i've coded anything fresh and never php so it should be interesting.

jacobw’s picture

This would be a very useful addition.

aron novak’s picture

Well, you need overrideable deduping logic. Currently this is FeedAPI's own job to decide what is duplicate and what's not.
To achieve a clean solution now you need to patch feedapi. This is not a good way to do, but the only one.

Büke Beyond’s picture

Aron I think you are onto something.

What if hook_feedapi_after_parse would assign/override a unique identification hash (md5) for every feed item?

This id hash can default to feed item guid, url and feed url, but can be custom overwritten to be just the feed item title, etc..

This hash can be used more robustly for all deduping and updating operations.

giorgio79’s picture

Thanks for these ideas, I just found this thread. I guess my feature request is somewhat related to this post so I post the link here, I hope it is ok.
http://drupal.org/node/349082

giorgio79’s picture

I marked that post as a duplicate of this one.

Is the function we need to play with the following?
hook_feedapi_after_parse

In my case, my feed has a field with a unique id, which I am storing as a CCK text field. I would be checking against this one for uniqueness. This is a simple SELECT query and php if else, but I wonder where is the best place to make this check.

alex_b’s picture

Status: Active » Closed (fixed)

Closing after an extended period of inactivity.