Pagination in feeds like ATOM and RSS?

2019-01-22 18:03发布

Is this even possible?

Perhaps?

<link rel=“next” type=“application/atom+xml” href=”[//path/page2]”></link> 

2条回答
太酷不给撩
2楼-- · 2019-01-22 18:35

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.

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-01-22 18:58

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.

查看更多
登录 后发表回答