Created
June 24, 2012 20:07
-
-
Save anuith/2984709 to your computer and use it in GitHub Desktop.
Windows Phone Hackathon : Facebook & Instagram Sample - Instagram Code - Get Feed (continued from https://gist.github.com/2984706 )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void DisplayFeed(JToken data) | |
| { | |
| List<InstagramItem> items = new List<InstagramItem>(); | |
| foreach (JToken token in data) | |
| { | |
| InstagramItem item = new InstagramItem(); | |
| item.id = token["id"].Value<string>(); | |
| item.commentsCount = token["comments"]["count"].Value<int>(); | |
| item.likesCount = token["likes"]["count"].Value<int>(); | |
| item.image = | |
| token["images"]["standard_resolution"]["url"].Value<string>(); | |
| item.thumbnail = token["images"]["thumbnail"]["url"].Value<string>(); | |
| if (token["caption"] != null && token["caption"].ToString() != "") { | |
| item.caption = token["caption"]["text"].Value<string>(); | |
| } | |
| item.link = token["link"].Value<string>(); | |
| item.user = token["user"].ToObject<InstagramItem.InstagramUser>(); | |
| if (token["location"] != null && token["location"].ToString() != "") { | |
| item.location = | |
| token["location"].ToObject<InstagramItem.InstagramLocationData>(); | |
| } | |
| items.Add(item); | |
| } | |
| ListBox_Feed.ItemsSource = items; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment