How to retrieve all starred items for one particular source?

145 views
Skip to first unread message

Dan Stark

unread,
Jul 12, 2011, 8:59:52 AM7/12/11
to Friends of the Unofficial Google Reader API
Hi all

I know how to retrieve all starred items for all items in one's
account

But my question is

how about for one particular source?

I know the xt parameter, but it is "exclude" and I don't know any
google-state as "unstarred".

Anyone can help?


Mihai Parparita

unread,
Jul 12, 2011, 9:59:53 PM7/12/11
to foug...@googlegroups.com
Hi Dan,

There is no direct way to do this. The most efficient way from the Reader backend's perspective is to compute the intersection using item IDs; something like:


Items that are both starred and in the passed in feed (http://googleblog.blogspot.com/atom.xml in this case) will have both streams in their directStreamIds:
{"id":"-54920593598378833","directStreamIds":["user/08173477664906626377/state/com.google/starred","feed/http://googleblog.blogspot.com/atom.xml"],"timestampUsec":"1310522203998795"}
Ones that are starred but not in the feed or vice-versa will only have one direct stream ID.

Once you have the collection of item IDs that interest you, you can fetch their contents using a request like http://www.google.com/reader/api/0/stream/items/contents?i=1386864356855952360&i=4747583500102276781.

These two pages explain more about how to use these API endpoints:

Mihai

Dan Stark

unread,
Jul 13, 2011, 5:26:26 AM7/13/11
to foug...@googlegroups.com
Hi mihai

Crystal clear. thanks

Dan

Dan Stark

unread,
Aug 1, 2011, 5:17:10 AM8/1/11
to foug...@googlegroups.com
Hi Mihai

Thanks for your post. I have tried your way, but I have some questions.

You suggested doing like this:


using StreamItemsIds to get items from both the feed and the starred label.

So the returning 1000 items are either from the feed or having the starred label or both. right?

If I have, say, 10K starred items. Because the n=1000, it might be the case that in the 1000 items, there are no starred items from the feed, because the starred items from the feed that I want are too old, right?

Also, another way might be better:

I just use /reader/api/0/stream/contents/<escaped StreamId> to get all starred items (up to 1000), then to see which items belong to the feed that I want. And I do it continuously using continuation to get the desired number of starred items from that feed.

right? 

Thanks

Dan

On Wed, Jul 13, 2011 at 2:59 AM, Mihai Parparita <mih...@google.com> wrote:
Reply all
Reply to author
Forward
0 new messages