Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon

Building a News Aggregating Site Using Drupal 6

Save for later
  • 4 min read
  • 14 Aug 2009

article-image

Weird Hap'nins requirements will be the need to:

  • Get external feed sources and allocate them to menu links on the web site
  • Create the means to automatically fetch and display article items located in the feeds
  • Display blocks of latest content from each feed source on the front page

Theme

The theme chosen is "Strange Little Town", which is a contributed theme that fits the description of this unique web site.

building-news-aggregating-site-using-drupal-6-2-img-0

Build Weird Hap'nins

Vaughan Pyre is a very ambitious webpreneur. What he really hopes for is a web site that is completely self-maintaining, and on which he can place some Google AdSense blocks. Clicks from the visitors to his site will ensure that he makes lots of money. For this, he needs a site where the content updates regularly with fresh content so that visitors will keep coming back to click on some more Google ads. Vaughan's ultimate objective is to create several of these web sites.

Modules

This is, surprisingly, a very simple site to build, and much of the requirements can be achieved by using the Core Aggregator module. Indeed, were it not for the fact that Vaughan needs the content to automatically update, we needn't use any module other than the Aggregator module.

Optional Core modules

We will be using the following Core modules, which can be enabled via the Modules page:

  • Aggregator—for aggregating syndicated content (RSS, RDF, and Atom feeds)

Contributed modules

We will also be using the following contributed modules from Drupal.org. Install, and enable them via the Modules page:

  • Poormanscron—internal scheduler for users without a cron application

Configure the Poormanscron module

First we need to enable the Poormanscron module, so that the incoming feeds will be able to self-refresh. From the Administer page, we will access the Poormanscron configuration page, mainly to set the time interval between runs of cron to update feed items, as shown in the following screenshot:

building-news-aggregating-site-using-drupal-6-2-img-1

In this case, we have left the Time intervals at the default value of 60 minutes.

Configure the Aggregator module

The Aggregator module should be configured to define the feed sources, how often they will be polled, and how they're categorized. For this, if we select the Feed aggregator link on the Administer page, then we should arrive at the following page:

Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at $19.99/month. Cancel anytime

building-news-aggregating-site-using-drupal-6-2-img-2

On the Settings page, we will define some more requirements, as follows:

  1. Allowed HTML tags—which are the tags that are embedded in the incoming feed that we want Drupal to accept. The allowed tags do not include image tags. So if any images are coming with the feed, then they will be excluded. However, we don't want this to happen, so we have added the image tag <img> to the list.
  2. Items shown in sources and categories pages—we have defined this to be 20 items, but you may select another figure.
  3. Discard items older than—we want the feed items to be completely refreshed every week so we have set this at 1 week.
  4. Category selection type—we are not categorizing the feeds, so we will leave this setting as it is.

building-news-aggregating-site-using-drupal-6-2-img-3

Basic content

The site is built around the Aggregator module, and no other Content type will need to be created. Vaughan has decided to initially use three feeds obtained from www.newsfeedmaker.com, as follows:

It is from these feeds that we will create the necessary content.

Tips and traps
An excellent source for "mashup" feeds on any topic is pipes.yahoo.com.

Add feeds

On the Add feeds page, which is under the Feed aggregator configuration page, we finally get to define our feeds, and how often we want them to be polled.

building-news-aggregating-site-using-drupal-6-2-img-4

We want our Bad News feed to be polled every hour, so we have configured it this way. The same procedure is followed to create the feeds for Crime and Paranormal.