[drupal-devel] [feature] Add support for generating an RSS 0.92 feed of news aggregator items

Uwe Hermann drupal-devel at drupal.org
Sat Aug 27 16:59:09 UTC 2005


Issue status update for 
http://drupal.org/node/9167
Post a follow up: 
http://drupal.org/project/comments/add/9167

 Project:      Drupal
 Version:      cvs
 Component:    aggregator.module
 Category:     feature requests
 Priority:     normal
-Assigned to:  Anonymous
+Assigned to:  Uwe Hermann
 Reported by:  blake7
 Updated by:   Uwe Hermann
-Status:       patch (code needs work)
+Status:       patch (code needs review)
 Attachment:   http://drupal.org/files/issues/aggregator_rss_0.patch (4.77 KB)

OK, updated.




Uwe Hermann



Previous comments:
------------------------------------------------------------------------

Fri, 09 Jul 2004 04:11:13 +0000 : blake7

Attachment: http://drupal.org/files/issues/aggregator.module_0.patch (2.96 KB)

The attached patch adds support for generating an RSS 0.92 feed of the
default news aggregator page (the output of aggregator_page_last()).
This allows re-use of the Drupal aggregator in other RSS readers like
Trillian. 


The patch consists of the aggregator_page_rss() function which builds
the XML output needed. It uses the existing RSS building functions
already present to construct the feed.


Note the comment about how many items are in the feed. In Drupal 4.4.x,
there  was a variable "aggregator_page_limit" which represented how many
items were returned for both the HTML and RSS versions. It defaulted to
75 items. In Drupal CVS, all the HTML output is now paged through a
hard-coded limit of 20 items per page. A limit of 20 seems small for
the RSS feed, so I reverted to the old limit of 75. Would it be better
to add a new variable like "aggregator_rss_limit"?


Also, there are 2 places that the callback to aggregator_page_rss are
installed. One is in _aggregator_page_list right before the pager
output and shows up as the XML icon (like how the OPML feeds are linked
now). The other is in aggregator_menu where I try and install a menu
itme called "RSS feed". For some reason, the menu itme is not
displaying itself though I believe I am inserting it properly.


Feel free to contact me if there are any questions. Thanks!




------------------------------------------------------------------------

Fri, 09 Jul 2004 17:29:48 +0000 : blake7

Attachment: http://drupal.org/files/issues/aggregator.module_1.patch (2.54 KB)

Fixed the navigation menu problems mentioned above. Please consider this
patch instead of the first one.




------------------------------------------------------------------------

Fri, 09 Jul 2004 18:09:54 +0000 : drumm

When this functionality is added it should be able to generate feeds for
each aggregator category as well.




------------------------------------------------------------------------

Sat, 10 Jul 2004 01:22:31 +0000 : blake7

Attachment: http://drupal.org/files/issues/aggregator.module_2.patch (3.25 KB)

Done. The attached patch supports RSS feeds of each aggregator category
through the XML icon at the bottom exactly like the main aggregator
page.




------------------------------------------------------------------------

Sat, 10 Jul 2004 12:01:05 +0000 : Dries

1. $base_url . "/aggregator" . $url is incorrect.  All URLs must be
constructed using url() as it is aware of clean URLs and path aliasing.


2. Emitting 75 RSS items is quite much (uncommon) and can easily turn
into a bandwidth bottleneck.  Can we add one global setting that
controls how many entries our feed should have (not just the newly
introduced feeds)?  To 'export' your content in case you wish to
migrate to another tool, a special value 'all' (say '1000000') might be
handy.




------------------------------------------------------------------------

Fri, 17 Sep 2004 08:19:27 +0000 : blake7

Attachment: http://drupal.org/files/issues/aggregator.module_3.patch (4.47 KB)

1. Using url() now.


2. Added the presistent variable aggregator_rss_limit which controls
how many RSS items are generated. A form_select edit control to control
the new variable, with all defined as 1000000, was added to the
configure tab.


I am not sure what you mean by "our feeds" versus "newly introduced
feeds" in your comment. 


Also, even though the code-freeze has taken place, do you think it
would be possible to get this into Drupal 4.5? The code change is very
minimal and I believe the ability to share aggregated feeds is a great
feature.




------------------------------------------------------------------------

Fri, 17 Sep 2004 18:07:05 +0000 : Boris Mann

+1


I actually assumed (there was much discussion?) that the re-exporting
of aggregator items on a per-bundle basis was going to be enabled for
4.5.


Let's get this in before the code freeze -- this would be a major
feature announcement for 4.5, and could perform the basis for other
great functionality for 4.6 (e.g. per category OPML file generation).




------------------------------------------------------------------------

Fri, 22 Oct 2004 18:20:21 +0000 : blake7

Now that 4.5 has released. Can this go into CVS/HEAD? Is there any other
changes to the patch that need to be made by me to make that happen?


Thanks.




------------------------------------------------------------------------

Sat, 23 Oct 2004 18:05:33 +0000 : Dries

I'll look at it again.  Does the patch add XML-icons or how do people
find out about the RSS feeds?  Can't we make the URLs a bit more
intuitive?  For example by making it so that you merely have to append
'/rss.xml' to the aggregator module's URLs:


foo.com/aggregator/rss.xml
foo.com/aggregator/categories/1/rss.xmlIt is certainly not a
requirement, just a thought that might be worth considering.




------------------------------------------------------------------------

Sat, 23 Oct 2004 18:15:58 +0000 : Dries

