0

Good Morning,

First, my apologize for my bad level in English.

I write a rss reader on iOS connected to Google Reader.

When i try to retrieve the feed from Google with this code :

 if(nxt)
{
    response=[net get:
              [NSString stringWithFormat:
               @"https://www.google.com/reader/atom/user/-/state/com.google/reading-list?co=true&c=%@&ck=%d",
               nxt,
               [[NSDate date] timeIntervalSince1970]
               ]
                  xml:false
                 atom:false];
}
else
{
    response=[net get:
              [NSString stringWithFormat:
               @"https://www.google.com/reader/atom/user/-/state/com.google/reading-list?co=true&ck=%d",
               [[NSDate date] timeIntervalSince1970]
               ]
                  xml:false
                 atom:false];
}

where nxt is the code of gr:continuation and net get retrieve the NSData of the request on xml format (please don't care to xml:false).

I receive for example this answer :

17 jun 12:XX
17 jun 11:XX
17 jun 13:XX <--
17 jun 10:XX
17 jun 09:XX
17 jun 08:24
17 jun 08:32 <--
14 jun XX:XX <--
15 jun XX:XX
...

And when I call the url with the continuation (nxt) parameter I receive some items before the last I have previously download. For example my last item is 13 Jun I received some items as 15 jun , 16 jun, ...

I don't understand how retrieve in order the items of the feed.

Thanks, for your help.

Uchiwa
  • 1
  • 1

1 Answers1

0

You're not specifying a ranking function, so the default for the account (which may be auto, which is not strictly chronological) may be used. You can append a &r=n query parameter to force newest-first ranking, which should behave closer to what you expect. See this page for more details on all supported ranking parameters (it's for the /api/0/stream/contents API path, but it supports the same parameters as /atom).

Mihai Parparita
  • 4,236
  • 1
  • 23
  • 30