Skip to content

Instantly share code, notes, and snippets.

@atypical
Created October 30, 2011 23:56
Show Gist options
  • Save atypical/1326614 to your computer and use it in GitHub Desktop.
Save atypical/1326614 to your computer and use it in GitHub Desktop.
Read and Clean
function parseTheDashboardData(resp){
var httpStatus = resp.meta.status,
httpMessage = resp.meta.msg,
dashboardPostsArray = resp.response.posts;
for (var i = 0; i < dashboardPostsArray.length; i++){
var current=dashboardPostsArray[i];
var blogName = current.blog_name,
blogID = current.id,
blogPostUrl = current.post_url,
blogPostType = current.type,
blogPostDate = current.date,
blogPostTime = current.timestamp,
blogPostFormat = current.format,
blogReblogKey = current.reblog_key,
blogTagArray = current.tags,
blogLiked = current.liked,
blogNoteCount = current.note_count,
blogCaption = current.caption,
blogPhotos = current.photos;
Ti.API.info('blogName: '+blogName);
Ti.API.info('blogID: '+blogID);
Ti.API.info('blogPostUrl: '+blogPostUrl);
Ti.API.info('blogPostType: '+blogPostType);
Ti.API.info('blogPostDate: '+blogPostDate);
Ti.API.info('blogPostTime: '+blogPostTime);
Ti.API.info('blogPostFormat: '+blogPostFormat);
Ti.API.info('blogReblogKey: '+blogReblogKey);
Ti.API.info('blogTagArray: '+blogTagArray);
Ti.API.info('blogLiked: '+blogLiked);
Ti.API.info('blogNoteCount: '+blogNoteCount);
Ti.API.info('cleanedBlogCaption: '+blogCaption.replace( /<[^>]+>/g, '' ));
Ti.API.info('blogPhotos: '+blogPhotos);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment