Skip to content

Instantly share code, notes, and snippets.

@daniel-c05
Created September 11, 2013 04:18
Show Gist options
  • Save daniel-c05/6519304 to your computer and use it in GitHub Desktop.
Save daniel-c05/6519304 to your computer and use it in GitHub Desktop.
Examples of a JSON response from blogger, and the custom classes implemented on an Android application for use with the Ion library.
{
"kind": "blogger#postList",
"nextPageToken": "CgkIChiAkceVjiYQ0b2SAQ",
"prevPageToken": "CgkIChDBwrK3mCYQ0b2SAQ",
"items": [
{
"kind": "blogger#post",
"id": "7706273476706534553",
"blog": {
"id": "2399953"
},
"published": "2011-08-01T19:58:00.000Z",
"updated": "2011-08-01T19:58:51.947Z",
"url": "http://buzz.blogger.com/2011/08/latest-updates-august-1st.html",
"selfLink": "https://www.googleapis.com/blogger/v3/blogs/2399953/posts/7706273476706534553",
"title": "Latest updates, August 1st",
"content": "elided for readability",
"author": {
"id": "401465483996",
"displayName": "Brett Wiltshire",
"url": "http://www.blogger.com/profile/01430672582309320414",
"image": {
"url": "http://4.bp.blogspot.com/_YA50adQ-7vQ/S1gfR_6ufpI/AAAAAAAAAAk/1ErJGgRWZDg/S45/brett.png"
}
},
"replies": {
"totalItems": "0",
"selfLink": "https://www.googleapis.com/blogger/v3/blogs/2399953/posts/7706273476706534553/comments"
}
},
{
"kind": "blogger#post",
"id": "6069922188027612413",
elided for readability
}
]
}
public class PostList {
@Expose
@SerializedName("nextPageToken")
private String nextPageToken = null;
public void setNextPageToken(String nextPageToken) {
this.nextPageToken = nextPageToken;
}
public String getNextPageToken() {
return nextPageToken;
}
@Expose
@SerializedName("prevPageToken")
private String prevPageToken = null;
public void setPrevPageToken(String prevPageToken) {
this.prevPageToken = prevPageToken;
}
public String getPrevPageToken() {
return prevPageToken;
}
@Expose
@SerializedName("items")
private SinglePost[] items = null;
public void setItems(SinglePost[] items) {
this.items = items;
}
public SinglePost[] getItems() {
return items;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment