Previously...
In Build An Aggregation Site With Drupal (Part 1) I covered setting up the foundation of your aggregation site using Drupal and SimpleFeed. In this second part I'll cover using cron to auto-update content, and then look at using views to create site sections and RSS feeds for our content.
Step 0: Before we start
There is currently one flaw in the SimpleFeed module which we need to correct before continuing. Sometimes taxonomy terms are not assigned automatically to aggregated items, which will stop our site from functioning properly. You can find a more detailed discussion about this issue here.
The good news is that it has been fixed in both the 5.x and 6.x branches and is easy for us to correct :)
Just download the new Drupal 5 version of the updated simplefeed_item.module file from CVS and save it over your current simplefeed_item.module file which you will find in your SimpleFeed module folder (sites/all/modules/simplefeed/simplefeed_item.module).
Step 1: Cron
Adding cron functionality to an aggregation site is pretty crucial because without it our content will not auto-update. We could technically update our feeds manually but that would be a very tedious process, so cron is definitely the way to go!
Cron works like so:
When it comes to cron on a Drupal site there are two obvious choices:
In this case, the demo aggregation site is set up on a VPS running Plesk which allows cron jobs to be created so we will use this option. However, not all web hosts allow the creation of cron jobs. If this is the case you can instead use the poormanscron module to schedule a cron job from within your site's admin panel (see the module's README file for an explanation).
Cron set up on Plesk
We will set a cron job up through Plesk to run once every hour on the fifth minute of the hour (remember to replace the 'mysite.com' part of the command URL with your site's URL), like so:

And that's it - cron should now regularly auto-update our content, so let's get to organising the content a little better with some site sections, and also adding our own RSS feeds, using the views module.
Step 2: Views
For our sports news site we'll create three views:
We'll also output an RSS feed for each view so that users can subscribe.
Adding a view
To set up a view first navigate to the main 'Administer views' page (admin/build/views).
You can add a view by either:

The SimpleFeed module does actually come packaged with a few default views (feeds, feeds_latest, and feeds_latest_block) which we could edit to get what we want, but I find it simpler to create the views I want from scratch.
For each of the views I'll provide both the import view code and a screenshot of the view's finished form options. I would suggest using the import view code first to actually create the view and then double checking that all of the view options look correct on the form in comparison to the screenshots below.
'Sports' view
To set up the front page 'sports' view:

If the import is successful you will be re-directed to the 'Add a View' page and should find that all of the 'sports' view options are already filled in, like so:

Scroll down to the bottom of the page and click 'Save'. Drupal will save the view and present you with a 'View successfully added' message. You will also see the new 'sports' view listed in the 'Existing Views' section:

Now do the same for the 'baseball' and 'football' views.
'Baseball' view
Import the baseball import view code the same way as we did with the sports import view code.
The 'baseball' view options should be as follows:

'Football' view
Again, import the football import view code the same way as we did with the sports import view code.
The 'football' view options should be as follows:

In each view we are using the taxonomy terms which we set up in part 1 to filter the news items in a section. We are also limiting the nodes in each section to just feed items, and we are sorting news items by showing the newest item first.
You should now see all three views listed in the 'Existing Views' section:

RSS:
One quick thing to note - the title for the RSS feeds is taken from the view's page title and the description is taken from the view's description field on the 'Add a View' page.
Step 3: Menu items
Lastly, we need to create some menu items for our new views site sections. To do so, navigate to main 'Menus' page (admin/build/menu) and click 'Add item' for the 'Primary Links' menu. This will take you to the 'Add menu item' subsection page (admin/build/menu/item/add/2).
We'll create the 'sports' home page link first using the following settings:

Now just do the same for the baseball and football menu items using the following settings:
Baseball:
Title - Baseball
Description - Baseball news
Path - baseball
Expanded - unchecked
Parent item - Primary links
Weight - 1
Football:
Title - Football
Description - Football news
Path - football
Expanded - unchecked
Parent item - Primary links
Weight - 1
This will give us three primary links, like so:

Step 4: Home page setting
Finally, we need to tell Drupal that we want to use the 'sports' view as our home page. So, to do this navigate to the 'Site information' page (admin/settings/site-information), scroll down to the bottom and change the 'Default front page' setting to sports, like so:

Finished (Part 2)
You should now see that the front page of your site contains our 'sports' view, and that the Baseball and Football sections contain our 'baseball' and 'football' views, respectively.
Furthermore, all three sections have their own RSS feed available for subscribers.
Also in this series
Build An Aggregation Site With Drupal (Part 1), where we set up the foundation of our aggregation site.
Coming soon...
Build An Aggregation Site With Drupal (Part 3), where we'll look at theming everything.
You can request the cron url from any computer, not just your web host.
Not optimal, but if you're stuck running on a host that doesn't allow cron, and you want another option besides poormanscron, any reliably connected computer would do.
Add a <!--break--> please somewhere because this way the whole article gets aggregated, thanks.
@ chx - yes, the post already contains a break. The reason the complete post gets aggregated is because I publish whole posts in my RSS feed.
Hi thanks for these wonderful tutorials. Very useful and nicely done.
Unfortunately I've been tearing my hair on taxonomy. The feed items still don't inherit the tags given to the parent feed. I'm using the same version of simple feed as you: 2.2. I've tried using the CVS version you've linked to and I've tired manually patching the file. Haven't been successful with both methods.
I'm using free tagging. I'm using drupal 5. I've made sure the vocabulary applies to feed items also. I've tried clearing the browser cache...basically tried a lot of stuff. Still the taxonomy does not appear in feed items.
Just hook up NewsBlocks with SimplePie and you can get something similar to this: http://www.alldevjobs.com/mb
The taxonomy is not working for me either. When feeds items are downloaded, it just doesn't assign them the right taxonomy.
The file in the CVS you mentioned is removed, so the link doesnt work anymore.
Any other way to get this working? Please help....
Laurence, Thanks a lot for your fine tutorial. I wish you all the success and happiness in life. It works hundred percent as you have made everything so clear and described each step vividly and not cursorily. I have learnt things from you and indebted to you now. I wish that you could also add a few more important details here like:
1. How to get full node content .., I mean full article, and not just one liner intro, in our feeds. Along with IMAGES and also possibly videos.
2. How can we show the feed on main feed page in such a way that on main feed /category page like Sports News it shows just Intro or Teaser and thumbnail of pics and on clicking the link it shows full content in our site only and not at source page.
I must add here that I applied your tutorial on Drupal 6 and it worked like a charm there as well. Thanks again and if possible, plz give me some helpful hints regarding those above things.