I suspect this is a fairly basic concept, but two days of trial and error, google searches, and random keyboard mashing have worn me down. I'm attempting to parse JSON returned from a URL, but I'm running into an issue that I suspect is related to the array inside the JSON.
What am I doing wrong?
JSON:
{
"HotelInformationResponse": {
"#hotelId": "106347",
"customerSessionId": "0ABAA83F-4430-B291-3432-E0A2DC790CA0",
"HotelImages": {
"#size": "16",
"HotelImage": [
{
"hotelImageId": 4694179,
"name": "",
"category": 1,
"type": 0,
"caption": "Exterior",
"url": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_44_b.jpg",
"thumbnailUrl": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_44_t.jpg",
"supplierId": 13,
"width": 350,
"height": 350,
"byteSize": 0
},
{
"hotelImageId": 4694182,
"name": "",
"category": 2,
"type": 0,
"caption": "Lobby",
"url": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_47_b.jpg",
"thumbnailUrl": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_47_t.jpg",
"supplierId": 13,
"width": 350,
"height": 350,
"byteSize": 0
},
{
"hotelImageId": 4694171,
"name": "",
"category": 2,
"type": 0,
"caption": "Lobby",
"url": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_36_b.jpg",
"thumbnailUrl": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_36_t.jpg",
"supplierId": 13,
"width": 350,
"height": 350,
"byteSize": 0
},
{
"hotelImageId": 4694174,
"name": "",
"category": 2,
"type": 0,
"caption": "Lobby",
"url": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_39_b.jpg",
"thumbnailUrl": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_39_t.jpg",
"supplierId": 13,
"width": 350,
"height": 350,
"byteSize": 0
},
{
"hotelImageId": 4694168,
"name": "",
"category": 3,
"type": 0,
"caption": "Guest Room",
"url": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_33_b.jpg",
"thumbnailUrl": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_33_t.jpg",
"supplierId": 13,
"width": 350,
"height": 350,
"byteSize": 0
},
{
"hotelImageId": 4694173,
"name": "",
"category": 3,
"type": 0,
"caption": "Guest Room",
"url": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_38_b.jpg",
"thumbnailUrl": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_38_t.jpg",
"supplierId": 13,
"width": 350,
"height": 350,
"byteSize": 0
},
{
"hotelImageId": 4694177,
"name": "",
"category": 3,
"type": 0,
"caption": "Guest Room",
"url": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_42_b.jpg",
"thumbnailUrl": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_42_t.jpg",
"supplierId": 13,
"width": 350,
"height": 350,
"byteSize": 0
},
{
"hotelImageId": 4694165,
"name": "",
"category": 10,
"type": 0,
"caption": "Restaurant",
"url": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_30_b.jpg",
"thumbnailUrl": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_30_t.jpg",
"supplierId": 13,
"width": 350,
"height": 350,
"byteSize": 0
},
{
"hotelImageId": 4694166,
"name": "",
"category": 10,
"type": 0,
"caption": "Restaurant",
"url": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_31_b.jpg",
"thumbnailUrl": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_31_t.jpg",
"supplierId": 13,
"width": 350,
"height": 350,
"byteSize": 0
},
{
"hotelImageId": 6601500,
"name": "",
"category": 11,
"type": 0,
"caption": "Interior",
"url": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_56_b.jpg",
"thumbnailUrl": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_56_t.jpg",
"supplierId": 13,
"width": 350,
"height": 350,
"byteSize": 0
},
{
"hotelImageId": 4694176,
"name": "",
"category": 12,
"type": 0,
"caption": "Pool",
"url": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_41_b.jpg",
"thumbnailUrl": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_41_t.jpg",
"supplierId": 13,
"width": 350,
"height": 350,
"byteSize": 0
},
{
"hotelImageId": 4694170,
"name": "",
"category": 12,
"type": 0,
"caption": "Pool",
"url": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_35_b.jpg",
"thumbnailUrl": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_35_t.jpg",
"supplierId": 13,
"width": 350,
"height": 350,
"byteSize": 0
},
{
"hotelImageId": 4694172,
"name": "",
"category": 12,
"type": 0,
"caption": "Pool",
"url": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_37_b.jpg",
"thumbnailUrl": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_37_t.jpg",
"supplierId": 13,
"width": 350,
"height": 350,
"byteSize": 0
},
{
"hotelImageId": 4694180,
"name": "",
"category": 21,
"type": 0,
"caption": "Lounge/Bar",
"url": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_45_b.jpg",
"thumbnailUrl": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_45_t.jpg",
"supplierId": 13,
"width": 350,
"height": 350,
"byteSize": 0
},
{
"hotelImageId": 4694181,
"name": "",
"category": 21,
"type": 0,
"caption": "Lounge/Bar",
"url": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_46_b.jpg",
"thumbnailUrl": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_46_t.jpg",
"supplierId": 13,
"width": 350,
"height": 350,
"byteSize": 0
},
{
"hotelImageId": 4694175,
"name": "",
"category": 38,
"type": 0,
"caption": "Suite",
"url": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_40_b.jpg",
"thumbnailUrl": "http://images.travelnow.com/hotels/1000000/10000/5900/5900/5900_40_t.jpg",
"supplierId": 13,
"width": 350,
"height": 350,
"byteSize": 0
}
]
}
}
}
My simplified code:
api = Expedia::Api.new
response = api.get_information({:hotelId => '106347'})
data = response.body
parsed = JSON.parse(data.to_json)
thumbnail = parsed['HotelInformationResponse']['HotelImages']['HotelImage']['thumbNailUrl']
This returns an error "no implicit conversion of String into Integer" at the thumbnail line. I understand that the JSON lists more then one 'thumbNailUrl', and I need to specify with I'm requesting, but I'm not sure how. I would just like to retrieve the first 'thumbNailUrl'.
Incidentally, the EAN API gem I'm using is located here: https://github.com/zaidakram/expedia
This line parsed['HotelInformationResponse']['HotelImages'] gives you an Array of Hash. So you need to access each Hash inside the array by index(s). Thus you need to go as below :-
parsed['HotelInformationResponse']['HotelImages']['HotelImage'][0]['thumbnailUrl']
If you want to get all thumbnails then, iterate over it as
thumbnails = parsed['HotelInformationResponse']['HotelImages']['HotelImage'].map do |hash|
hash[thumbnailUrl]
end
To get the first hotel image you can do:
thumbnail = parsed['HotelInformationResponse']['HotelImages']['HotelImage'][0]['thumbNailUrl']
If you wanted to get all the thumbnails you can do something like:
thumbnails = []
parsed['HotelInformationResponse']['HotelImages']['HotelImage'].each { |thumbnail| thumbnails << thumbnail['thumNailUrl'] }
Related
Plot bands in highchart export server is not working properly. I want the output same as shown in jsfiddle below.
I want the color plot band to show on y axis with width 20.
This is expected output: https://jsfiddle.net/vc6r8y3n/
Attached image is actual output when we use high-chart export server.
but when I tried same JavaScript json object on
http://export.highcharts.com/
its giving me image with plot band color spread on whole chart. its not considering width for 'y' or 'x' axis in export server. I gave attached image of export chart.
Why highchart behaving differently in both the cases.
Highchart JSON is same as in JSfiddle.
Actual image.
Expected is what it display in Jsfiddle. https://jsfiddle.net/vc6r8y3n/
{
"chart": {
"height": 350,
"width": 600,
"style": {
"fontFamily": "\"Arial\", sans-serif",
"fontSize": "16px"
},
"backgroundColor": "transparent"
},
"title": {
"text": null
},
"credits": {
"enabled": false
},
"legend": {
"align": "center",
"layout": "horizontal",
"verticalAlign": "bottom",
"symbolHeight": 5,
"symbolWidth": 5,
"symbolRadius": 0,
"itemDistance": 10,
"itemStyle": {
"fontSize": "5px",
"fontWeight": "bold",
"fontFamily": "\"Arial\", sans-serif"
},
"borderWidth": 0,
"padding": 0,
"margin": 5
},
"xAxis": {
"categories": [
"Sep-2020",
"Oct-2020",
"Nov-2020",
"Dec-2020",
"Jan-2021",
"Feb-2021"
],
"labels": {
"style": {
"fontSize": "4px",
"fontFamily": "\"Arial\", sans-serif",
"color": "#000"
},
"y": 5
},
"gridLineColor": "transparent",
"gridLineWidth": 0,
"minorGridLineWidth": 0,
"lineColor": "#9A9A9A",
"zIndex": 9999999
},
"yAxis": [
{
"title": {
"text": ""
},
"min": 0,
"max": 100,
"tickInterval": 20,
"plotBands": [
{
"color": "rgb(204,0,0)",
"from": 0,
"to": 30.99,
"zIndex": 3
},
{
"color": "rgb(226,113,113)",
"from": 31,
"to": 44.99,
"zIndex": 3
},
{
"color": "rgb(247,209,34)",
"from": 45,
"to": 54.99,
"zIndex": 3
},
{
"color": "rgb(136,207,136)",
"from": 55,
"to": 68.99,
"zIndex": 3
},
{
"color": "rgb(68,180,68)",
"from": 69,
"to": 87.99,
"zIndex": 3
},
{
"color": "rgb(0,153,0)",
"from": 88,
"to": 100,
"zIndex": 3
}
],
"width": 20
}
],
"plotOptions": {
"column": {
"dataLabels": {
"enabled": true
}
}
},
"series": [
{
"name": "Line1",
"type": "column",
"data": [
{
"y": 61,
"color": "#5b9bd5"
},
{
"y": 41,
"color": "#5b9bd5"
},
{
"y": 21,
"color": "#5b9bd5"
},
{
"y": 81,
"color": "#5b9bd5"
},
{
"y": 31,
"color": "#5b9bd5"
},
{
"y": 71,
"color": "#5b9bd5"
}
],
"color": "#5b9bd5",
"showInLegend": true
},
{
"name": "Line 2",
"type": "column",
"data": [
null,
null,
null,
null,
null,
1
],
"color": "#00B050"
},
{
"name": "Line 3",
"type": "spline",
"data": [
null,
{
"y": 45
},
{
"y": 38
},
{
"y": 32
},
{
"y": 40
},
{
"y": 48
}
],
"color": "#9A0229"
}
]
}
enter image description here
I am completely confused by Twitter streaming API behavior. I created a simple stream with a 1 follow for "ESPN:
and get this tweet ( see attached) . which is a retweet, but the original is "ESPN FC" , not "ESPN"
what the heck is going on here ? Why does twitter streaming API return this status ?
{ "extended_entities": { "media": [ { "display_url": "pic.twitter.com/y2E7ktezgd", "source_user_id": 18091004, "type": "photo", "media_url": "http://pbs.twimg.com/media/ECfRaipX4AA-_-S.jpg", "source_status_id": 1164129284480483329, "url": "<placeholder_url>",
"indices": [ 44, 67 ], "sizes": { "small": { "w": 544, "h": 680, "resize": "fit" }, "large": { "w": 1080, "h": 1350, "resize": "fit" }, "thumb": { "w": 150, "h": 150, "resize": "crop" }, "medium": { "w": 960, "h": 1200, "resize": "fit" } }, "id_str":
"1164129282605703168", "expanded_url": "https://twitter.com/ESPNFC/status/1164129284480483329/photo/1", "source_status_id_str": "1164129284480483329", "media_url_https": "https://pbs.twimg.com/media/ECfRaipX4AA-_-S.jpg", "id": 1164129282605703168, "source_user_id_str":
"18091004" } ] }, "in_reply_to_status_id_str": null, "in_reply_to_status_id": null, "created_at": "Wed Aug 21 14:19:49 +0000 2019", "in_reply_to_user_id_str": null, "source": "<a href=\ "http://twitter.com/download/iphone\" rel=\ "nofollow\">Twitter for iPhone<\/a>",
"retweeted_status": {
"extended_entities": {
"media": [
{
"display_url": "pic.twitter.com/y2E7ktezgd",
"indices": [
32,
55
],
"sizes": {
"small": {
"w": 544,
"h": 680,
"resize": "fit"
},
"large": {
"w": 1080,
"h": 1350,
"resize": "fit"
},
"thumb": {
"w": 150,
"h": 150,
"resize": "crop"
},
"medium": {
"w": 960,
"h": 1200,
"resize": "fit"
}
},
"id_str": "1164129282605703168",
"expanded_url": "https://twitter.com/ESPNFC/status/1164129284480483329/photo/1",
"media_url_https": "https://pbs.twimg.com/media/ECfRaipX4AA-_-S.jpg",
"id": 1164129282605703168,
"type": "photo",
"media_url": "http://pbs.twimg.com/media/ECfRaipX4AA-_-S.jpg",
"url": "<url>"
}
]
},
"in_reply_to_status_id_str": null,
"in_reply_to_status_id": null,
"created_at": "Wed Aug 21 10:57:04 +0000 2019",
"in_reply_to_user_id_str": null,
"source": "<a href=\"https://www.spredfast.com/\" rel=\"nofollow\">Spredfast app<\/a>",
"retweet_count": 2773,
"retweeted": false,
"geo": null,
"filter_level": "low",
"in_reply_to_screen_name": null,
"is_quote_status": false,
"id_str": "1164129284480483329",
.....
}
}
This is not really an answer but an observation. Twitter appears to link all accounts that begin with ESPN.
Type this URL into a browser https://twitter.com/ESPN/status/1164129284480483329
It will forward you to the original tweet at https://twitter.com/ESPNFC/status/1164129284480483329
The same occurs with non-ESPN user "ESPNSUCKS"
https://twitter.com/ESPNSUCKS/status/1164129284480483329
And also with XESPN which is a suspended account
https://twitter.com/XESPN/status/1164129284480483329
New to the notion of Rails mapping, and would love to get some help on this from the stack overflow community.
Currently I have this JSON response from the Embedly API and don't really know how to map it to my very simple 'posts' model. I'm trying to get the image/title/url from the JSON response and map it into my database in the relevant fields, so in the JSON response below these would be 'original_url', 'image' and 'title'.
{
"provider_url": "http://piccsy.com",
"authors": [],
"provider_display": "piccsy.com",
"related": [],
"favicon_url": "http://piccsy.com/favicon.ico",
"keywords": [],
"app_links": [],
"original_url": "http://piccsy.com/2015/02/rihanna-sharks-harpers-bazaar-march-2015-photoshoot3",
"media": {},
"content": null,
"entities": [],
"provider_name": "Piccsy",
"type": "html",
"description": "Beautiful, inspirational and creative images from Piccsy. Thousands of Piccs from all our streams, for you to browse, enjoy and share with a friend.",
"embeds": [],
"images": [
{
"width": 728,
"url": "http://img2.piccsy.com/cache/images/56/8f/bed__396d8_cecf850824130_99f-post.jpg",
"height": 1092,
"caption": null,
"colors": [
{
"color": [
190,
211,
212
],
"weight": 0.3095703125
},
{
"color": [
114,
159,
171
],
"weight": 0.247314453125
},
{
"color": [
0,
52,
68
],
"weight": 0.244140625
},
{
"color": [
25,
99,
117
],
"weight": 0.198974609375
}
],
"entropy": 5.94797179868,
"size": 318918
},
{
"width": 200,
"url": "http://piccsy.com/piccsy/images/layout/logo/e02f43.200x200.jpg",
"height": 200,
"caption": null,
"colors": [
{
"color": [
215,
51,
67
],
"weight": 0.701904296875
},
{
"color": [
250,
252,
252
],
"weight": 0.298095703125
}
],
"entropy": 0.686638083774,
"size": 18691
}
],
"safe": true,
"offset": null,
"cache_age": 86065,
"lead": null,
"language": null,
"url": "http://piccsy.com/2015/02/rihanna-sharks-harpers-bazaar-march-2015-photoshoot3",
"title": "Rihanna-sharks-harpers-bazaar-march-2015-photoshoot3",
"favicon_colors": [
{
"color": [
208,
37,
38
],
"weight": 0.000244140625
},
{
"color": [
0,
0,
0
],
"weight": 0.000244140625
}
],
"published": null
}
My posts model contains very simple name, url and image fields which are all accepting strings. Any help on mapping this to a model would be brilliant, up till now I've only done very simple JSON responses and this one is a bit out of my league.
Thanks for your time.
You can just parse json response, and get required fields from it
json_response = '{your json response from api}'
response_hash = JSON.parse(json_response)
MyModel.create!(url: response_hash[:original_url], title: response_hash[:title])
But there is problem with images, response contains multiple images, so probably you should have ImageModel that belongs to MyModel, and MyModel has_many ImageModels.
Then you can do:
model = MyModel.create!(url: response_hash[:original_url], title: response_hash[:title])
response_hash[:images].each do |image|
model.images.create!(url: image[:url])
end
Trying to parse some ugly JSON:
image = product.images.find { |i| i["sizeName"] == "Large" }
If I use Hashie::Mash Rash, can I make it look like this instead?
image = product.images.find { |i| i["size_name"] == "large" }
If so, why am I getting undefined method 'each_pair' for #<Array:0x007f84a0408540>? Please see https://gist.github.com/frankie-loves-jesus/6b8012f9197ca6c675a9 for a full example including a live app.
Example JSON:
{
"metadata": {
"category": {
"id": "women",
"name": "Women's Fashion"
},
"showSizeFilter": false,
"showColorFilter": true,
"offset": 0,
"limit": 20,
"total": 974184
},
"products": [
{
"id": 377083005,
"name": "BCBGeneration Women's Contrast Sleeve Trench",
"currency": "USD",
"price": 168,
"priceLabel": "$168.00",
"salePrice": 106.43,
"salePriceLabel": "$106.43",
"inStock": true,
"retailer": {
"id": "849",
"name": "Amazon.com",
"url": "http://www.shopstyle.com/browse/Amazon.com-US?pid=uid9616-726296-93"
},
"locale": "en_US",
"description": "This jacket features contrasting leather sleeves",
"brand": {
"id": "51",
"name": "BCBG MAX AZRIA",
"url": "http://www.shopstyle.com/browse/BCBG-MAX-AZRIA?pid=uid9616-726296-93"
},
"clickUrl": "http://api.shopstyle.com/action/apiVisitRetailer?id=377083005&pid=uid9616-726296-93",
"images": [
{
"sizeName": "Small",
"width": 32,
"height": 40,
"url": "http://resources.shopstyle.com/pim/7b/28/7b2894c203529b0956cdd6b760629d4a_small.jpg"
},
{
"sizeName": "Medium",
"width": 112,
"height": 140,
"url": "http://resources.shopstyle.com/pim/7b/28/7b2894c203529b0956cdd6b760629d4a_medium.jpg"
},
{
"sizeName": "Large",
"width": 164,
"height": 205,
"url": "http://resources.shopstyle.com/pim/7b/28/7b2894c203529b0956cdd6b760629d4a.jpg"
}
],
"colors": [
{
"name": "Chino"
}
],
"sizes": [
{
"name": "XX-Small"
},
{
"name": "X-Small"
}
],
"categories": [
{
"id": "raincoats-and-trenchcoats",
"name": "Raincoats & Trenchcoats"
}
]
}
]
}
This is my working code
require 'json'
require 'rash'
#json_text = <<END
{
"metadata": {
"category": {
"id": "women",
"name": "Women's Fashion"
},
"showSizeFilter": false,
"showColorFilter": true,
"offset": 0,
"limit": 20,
"total": 974184
},
"products": [
{
"id": 377083005,
"name": "BCBGeneration Women's Contrast Sleeve Trench",
"currency": "USD",
"price": 168,
"priceLabel": "$168.00",
"salePrice": 106.43,
"salePriceLabel": "$106.43",
"inStock": true,
"retailer": {
"id": "849",
"name": "Amazon.com",
"url": "http://www.shopstyle.com/browse/Amazon.com-US?pid=uid9616-726296-93"
},
"locale": "en_US",
"description": "This jacket features contrasting leather sleeves",
"brand": {
"id": "51",
"name": "BCBG MAX AZRIA",
"url": "http://www.shopstyle.com/browse/BCBG-MAX-AZRIA?pid=uid9616-726296-93"
},
"clickUrl": "http://api.shopstyle.com/action/apiVisitRetailer?id=377083005&pid=uid9616-726296-93",
"images": [
{
"sizeName": "Small",
"width": 32,
"height": 40,
"url": "http://resources.shopstyle.com/pim/7b/28/7b2894c203529b0956cdd6b760629d4a_small.jpg"
},
{
"sizeName": "Medium",
"width": 112,
"height": 140,
"url": "http://resources.shopstyle.com/pim/7b/28/7b2894c203529b0956cdd6b760629d4a_medium.jpg"
},
{
"sizeName": "Large",
"width": 164,
"height": 205,
"url": "http://resources.shopstyle.com/pim/7b/28/7b2894c203529b0956cdd6b760629d4a.jpg"
}
],
"colors": [
{
"name": "Chino"
}
],
"sizes": [
{
"name": "XX-Small"
},
{
"name": "X-Small"
}
],
"categories": [
{
"id": "raincoats-and-trenchcoats",
"name": "Raincoats & Trenchcoats"
}
]
}
]
}
END
hash = JSON.parse(#json_text)
#rash = Hashie::Rash.new( hash )
images = []
#rash.products.each do |product|
images << product.images.find { |i| i.size_name.downcase == "large" }
end
puts images.inspect
#[#<Hashie::Rash height=205 size_name="Large" url="http://resources.shopstyle.com/pim/7b/28/7b2894c203529b0956cdd6b760629d4a.jpg" width=164>]
It doesn't raise the error you have mentioned.
And I use
$ruby --version
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin13.0.0]
gem list --local |grep 'rash'
rash (0.4.0)
$gem list --local |grep 'hashie'
hashie (3.2.0, 2.0.5)
Could you check yours?
And, if possible, dump the json at the moment that it raises the error.
Currently I'm able to fetch the photos of the logged in user in my app. But I want to fetch the photos from my instagram developer account in which I have registered my app. Is this possible? Currently,
NSString *urlString=[NSString stringWithFormat:#"https://api.instagram.com/v1/users/self/feed/?access_token=%#",appDelegate.instagram.accessToken];
fetches the detail of the logged in user. But I want to get the photos from my client's instagram account. Replacing 'self' in the above url with client's username doesn't work. Any ideas ?
Can't you use the /users/user-id/media/recent Endpoint?
Example from Instagram API Documentation, to get Feed for UserID = 3, use following
https://api.instagram.com/v1/users/3/media/recent/?access_token=ACCESS-TOKEN
Returns
{
"data": [{
"comments": {
"data": [],
"count": 0
},
"caption": {
"created_time": "1296710352",
"text": "Inside le truc #foodtruck",
"from": {
"username": "kevin",
"full_name": "Kevin Systrom",
"type": "user",
"id": "3"
},
"id": "26621408"
},
"likes": {
"count": 15,
"data": [{
"username": "mikeyk",
"full_name": "Mike Krieger",
"id": "4",
"profile_picture": "..."
}, {...subset of likers...}]
},
"link": "http://instagr.am/p/BWrVZ/",
"user": {
"username": "kevin",
"profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_3_75sq_1295574122.jpg",
"id": "3"
},
"created_time": "1296710327",
"images": {
"low_resolution": {
"url": "http://distillery.s3.amazonaws.com/media/2011/02/02/6ea7baea55774c5e81e7e3e1f6e791a7_6.jpg",
"width": 306,
"height": 306
},
"thumbnail": {
"url": "http://distillery.s3.amazonaws.com/media/2011/02/02/6ea7baea55774c5e81e7e3e1f6e791a7_5.jpg",
"width": 150,
"height": 150
},
"standard_resolution": {
"url": "http://distillery.s3.amazonaws.com/media/2011/02/02/6ea7baea55774c5e81e7e3e1f6e791a7_7.jpg",
"width": 612,
"height": 612
}
},
"type": "image",
"users_in_photo": [],
"filter": "Earlybird",
"tags": ["foodtruck"],
"id": "22721881",
"location": {
"latitude": 37.778720183610183,
"longitude": -122.3962783813477,
"id": "520640",
"street_address": "",
"name": "Le Truc"
}
},
{
"videos": {
"low_resolution": {
"url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_102.mp4",
"width": 480,
"height": 480
},
"standard_resolution": {
"url": "http://distilleryvesper9-13.ak.instagram.com/090d06dad9cd11e2aa0912313817975d_101.mp4",
"width": 640,
"height": 640
},
"comments": {
"data": [{
"created_time": "1279332030",
"text": "Love the sign here",
"from": {
"username": "mikeyk",
"full_name": "Mikey Krieger",
"id": "4",
"profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1242695_75sq_1293915800.jpg"
},
"id": "8"
},
{
"created_time": "1279341004",
"text": "Chilako taco",
"from": {
"username": "kevin",
"full_name": "Kevin S",
"id": "3",
"profile_picture": "..."
},
"id": "3"
}],
"count": 2
},
"caption": null,
"likes": {
"count": 1,
"data": [{
"username": "mikeyk",
"full_name": "Mikeyk",
"id": "4",
"profile_picture": "..."
}]
},
"link": "http://instagr.am/p/D/",
"created_time": "1279340983",
"images": {
"low_resolution": {
"url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_6.jpg",
"width": 306,
"height": 306
},
"thumbnail": {
"url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_5.jpg",
"width": 150,
"height": 150
},
"standard_resolution": {
"url": "http://distilleryimage2.ak.instagram.com/11f75f1cd9cc11e2a0fd22000aa8039a_7.jpg",
"width": 612,
"height": 612
}
},
"type": "video",
"users_in_photo": null,
"filter": "Vesper",
"tags": [],
"id": "363839373298",
"user": {
"username": "kevin",
"full_name": "Kevin S",
"profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_3_75sq_1295574122.jpg",
"id": "3"
},
"location": null
},
]
}
Instagram only provides the API to get the feeds of self .. Have a look on
https://api.instagram.com/v1/users/userID/media/recent
this i hope it provides some recent medias of a user for more info look at this
http://instagram.com/developer/api-console/