Parse atom feeds
Capnj - December 5, 2004 - 23:26
| Project: | Drupal |
| Version: | x.y.z |
| Component: | aggregator.module |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Prometheus6 |
| Status: | closed |
Description
I've seen mention elsewhere on drupal.org but don't see a feature request, so here goes.
The news aggregator is a great piece of Drupal as far as I'm concerned and I'd sure like to see it read all the sources out there, have the 'blog this' function, and also have a tool for browsers to generate a blog entry from a web page (like MT had).
Is that a big enough request? LOL
Thanks for all that everyone does here. Great stuff!
gil

#1
RSS 2.0 feeds should work in 4.5.0 and earlier.
#2
I've hacked Magpie support into the Drupal aggregator, so it can support Atom. If you have a Drupal site and want the code, you can get it from http://george.hotelling.net/projects/magpie-aggregator-4.5.2.tgz
I'm not sure if I'm supposed to create a patch or what, but I needed this for ArborBlogs.com and figured some other people would benefit from it.
#3
Very nice.
I hacked aggregator.module for 4.6 using your module as a guide...well, frankly by ripping out great chunks of code for my use.
#4
Can someone roll a patch for this? Would be a good addition for 4.7 now that Atom is at 1.0.
#5
A patch would require the Magpie include files and wholly restructures the way the feeds are parsed...the Magpie code would handle all the feeds, not just Atom.
That said, the attached zip file has the necessary includes and a patch to CVS.
#6
Magpie RSS duplicates a lot of functionality that is already in Drupal. We decided a long time ago that we would not use it. Porting Atom parsing into the current aggregator can't be that hard.
#7
Since I'm messing around with the aggregator module anyway...
I developed this around Atom 0.3 feeds this weekend, but I don't see anything in Atom 1.0 that should break it.
#8
+1 on that patch. Running it now on my test site and everything looks great.
#9
a small issue, whe do not use
if ($data) $items[$item][$tag] .= $data;please just use
if ($data) {$items[$item][$tag] .= $data;
}
#10
Not a problem. Here's the corrections.
#11
If this is all it takes to parse Atom feeds (to some extend), I'm all for it. Code looks OK. Set to 'ready to be committed' after some testing.
#12
anybody up for a testing suite tests? http://intertwingly.net/wiki/pie/FormatTests
#13
That would be for the Atom module.
#14
Because the aggregator would always gather enough information todownload an Atom feed, the previous patch focused on parsing items/entries correctly.
This patch adds more complete parsing of the feed's channel data (site link, subtitle/description, logo). Now all the feed and item fields will be properly updated.
#15
The content of the Atom feed's id and info tags were being displayed as part of the feed's description on the aggregator pages. With this patch those tags are recognized and discarded.
The "blog it" link is also added to the aggregator page items in addition to the block.
#16
Let's try that with the patch this time...
#17
Committed a partial patch. Left out the 'blog it' stuff for now but committed the parsing part. The 'blog it' stuff needs more review and testing.
#18
Okay. Just to let you know, I added the blog it link because of this conversation.
http://drupal.org/node/10752
I'll make a patch tonight just for the blog it feature, so this item can be closed if you like.
#19
Atom feeds have a CONTENT and/or SUMMARY tag instead of a DESCRIPTION tag. Currently, if both tags are present the aggregator appends the content of both fields to replace the content of the DESCRIPTION tag. This patch uses the CONTENT tag OR the SUMMARY tag.
#20
#21
I'm confused; is this applied to HEAD, or not? My latest installation of HEAD does not handle Atom feeds, so if it is in there, it is broken.
#22
The title isn't being picked up so the items aren't being saved....I'll look at it today.
#23
Here's a correction. I'll explain it if I have to...I'm a little sleepy at the moment.
#24
Committed to HEAD. Thanks.
#25
#26
#27
Hey,
I know this issue is closed, but just as a convenience for people still on 4.6 who want to get at the feature, I've applied all three of these patches to a default 4.6.5 install and made a single, combined patch that works against 4.6.5 out of it.
Cheers,
Ben Weintraub