aggr allows you to place the contents of an RSS feed into your pages or posts. It is a deeply modified version of the Aggregate plugin of Rob Miller (I also used an idea of Michael Jolley).

To install and use it, download the zip file (latest release: 1.1), extract aggr.php, upload this to your wp-content/plugins/ directory, activate the plugin in WordPress.

To use it, add one or more lines to your page or post like
<!--rss url="http://perassi.org/feed/"-->

If you need a widgetized version, try aggrw.

ChangeLog:

  • Version 1.1 (2007-12-10): it adds $item_count and $title_length with code closer to what suggested by Scott;
  • Version 1.0b (2007-09-03): it fixes a small typo;
  • Version 1.0 (2007-07-07): first release.

80 Responses to “aggr”


  1. 1 sindhu

    been looking for this! :) thanks will try out

  2. 2 Laundro

    I cant get this to work in my sidebar. Is this allowed?

    Thanks!

  3. 3 Carlo

    Hello Laundro.
    This plugin is designed to live inside a page or post, not in the sidebar (it is not a widget plugin) so the answer is no, it is not allowed.

  4. 4 BigNerd

    Hi. Plug in worked without a hitch. Thanks and nice job. I’m testing it within a ‘page’ currently. The Wordpress community appreciates your efforts.

  5. 5 latest news

    very nice plug in for news related blogs thanks

  6. 6 Carlo

    @BigNerd, @latest:
    thank you all. :)

  7. 7 Thomas

    I installed and activated the plugin, then created a new Page with the line as the only thing in the page.

    The error message I get is:

    Warning: array_slice(): The first argument should be an array in .../wp-content/plugins/aggr.php on line 34

    What do you suppose went wrong?

    Thanks,
    Thomas

  8. 8 Carlo

    @Thomas:
    try without the “code” tag: just a simple comment like
    <!–rss url=”http://perassi.org/feed/”–>

  9. 9 Thomas

    I just used the code tag in the comment on this page. I see that you have your example of a feed using an http address, but most of the feeds I’ve seen have a URL of feed://examplefeed.com, does that make a difference?

  10. 10 Carlo

    @Thomas:
    feeds are over http:// try with http:// instead of feed://

  11. 11 Thomas

    Some feeds work like that, but not all. I guess it depends on the way the feeder site sets it up.

    Thanks! This is the perfect plugin for what we’re trying to do.
    ~Thomas

  12. 12 Carlo

    @Thomas:
    good… if you find it useful, consider putting a link to the plugin page somewhere.
    Thanks.

  13. 13 Shawn Honnick

    Getting many line numbers with:
    Warning: Invalid argument supplied for foreach() in

    (then, the path and line number)

    Comment feeds seem to work. I have tried this with a couple of different feeds.

  14. 14 Carlo

    @Shawn: I didn’t get that warnings of that kind… could you please give me (by email) the feeds that give you problems? Don’t forget to put the ending “/” when the feed name is like http://sitename/path/feed/

  15. 15 Shawn Honnick

    As it turns out, it was another plugin that caused the errors. Here’s your plugin displaying output of shawnblog.com RSS to my main site, shawnhonnick.com

    http://www.shawnhonnick.com/shawnblog/

  16. 16 Carlo

    @Shawn: good!

  17. 17 joe

    Can I control how many RSS entries are displayed? i.e., display all posts from the last 7 days?

  18. 18 Carlo

    @joe:
    changing line 34 from $items = array_slice($feed->items, 0); to $items = array_slice($feed->items, 0, 7); will let you see, for a given feed, its last 7 entries. This is not what you want but it is the only way to control the number of displayed items I know you can use, without changing extensively the way that the feeds are fetched/processed.

  19. 19 Manfred

    I do have problems with german umlauts eg ä,ö,ü,ß. My Wordpress version is 2.2.1 and under reading options is UTF-8 activated. I made a testing section under “test” on my blog. There you can see theat german umlauts are not displayed, only “?”. Many thanks for your help and greetings from Austria, Manfred

  20. 20 Carlo

    Manfred:
    I think that your problem is outside your WordPress settings (Apache? PHP?) because on my test page
    http://perassi.org/p/test/ (no more available)
    you can see the same feed (the first one is another German feed I added because it also contains some umlauts) without problems.
    Greetings from Italy. :)

  21. 21 Jon Bings

    Hi Carlo,

    seems the feeds dont show up on my posts or pages.. i tried to use your example.but all i have is a black page except for the title..

    is there anything that ive missed?.

  22. 22 Jon Bings

    sorry it should be a blank white page with the title of the page only..

  23. 23 Carlo

    Jon: Ok, fine. :)

  24. 24 Scott Stout

    I took what Carlo said above, made the count a variable, and also added a variable to limit the amount of characters that are printed per title.

    so my get_rss function looks like this:

    function get_rss($url) {
        include_once (ABSPATH . WPINC . '/rss.php');
        define("MAGPIE_OUTPUT_ENCODING", "UTF-8");
    
        $item_count = 10;
        $title_length = 40;
        $feed = fetch_rss($url);
        $items = array_slice($feed->items, 0, $item_count);
        $channel = $feed->channel;
        $feed_contents = '';
    
        if (!empty($channel)) {
            $feed_contents .= '' . $channel['title'] . “\n”;
        }
    
        if (!empty($items)) {
            $feed_contents .= “\n”;
            $feed_contents .= “\n”;
            foreach ($items as $item) {
                $feed_contents .= ” . substr($item['title'], 0, $title_length);
                $feed_contents .= “\n”;
            }
            $feed_contents .= “\n”;
        }
    
        return $feed_contents;
    }
    
  25. 25 Carlo

    Scott: good. I’ve just edited a bit your code to let WordPress show it better… when I got a minute, I’ll study your changes maybe for the next release of aggr. Thanks.

  26. 26 david

    I love the plugin, Also I twisted it a lil as somo of the commenters taught it, but there is a little problem, I cant use it directly in my sidebar… how I do that???

  27. 27 Carlo

    david: sorry, your comment was waiting in the spam box. Anyway, aggr is not a widget plugin so it can’t be placed on a sidebar… maybe I’ll write a widgetized version of it.

  28. 28 Scott Stout

    Seems the latest svn update has broken aggr, most likely they are doing some strange caching now of the magpie data… will look into it and see if there is an easy fix.

  29. 29 Carlo

    Scott: thank you! I wasn’t aware of this change: I’ll look at it ASAP. Thanks again.

  30. 30 Carlo

    Scott: it seems that the problem you reported was fixed before 2.3.1 because aggr works fine with the brand new release.

  31. 31 Scott Stout

    Yeah I am thinking it may be something I did while playing around. RSS feeds are displayed, just not being updated.

  32. 32 Carlo

    Hello.
    This comment helps me to let the subscribers know that I’ve just released
    http://perassi.org/p/aggrw/
    which is a widgetized version of aggr.

  33. 33 Yadgar

    High!

    I just discovered your plugin on the WordPress Plugin Database… my primary question is: can I use aggr to combine several RSS feeds belonging to the same category to one feed, and all of these “multi-feeds” once more to one single pool of news, from which the 20 or 30 most recent ones are displayed on the frontpage, ordered by date?

    See you in Khyberspace!

    Yadgar

  34. 34 Carlo

    Yadgar: you can, on a given page, show any reasonable number of feeds and, using $item_count, you can even decide how many posts - for a given feed - your page will show… so the answer to your question is “yes, mostly” (it won’t be exactly like what you’ve just described). aggr can work pretty well aggregating feeds on a page - and I’m sure you’ll find it quite useful - but it is not like a planet software.

  35. 35 Adrian

    Would be good to be able to put into post template…

  36. 36 Carlo

    Adrian: I’ve never tried to put it inside a template… it shouldn’t be hard though. I could study your idea. Thanks.

  37. 37 Pete

    Hi,

    I installed this in the plugins and activated it. When i placed a feed on a post it came up blank with a “Feeds listed by aggr”. I tried multiple feeds, but none worked. I am on Wordpress Version 2.3.2, any ideas? Thanks

  38. 38 Carlo

    Pete: old feeds, maybe? Try with my feed or a feed with recent news on it.

  39. 39 clyd

    Hi,
    this is excellent, would it be possible to display an excerpt of each topic ( say mabye around 100 characters of each topic below the links)

    Regards!

  40. 40 Carlo

    dyd: yes, it is possible. I don’t remember the name of the field in the associative array but it is possible, of course.

  41. 41 Joy

    My feeds page was working till about 6 months ago– now i get an error message. I work on a Mac and when I try to download the zip file, it doesn’t seem to be working. Any ideas?
    Thanks!
    Joy

  42. 42 Carlo

    Joy: I’m sorry but it’s quite hard to guess the reason of your problem. You could tell me more (even by email).

  43. 43 ОбозревателЬ

    В плагине отображаются только заголовки, но иногда хочется, чтобы показывались и описания новостей.
    Немного попробовал изменить плагин aggr чтобы он показывал и описание новостей.
    Посмотрите здесь - http://live.amorg.ru/?page_id=1709#comment-122
    Может стоит включить такую возможность в новый релиз плагина?

  44. 44 Carlo

    ОбозревателЬ: I don’t speak Russian (is that Russian?) but I’ve understood your changes creating a diff file from my version against yours. I could provide some sort of localization in the future… :)

  45. 45 ОбозревателЬ

    it’s Russian :)

    sometimes you want to show not only the headlines, but news and description.
    I tried to change.
    This in turn may release?

  46. 46 Carlo

    ОбозревателЬ: do you mean if your changes may be integrated in a future release of aggr? I can’t exclude it but first I should add an interface to it to add/remove options for its output.

  47. 47 Alberto

    @carlo: complimenti per il plugin.
    Se voglio richiamare la funzione all’interno di un tema, anziché di un articolo o una pagina, come la devo richiamare?

  48. 48 Carlo

    Alberto: non so se sia sufficiente per le tue esigenze ma potresti provare ad usare aggrw (la versione widget di aggr), vedi http://perassi.org/p/aggrw/

  49. 49 angela

    Hi there

    This might be what I want … only way to find out is to get it running and see. But I am failing at the moment.

    In the last couple of days I’ve only just started with rss. So far I have created a load of pipes in yahoo. I can insert these into webpages I create as I have some javascript in the head which controls the format of the output. Then in the body area I put some more javascript that runs the rss feed from my pipe.

    I can’t work out in pipes where I get the url that aggr needs/wants. So far I’ve tried a couple of things and nothing shows up on my blog post. I have checked and my pipe does have results.

    I have specifically tried two things. From my pipes page:
    1] clicked on my pipe so it was showing, then near the top grabbed the url where it said “pipe web address”
    2] Clicked on the orange rss icon in the “use this feed” area and got “get as rss”

    I have tried both these and nothing displays in the post.

    With [2] above, I was posting this, exactly, into the code window of where you write a post:

    Any clues what I might be doing wrong?
    Thanks.

  50. 50 Carlo

    angela: your “inline test” page doesn’t show any feeds. Its source shows a comment that says you used an inline feed (plugin?) written by kruyt. I didn’t understand everything you wrote.
    Perhaps:
    1 - if it is compatible with your requirements, try to use aggr alone and follow the instructions at the beginning of this page;
    2 - a better (simpler and shorter) description of your problem (step-by-step) might help… even privately, by email. :)

  51. 51 Eko

    I have this message.
    Warning: array_slice() [function.array-slice]: The first argument should be an array in /mnt/143/sda/8/3/rapport.eric/wp-content/plugins/aggr.php on line 39

    With your RSS feed, it works, but with some other, it doesn’t work.

    This is the feed : http://www.directetudiant.com/rss/rssAchat.asp

  52. 52 Alfie

    How do I aggregate multiple feeds? Is it allowed?

    Thanks.

  53. 53 Carlo

    Eko: let me investigate it. I’ll let you know.

  54. 54 Carlo

    Alfie: aggr doesn’t work like a planet so you can have many feeds in a single page simply repeating many times the call to aggr…
    in other words, write lines like
    <!--rss url="http://my.feed/one/"-->
    <!--rss url="http://my.feed/two/"-->
    <!--rss url="http://my.feed/three/"-->

  55. 55 Carlo

    Eko: the feed you’ve provided for your example doesn’t validate at http://validator.w3.org/feed/
    That could be one of the reasons of your problem.

  56. 56 Eko

    Argh crap !
    I’ll contact the website to validate his feed. Thanks for your support.
    But I don’t understand why, when I use one validated feed and one unvalidated feed (on the same page) it’s run ?!?!

    Nice plugin ;-)

  57. 57 Carlo

    Eko: I suppose that it happens because there are two independent calls of aggr on the same page (one calls a valid feed while the other calls an invalid one).

  58. 58 Shawn Honnick

    I’ve removed this from a few of my WP sites because it was not working with various feeds (one was from digg, another from google).

  59. 59 Carlo

    Shawn: aggr retrieves feeds using MagpieRSS (that is the standard RSS integration tool of WordPress) so if a feed can’t be fetched by aggr, it can hardly be correctly fetched by MagpieRSS and, AFAIK, by WordPress too.

  60. 60 Rapport de stage

    Thanks for your support. It’s a great plugin :)

  1. 1 BloggingPro China » WordPress Plugin: aggr
  2. 2 aggr Plugin » D’ Technology Weblog: Technology News & Reviews
  3. 3 DELETE YOURSELF! » Blog Archive » Полезные плагины для WordPress
  4. 4 macreloaded[dot]com - Blog Archive » Podcast Nr.16 - Online selbst/Podcast Toolbox/Kapselsuche
  5. 5   links for 2007-07-11 by SridhaReena
  6. 6 WP Plugins DB » Plugin Details » aggr
  7. 7 And He Blogs » links for 2007-07-18
  8. 8 Leesbril » Blog Archive » Nieuwe top sites van september 2nd tot september 3rd
  9. 9 Всё о WordPress » Архив блога » Полезные плагины для WordPress
  10. 10 Причины переезда « #от скуки
  11. 11 #моск » Blog Archive » Причины переезда
  12. 12 Points without Tangents » Blog Archive » Headlines back from the dead
  13. 13 Блог оптимистичного оптимизатора » Blog Archive » Причины переезда
  14. 14 Sim Blog » Blog Archive » 全面装备RSS Feed的19个Wordpress插件
  15. 15 全面裝備RSS Feed的19個Wordpress插件 | 童上瑋的部落
  16. 16 Elaborate | ARBU
  17. 17 Vitriol
  18. 18 全面装备RSS Feed的19个Wordpress插件 - 八宝饭
  19. 19 全面装备RSS Feed的19个Wordpress插件 at 第七封印
  20. 20 » Eighteenth-Century Audio: A WordPress Social Site? fragment

Leave a Reply