I'll look at it again.  Does the patch add XML-icons or how do people
find out about the RSS feeds?  Can't we make the URLs a bit more
intuitive?  For example by making it so that you merely have to append
'/rss.xml' to the aggregator module's URLs:


foo.com/aggregator/rss.xml
foo.com/aggregator/categories/1/rss.xmlIt is certainly not a
requirement, just a thought that might be worth considering.




------------------------------------------------------------------------

Mon, 25 Oct 2004 10:50:27 +0000 : Bèr Kessels

cross linking to a [feature] that talks about such a unified rss link:
http://drupal.org/node/11937




------------------------------------------------------------------------

Wed, 09 Feb 2005 20:17:38 +0000 : sethcohn

Bump.


Neat feature, would be nice for 4.6


What's the progress on making it happen?




------------------------------------------------------------------------

Wed, 09 Feb 2005 20:43:59 +0000 : Boris Mann

Here's another bump to this. I would say since it missed 4.5 (and was
ready at the time) we get this in to 4.6.


Should mesh nicely with walkah's RSS updates.


Dries: there is an XML icon at the bottom of each category page, plus
the HTML header can include an alternate link to the feed. I vote
against any sort of "rss.xml", people can alias if they wish.


(ideally we could get per-category OPML links as well, but I'll leave
that for another feature request)




------------------------------------------------------------------------

Thu, 10 Feb 2005 14:58:47 +0000 : Bèr Kessels

A request for unification of feeds [1] is waiting in the queue already.
[1] http://drupal.org/node/11937




------------------------------------------------------------------------

Thu, 10 Feb 2005 15:23:47 +0000 : Boris Mann

This patch is not about "feed unification", it adds RSS feeds for
category bundles...which have been asked about (and coded for, here in
this patch) since 4.4.




------------------------------------------------------------------------

Mon, 28 Feb 2005 22:37:21 +0000 : playdreamer

Thrilled I found this as its the one killer feature that the aggregator
appeared to be missing. One point I notice though is that the title of
the generated feed is 'drupal', when presumably it should pick up
something along the lines of 'sitename news aggregator'.




------------------------------------------------------------------------

Tue, 01 Mar 2005 20:42:20 +0000 : Dries

In addition to the other suggestions, this patch should not use arg()
and should make the hardcoded string stranslatable.




------------------------------------------------------------------------

Fri, 11 Mar 2005 19:00:53 +0000 : deskpops

I'm trying to integrate Blake7's RSS creation code into my
aggregator.module, but I don't think I have the experience to do it
properly.  Has anyone created a complete aggregator.module that has
this already in it that I can just use to replace my current aggregator
module?  (I'm running 4.5.2)


Thanks in advance,
Jeff




------------------------------------------------------------------------

Tue, 12 Apr 2005 23:06:58 +0000 : Richard Eriksson

Attachment: http://drupal.org/files/issues/aggregator.module.bundle-feeds.patch.txt (4.53 KB)

The attached patch adds a bugfix in the title (changes it from a
hard-coded 'drupal' to a variable_get('site_name', 'drupal') and makes
the link element inside the channel a fully-qualifed URL using base_url
+ '/' then the path of the aggregator.  (It doesn't incorporate,
however, Dries suggestions for removing the args and translating the
hard-coded strings.)  This patch is based on the above patches.


Suggestions for future patches: +1 on Dries' suggestions, and add a
link element in the HTML header for RSS autodiscovery.




------------------------------------------------------------------------

Wed, 08 Jun 2005 19:02:55 +0000 : Michael Acord at www.simplemoneymanagement.info

Any idea how to get this to apply to drupal 4.6.1? The first chunk does
not patch, but chunks 2-4 do.




------------------------------------------------------------------------

Sat, 20 Aug 2005 02:00:22 +0000 : Uwe Hermann

Attachment: http://drupal.org/files/issues/aggregator_feed.patch (4.79 KB)

Here's an update for the patch from #18, rerolled for current HEAD.
Please test.




------------------------------------------------------------------------

Mon, 22 Aug 2005 20:59:09 +0000 : Dries

This patch needs some love:


- Use %d and %s directives in SQL queries.


- Remove the RSS items configuration option.  We don't have such
setting for node feeds either so this looks unbalanced.  It would be
nice to have some global RSS feed settings though, to control how many
items are syndicated, whether descriptions are to be provided, etc.


- The strings can not be translated.




------------------------------------------------------------------------

Sat, 27 Aug 2005 14:18:59 +0000 : Uwe Hermann

Attachment: http://drupal.org/files/issues/aggregator_rss.patch (4.72 KB)

Updated patch for HEAD. Hardcodes the number of feed items to 15 (as
with the normal Drupal feed) for now, I'll create another patch which
introduces site-wide feed customization options later. SQL queries use
%d and %s now. Replaced " with ' where possible.




------------------------------------------------------------------------

Sat, 27 Aug 2005 15:43:42 +0000 : Dries

Still not good enough:


- That t(' for ') needs to be fixed ... translators won't be able to do
anything with it.  They won't spot the spaces either.  At the very least
make it '%foo for %bar' or something, or just change the code so there
is nothing to translate.


- $item->title . t(' [').$item->ftitle.t(']') is hairy; impossible to
translate and ugly to look at in your aggregator.  I'd go with just
$item->title.


- . The leading space in t(' aggregator') needs fixing too ...


-  t('Drupal aggregator RSS feed') . $title is plain wrong: no space
between feed and $title.  Joe Average doesn't and shouldn't know what
Drupal is.







More information about the drupal-devel mailing list