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

drumm - December 7, 2004 - 17:38
Title:Parse 2.0 and atom feeds, please???» Parse atom feeds

RSS 2.0 feeds should work in 4.5.0 and earlier.

#2

georgehotelling - February 14, 2005 - 16:04

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

Prometheus6 - March 15, 2005 - 04:04

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.

AttachmentSize
AGGREGATOR_ATOM_HEAD.txt 5.46 KB

#4

Boris Mann - July 28, 2005 - 22:21
Version:<none>» x.y.z

Can someone roll a patch for this? Would be a good addition for 4.7 now that Atom is at 1.0.

#5

Prometheus6 - July 29, 2005 - 01:49
Status:active» needs review

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.

AttachmentSize
magpie_aggregator.zip 7.87 KB

#6

Steven - July 29, 2005 - 03:36
Status:needs review» active

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

Prometheus6 - August 1, 2005 - 16:38
Assigned to:Anonymous» Prometheus6
Status:active» needs review

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.

AttachmentSize
AGGREGATOR_ATOM_HEAD_0.txt 1.93 KB

#8

eaton - August 2, 2005 - 15:00

+1 on that patch. Running it now on my test site and everything looks great.

#9

Bèr Kessels - August 2, 2005 - 16:24
Status:needs review» needs work

a small issue, whe do not use
if ($data) $items[$item][$tag] .= $data;
please just use

if ($data) {
  $items[$item][$tag] .= $data;
}

#10

Prometheus6 - August 3, 2005 - 02:18
Status:needs work» needs review

Not a problem. Here's the corrections.

AttachmentSize
AGGREGATOR_ATOM_HEAD_1.txt 1.99 KB

#11

Dries - August 3, 2005 - 16:14

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

kika - August 3, 2005 - 18:59

anybody up for a testing suite tests? http://intertwingly.net/wiki/pie/FormatTests

#13

Prometheus6 - August 3, 2005 - 20:07

That would be for the Atom module.

#14

Prometheus6 - August 3, 2005 - 23:36

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.

AttachmentSize
AGGREGATOR_ATOM_CVS.txt 2.35 KB

#15

Prometheus6 - August 8, 2005 - 16:00

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

Prometheus6 - August 8, 2005 - 16:01

Let's try that with the patch this time...

AttachmentSize
AGGREGATOR_ATOM_CVS_0.txt 3.69 KB

#17

Dries - August 11, 2005 - 13:13

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

Prometheus6 - August 11, 2005 - 15:35

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

Prometheus6 - August 22, 2005 - 23:37

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.

AttachmentSize
AGGREGATOR_ATOM_CVS2.txt 1.13 KB

#20

Dries - August 23, 2005 - 05:17
Status:needs review» fixed

#21

robertDouglass - August 31, 2005 - 09:04

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

Prometheus6 - August 31, 2005 - 10:18

The title isn't being picked up so the items aren't being saved....I'll look at it today.

#23

Prometheus6 - August 31, 2005 - 13:24
Status:fixed» needs review

Here's a correction. I'll explain it if I have to...I'm a little sleepy at the moment.

AttachmentSize
AGGREGATOR_ATOM_CVS3.txt 926 bytes

#24

Dries - September 8, 2005 - 20:09
Status:needs review» fixed

Committed to HEAD. Thanks.

#25

Anonymous - September 22, 2005 - 20:30

#26

Prometheus6 - October 2, 2005 - 05:01
Version:x.y.z» 4.6.3
Status:fixed» closed

#27

benwei - January 26, 2006 - 07:23

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

AttachmentSize
aggregator-4.6.5-atom.patch 4.14 KB
 
 

Drupal is a registered trademark of Dries Buytaert.