SourceForge has been redesigned. Learn more.
Close

Atom Feed

2010-12-21
2013-06-03
  • nabber00

    nabber00 - 2010-12-22

    So I can safely just switch the two without any other changes to the existing XML?

     
  • John Keisers

    John Keisers - 2010-12-22

    I tried that, but then the images didn't show up in the parsed feed. Apparently, switching is not the only thing. I'll look at. I already made some changes to the RSS 2.0 feed, because not everything validated.

    The blog uses Atom 0.3. The current version is 1.0.

    For Atom I used the following validator: http://validator.w3.org/feed/
    and for for RSS: http://feedvalidator.org/

     
  • John Keisers

    John Keisers - 2010-12-31

    This produces valid Atom 1.0:

    header('Content-type: application/xml');
    echo "<?xml version=\"1.0\" encoding=\"" . $lang_string[ 'php_charset' ] . "\"?>\n";
    echo "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n";
    echo "\t<title>" . clean_atom_output( $blog_config[ 'blog_title' ] ) . "</title>\n";
    echo "\t<link href=\"" . $base_url . "atom.php\" rel=\"self\" />\n";
    echo "\t<link href=\"" . $base_url . "\" />\n";
    echo "\t<id>".  $base_url . "index.php</id>\n";
    echo "\t<updated>" . gmdate( 'Y-m-d' ) . 'T' . gmdate( 'H:i:s' ) . "Z</updated>\n";
    echo "\t<author>\n";
    echo "\t\t<name>" . clean_atom_output( $blog_config[ 'blog_author' ] ) . "</name>\n";
    echo "\t\t<email>" . clean_atom_output( $blog_config[ 'blog_email' ] ) . "</email>\n";
    echo "\t</author>\n";
    

    And for the entries:

    echo "\t<entry>\n";
    echo "\t\t<title>" . clean_atom_output( blog_to_html( $contents[ 'SUBJECT' ], false, false ) ) . "</title>\n";
    echo "\t\t<link href=\"" . $base_url . "index.php?entry=" . sb_strip_extension( $entry_filename ) . "\" />\n";
    echo "\t\t<link rel=\"alternate\" type=\"text/html\" href=\"" . $base_url . "index.php?entry=" . sb_strip_extension( $entry_filename ) . "\" />\n";
    echo "\t\t<link rel=\"edit\" href=\"" . $base_url . "index.php?entry=" . sb_strip_extension( $entry_filename ) . "\" />\n";
    echo "\t\t<id>" . $base_url . "index.php?entry=" . sb_strip_extension( $entry_filename ) . "</id>\n";
    echo "\t\t<summary type=\"html\"><![CDATA[" . replace_more_tag( blog_to_html( $contents[ 'CONTENT' ], false, false ), true, '' ) . $content_footer . "]]></summary>\n";
    echo "\t\t<updated>" . gmdate( 'Y-m-d', $contents[ 'DATE' ] ) . 'T' . gmdate( 'H:i:s', $contents[ 'DATE' ] ) . "Z</updated>\n";
    echo "\t</entry>\n";
    [/code}
    Please see: http://www.kamya.com/blog/atom.php
    
     
  • nabber00

    nabber00 - 2011-01-01

    Thanks!  I just checked in Atom 1.0 for the next release.

     

Log in to post a comment.