atom_feed

Versions
6
atom_feed()

Produces an atom 1.0 feed for the front page content.

Code

contributions/atom/atom.module, line 112

<?php
function atom_feed() {
  if (strpos(arg(2), 'atom') === 0 || strpos(arg(2), 'feed') === 0) {
    die(drupal_not_found());
  }
  global $base_url;
  $nodes = db_query_range("SELECT n.nid FROM {node} n WHERE n.promote = '1' AND n.status = '1' ORDER BY n.created DESC", 0, variable_get('atom_feed_entries', 15));

  $feed_info = array();
  $feed_info['title']    = strip_tags(variable_get('site_name', 'Drupal'));
  $feed_info['subtitle'] = strip_tags(variable_get('site_slogan', ''));
  $feed_info['html_url'] = $base_url;
  $feed_info['atom_url'] = url('atom/feed', array('absolute' => TRUE));
  _atom_print_feed($nodes, $feed_info);
}
?>