Google Reader API sortid 和firstitemmsec
我不太明白非官方 Google Reader API 返回的“sortid”和“firstitemmsec”的含义?不知何故,这些值在 Google Reader Web 应用程序中正确使用。如何在我自己的应用程序中使用这些值?
{
categories = (
{
id = "user/16966160118879564357/label/iPhone";
label = "iPhone";
}
);
firstitemmsec = 1292000756920;
id = "feed/http://apple.com/feed/";
sortid = DF48A396;
title = apple.com;
}
I am not quite understand the meaning of "sortid" and "firstitemmsec" returned by the unofficial Google Reader API? Somehow, these values are used correctly in Google Reader web application. How do I make use of these values in my own application?
{
categories = (
{
id = "user/16966160118879564357/label/iPhone";
label = "iPhone";
}
);
firstitemmsec = 1292000756920;
id = "feed/http://apple.com/feed/";
sortid = DF48A396;
title = apple.com;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当用户订阅源时,其中最近 10 个项目(或过去 30 天内的项目,以项目较少者为准)被视为该用户未读。应被视为未读的最旧项目的时间戳(自纪元以来以毫秒为单位)存储在firstotemmsec中。当从 feed 请求未读项目时,Reader 会传入 max(now - 30 天,firstitemmsec) 作为“ot”(可接受的最旧时间戳)参数,以便后端不会比旧项目查找更多内容。
sortid 用于维护自定义订阅/文件夹排序。在http://www.google.com/reader/api/0 /preference/stream/list API 响应有一个“排序”首选项,它由该文件夹中项目的串联 sortid 组成(该文件夹中但未出现在“排序”列表中的项目附在最后)。
例如,我有一个“tech”文件夹,其中包含 3 个订阅:MacRumors、Ars Technica 和 Hacker News。它的“订购”首选项为“B2E0248117996C269955C28D”。每个排序 ID 都是 8 个字符,因此可以将其拆分为排序 ID“B2E02481”、“17996C26”和“9955C28D”。如果您维护从排序 ID 到订阅的映射,则可以在其中查找这些 ID 以了解以什么顺序显示它们。
When a user subscribes to a feed, the most recent 10 items in it (or items in the past 30 days, whichever results in fewer items) are considered unread for that user. The timestamp (in milliseconds since epoch) of the oldest item that should be considered unread is stored in firstotemmsec. When requesting unread items from a feed, Reader passes in max(now - 30 days, firstitemmsec) as the "ot" (oldest timestamp acceptable) parameter, so that the backend doesn't look any further than that for older items.
sortid is used to maintain custom subscription/folder ordering. In the http://www.google.com/reader/api/0/preference/stream/list API response there is an "ordering" pref, which is composed of concatenated sortids of the items in that folder (items that are in that folder but don't appear in the "ordering" list are appended to the end).
For example, I have a "tech" folder that has 3 subscriptions in it, MacRumors, Ars Technica, and Hacker News. It has an "ordering" pref of "B2E0248117996C269955C28D". Sort IDs are 8 characters each, so this can be split to the sort IDs "B2E02481", "17996C26", and "9955C28D". If you maintain a map from sort ID to subscription, you can look up those IDs in it to know what order to display them in.