? handbook_recent_updates.patch
? handbook_recent_updates_feed.patch
? blocks_and_nodes/aggregator_block_from_description.patch
Index: blocks_and_nodes/handbook.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/drupalorg/blocks_and_nodes/handbook.module,v
retrieving revision 1.8
diff -u -p -r1.8 handbook.module
--- blocks_and_nodes/handbook.module	17 Oct 2008 00:30:08 -0000	1.8
+++ blocks_and_nodes/handbook.module	17 Oct 2008 21:54:59 -0000
@@ -1,6 +1,19 @@
 <?php
 // $Id: handbook.module,v 1.8 2008/10/17 00:30:08 kbahey Exp $
 
+function handbook_menu($may_cache) {
+  if ($may_cache) {
+    $items[] = array(
+      'path' => 'handbook/recent-updates/feed', 
+      'title' => 'Feed of recent handbook updates',
+      'callback' => 'handbook_recent_updates_feed',
+      'access' => user_access('access content'),
+      'type' => MENU_CALLBACK,
+    );
+    return $items;
+  }
+}
+
 function handbook_nodeapi(&$node, $op = 'view', $teaser = FALSE, $page = FALSE) {
   if ($op == 'view' && $page) {
     $extra = '';
@@ -138,12 +151,17 @@ function handbook_revision_maintainers()
   return $output;
 }
 
-function handbook_recent_updates() {
-  $result = db_query_range("SELECT n.nid, n.title, n.changed, r.log, u.uid, u.name
+// Helper function so the recent updates and the feed use the same query.
+function _handbook_recent_updates_nodes($count) {
+  return db_query_range("SELECT n.nid, n.title, n.changed, r.log, u.uid, u.name
     FROM {node} n
     INNER JOIN {book} b ON n.vid = b.vid INNER JOIN {node_revisions} r ON n.vid = r.vid INNER JOIN {users} u ON u.uid = r.uid
     WHERE n.status = 1
-    ORDER BY n.changed DESC", 0, 50);
+    ORDER BY n.changed DESC", 0, $count);
+}
+
+function handbook_recent_updates() {
+  $result = _handbook_recent_updates_nodes('50');
 
   while ($page = db_fetch_object($result)) {
     $rows[] = array(
@@ -159,6 +177,19 @@ function handbook_recent_updates() {
   return $output;
 }
 
+function handbook_recent_updates_feed() {
+  $limit = variable_get('feed_default_items', 10);
+  $result = _handbook_recent_updates_nodes($limit);
+
+  $channel = array(
+    'title'       => variable_get('site_name', 'Drupal') .' - '. variable_get('site_slogan', ''),
+    'link'        => 'http://drupal.org/node/23192',
+    'description' => 'Recent updates to the handbook of drupal.org'
+  );
+  return node_feed($result, $channel);
+}
+
+
 function handbook_block($op = 'list', $delta = 0, $edit = array()) {
   switch ($op) {
     case 'list':
