Pagination in feeds like ATOM and RSS?

23,423

Solution 1

It appears that ATOM allows the following syntax (first Google result for 'ATOM feed next/previous'):

<link rel="self" type="application/atom+xml" href="http://www.syfyportal.com/atomFeed.php?page=3"/>
<link rel="first" href="http://www.syfyportal.com/atomFeed.php"/>
<link rel="next" href="http://www.syfyportal.com/atomFeed.php?page=4"/>
<link rel="previous" href="http://www.syfyportal.com/atomFeed.php?page=2"/>
<link rel="last" href="http://www.syfyportal.com/atomFeed.php?page=147"/>

I can't find anything on RSS, but as it's called "really simple syndication" I'd imagine such functionality is outside its scope.

Solution 2

This is defined in RFC 5005, Feed Paging and Archiving, section 3.

You can use first, previous, next and last as a link relation:

<link rel="next" href="http://example.org/index.atom?page=2"/>

An additional "type" attribute is not needed.

Share:
23,423
Admin
Author by

Admin

Updated on May 07, 2020

Comments

  • Admin
    Admin about 4 years

    Is this even possible?

    Perhaps?

    <link rel=“next” type=“application/atom+xml” href=”[//path/page2]”></link> 
    
  • panzi
    panzi over 11 years
    RSS also stands for RDF Site Summary. ;) There are lots of differences between RSS 1.0 and 2.0 (there actually different standards, not really different versions).
  • Knowleech
    Knowleech over 7 years
    Actually, it is even recommended to use the <atom:link>s in RSS 2 feeds: validator.w3.org/feed/docs/warning/MissingAtomSelfLink.html
  • Sergey Ponomarev
    Sergey Ponomarev about 4 years
    This is implemented in blogspot.com feed altogether with opensearch tag that shows total count. Unfortunately not all rss readers supports this yet but hope this is a matter of time