Note that there are some explanatory texts on larger screens.

plurals
  1. POMarking items as read / unread in iphone google reader app
    text
    copied!<p>I am developing an app using data from <a href="http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI" rel="nofollow">google reader's API</a> and using <a href="http://code.google.com/p/gdata-objectivec-client/" rel="nofollow">GData</a> for login. </p> <p>I want to be able to mark a post inside a table cell as read / unread, but am finding the fact that this is all mainly undocumented hard to work out a solution, any ideas / links?</p> <p>Here is the code for the mark read button:</p> <pre><code>//Get the token NSString *tokenString = [NSString stringWithFormat:@"https://www.google.com/reader/api/0/token"]; NSURL *tokenURL = [NSURL URLWithString:tokenString]; NSMutableURLRequest *tokenRequest = [NSMutableURLRequest requestWithURL:tokenURL]; NSString *tokenStringResult; NSArray *listItems; NSError *tokenError = nil; NSURLResponse *tokenResponse = nil; NSData *tokenData = [NSURLConnection sendSynchronousRequest:tokenRequest returningResponse:&amp;tokenResponse error:&amp;tokenError]; if (tokenData) { tokenStringResult = [[NSString alloc] initWithData:tokenData encoding:NSUTF8StringEncoding]; listItems = [tokenStringResult componentsSeparatedByString:@"/"]; } else { NSLog(@"tokenError = %@", tokenError); } // Mark it as read NSString *readerURLString = [NSString stringWithFormat:@"http://www.google.com/reader/api/0/edit-tag?a=user/-/state/com.google/read&amp;async=true&amp;s=feed/%@&amp;i=%@&amp;T=%@", siteLink, postID, [listItems lastObject]]; NSURL *readerURL = [NSURL URLWithString:readerURLString]; NSMutableURLRequest *readerRequest = [NSMutableURLRequest requestWithURL:readerURL]; [mAuth authorizeRequest:readerRequest]; NSError *error = nil; NSURLResponse *response = nil; NSData *data = [NSURLConnection sendSynchronousRequest:readerRequest returningResponse:&amp;response error:&amp;error]; if (data) { NSHTTPURLResponse * httpResponse = (NSHTTPURLResponse *) response; assert( [httpResponse isKindOfClass:[NSHTTPURLResponse class]] ); NSLog(@"response.allHeaderFields = %@", [httpResponse allHeaderFields]); NSLog(@"response.statusCode = %i", [httpResponse statusCode]); } </code></pre> <p>the log from this is:</p> <pre><code>response.statusCode = { "Cache-Control" = "private, max-age=0"; "Content-Length" = 1334; "Content-Type" = "text/html; charset=UTF-8"; Date = "Fri, 21 Jan 2011 03:49:07 GMT"; Expires = "Fri, 21 Jan 2011 03:49:07 GMT"; Server = GSE; "X-Content-Type-Options" = nosniff; "X-Frame-Options" = SAMEORIGIN; "X-Reader-Google-Version" = "527-000"; "X-Reader-User" = 01940378872835844713; "X-Xss-Protection" = "1; mode=block"; } response.statusCode = 400 </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload