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_countand$title_lengthwith 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.
been looking for this!
thanks will try out
I cant get this to work in my sidebar. Is this allowed?
Thanks!
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.
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.
very nice plug in for news related blogs thanks
@BigNerd, @latest:
thank you all.
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 34What do you suppose went wrong?
Thanks,
Thomas
@Thomas:
try without the “code” tag: just a simple comment like
<!–rss url=”http://perassi.org/feed/”–>
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?
@Thomas:
feeds are over http:// try with http:// instead of feed://
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
@Thomas:
good… if you find it useful, consider putting a link to the plugin page somewhere.
Thanks.
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.
@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/
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/
@Shawn: good!
Can I control how many RSS entries are displayed? i.e., display all posts from the last 7 days?
@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.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
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.
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?.
sorry it should be a blank white page with the title of the page only..
Jon: Ok, fine.
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; }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.
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???
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.
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.
Scott: thank you! I wasn’t aware of this change: I’ll look at it ASAP. Thanks again.
Scott: it seems that the problem you reported was fixed before 2.3.1 because aggr works fine with the brand new release.
Yeah I am thinking it may be something I did while playing around. RSS feeds are displayed, just not being updated.
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.
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
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.Would be good to be able to put into post template…
Adrian: I’ve never tried to put it inside a template… it shouldn’t be hard though. I could study your idea. Thanks.
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
Pete: old feeds, maybe? Try with my feed or a feed with recent news on it.
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!
dyd: yes, it is possible. I don’t remember the name of the field in the associative array but it is possible, of course.
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
Joy: I’m sorry but it’s quite hard to guess the reason of your problem. You could tell me more (even by email).
В плагине отображаются только заголовки, но иногда хочется, чтобы показывались и описания новостей.
Немного попробовал изменить плагин aggr чтобы он показывал и описание новостей.
Посмотрите здесь - http://live.amorg.ru/?page_id=1709#comment-122
Может стоит включить такую возможность в новый релиз плагина?
ОбозревателЬ: 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…
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?
ОбозревателЬ: 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.
@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?
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/
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.
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.
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 39With your RSS feed, it works, but with some other, it doesn’t work.
This is the feed : http://www.directetudiant.com/rss/rssAchat.asp
How do I aggregate multiple feeds? Is it allowed?
Thanks.
Eko: let me investigate it. I’ll let you know.
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/"-->
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.
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
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).
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).
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.
Thanks for your support. It’s a great plugin