I am building an app using rails, angular, and RSpotify. I'm still kind of a newbie, and feel like the answer to my question is right in front of me, but I am struggling to figure it out.
After I authenticate a user, I redirect to a search to find new songs/albums/artist etc. Once they find relevant songs, they can add them to a playlist.
Using RSpotify, I can make the data to json, and then show that data using angular. Here is an example of what I am doing;
users_controller.rb
def music
music = RSpotify::Artist.search("Wiz Khalifa")
respond_to do |format|
format.json { render :json => music}
end
end
I added to my routes, and now this spits out some data;
localhost:3000/api/music.json
[
{
"genres": [],
"images": [
{
"height": 1200,
"url": "https://i.scdn.co/image/6fcf0a3556f9edf47f4d17c33a48418a3d2e6bce",
"width": 900
},
{
"height": 853,
"url": "https://i.scdn.co/image/d803a20e1402bf2c46353c97d929a3f28c27366e",
"width": 640
},
{
"height": 267,
"url": "https://i.scdn.co/image/0d706a776e505ad54968f389e4c6b820a7615562",
"width": 200
},
{
"height": 85,
"url": "https://i.scdn.co/image/534b45d0038ca0142b50dcc3f338a8fdd9caa949",
"width": 64
}
],
"name": "Wiz Khalifa",
"popularity": 91,
"top_tracks": {},
"external_urls": {
"spotify": "https://open.spotify.com/artist/137W8MRPWKqSmrBGDBFSop"
},
"href": "https://api.spotify.com/v1/artists/137W8MRPWKqSmrBGDBFSop",
"id": "137W8MRPWKqSmrBGDBFSop",
"type": "artist",
"uri": "spotify:artist:137W8MRPWKqSmrBGDBFSop"
},
{
"genres": [],
"images": [
{
"height": 640,
"url": "https://i.scdn.co/image/d4e1be09af57961ff630662daa5e44e75a99f18b",
"width": 640
},
{
"height": 300,
"url": "https://i.scdn.co/image/814960e7e3b52dc4b9985974e4b9f4e25e40860c",
"width": 300
},
{
"height": 64,
"url": "https://i.scdn.co/image/aa9543dd6a6fba6be98894c02141943da40cb81d",
"width": 64
}
],
"name": "Snoop Dogg & Wiz Khalifa",
"popularity": 34,
"top_tracks": {},
"external_urls": {
"spotify": "https://open.spotify.com/artist/3rnsFvKusYivCTnK2fpwbu"
},
"href": "https://api.spotify.com/v1/artists/3rnsFvKusYivCTnK2fpwbu",
"id": "3rnsFvKusYivCTnK2fpwbu",
"type": "artist",
"uri": "spotify:artist:3rnsFvKusYivCTnK2fpwbu"
},
{
"genres": [],
"images": [
{
"height": 600,
"url": "https://i.scdn.co/image/425f29c04ce8953339cac3b47e56dce53a82d396",
"width": 600
},
{
"height": 300,
"url": "https://i.scdn.co/image/7ea62fef2465095d3283843defd4daefb1a9b627",
"width": 300
},
{
"height": 64,
"url": "https://i.scdn.co/image/7f92197321b425d83b63ad3db550729fec74df9b",
"width": 64
}
],
"name": "BAyBOy Ft. Wiz Khalifa",
"popularity": 0,
"top_tracks": {},
"external_urls": {
"spotify": "https://open.spotify.com/artist/15qZ54HBDz6nDQKvafOKqG"
},
"href": "https://api.spotify.com/v1/artists/15qZ54HBDz6nDQKvafOKqG",
"id": "15qZ54HBDz6nDQKvafOKqG",
"type": "artist",
"uri": "spotify:artist:15qZ54HBDz6nDQKvafOKqG"
},
So, I am able to reach the data from spotify which is good. However, the call Artist.search takes a parameter. So my question is, using a search tab like this;
home.html.erb
<%= form_tag "/music" do %>
<%= label_tag :search %>
<%= text_field_tag :search %>
<%= submit_tag :search %>
<% end %>
How could I add user input from the search bar as the parameter for RSpotify::Artist.search()? Any help pointing me in the right direction is very appreciated. Thanks.
users_controller.rb
def music
#music = RSpotify::Artist.search(params[:search])
render :json => #music
end
Related
Spree API when hitting /products?include=images path gives the response in following format.
{
"data": [...],
"included": [
{
"id": "4",
"type": "image",
"attributes": {
"viewable_type": "Spree::Variant",
"viewable_id": 3,
"styles": [
{
"url": "/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBDUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--bd6df012d992b43227344ecb03dc0ab6e13b1555/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lMTkRoNE5EZytCam9HUlZRPSIsImV4cCI6bnVsbCwicHVyIjoidmFyaWF0aW9uIn19--504f95c059f17243e0d7d1312e2b387f26a40aff/bg.jpg",
"width": "48",
"height": "48"
},
{
"url": "/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBDUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--bd6df012d992b43227344ecb03dc0ab6e13b1555/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTVRBd2VERXdNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--594f543b42e0bfafbe9d09df814e1d60837f9ef6/bg.jpg",
"width": "100",
"height": "100"
},
{
"url": "/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBDUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--bd6df012d992b43227344ecb03dc0ab6e13b1555/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTWpRd2VESTBNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--46583de60196cb1eee5b4a704d67209eee40c09a/bg.jpg",
"width": "240",
"height": "240"
},
{
"url": "/rails/active_storage/representations/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBDUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--bd6df012d992b43227344ecb03dc0ab6e13b1555/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCam9MY21WemFYcGxTU0lOTmpBd2VEWXdNRDRHT2daRlZBPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--3b3e65d1d9c712d2d540e15aa84ca541eb12b365/bg.jpg",
"width": "600",
"height": "600"
}
]
}
}],
"meta": {
"count": 14,
"total_count": 14,
"total_pages": 1
},
"links": {
"self": "https://galific.herokuapp.com/api/v2/storefront/products?include=variants.images",
"next": "https://galific.herokuapp.com/api/v2/storefront/products?include=variants.images&page=1",
"prev": "https://galific.herokuapp.com/api/v2/storefront/products?include=variants.images&page=1",
"last": "https://galific.herokuapp.com/api/v2/storefront/products?include=variants.images&page=1",
"first": "https://galific.herokuapp.com/api/v2/storefront/products?include=variants.images&page=1"
}
}
}
Here you can see the image URL's are coming as included object. While developing for mobile its not a good idea to put the very crucial element (product image path in this case) in separate object. This require the mobile dev to loop unnecessary just to get the image path which can be provided within the image relationships object like this:
"images": {
"data": [
{
"id": "2",
"type": "image",
"url" : 'image-path.jpg'
}]
}
The image path should be included in data object itself rather than separated include object. Is there any way to do it without messing with source??
I am integrating with Scalable Press API. I am using HTTparty to handle the api response.
Example request:
curl "https://api.scalablepress.com/v2/products/gildan-sweatshirt-crew"
Example response:
{
"comments": "Generous fit. Soft, sturdy, easy to move around in, all the while looking good.",
"description": "Air Jet Spun Yarn. Double-needle stitching. Set-in sleeves. 1x1 Athletic Rib with Lycra(R). Quarter-turned to eliminate center crease.",
"name": "Gildan Sweatshirt - Crew",
"type": "Garment",
"properties": {
"brand": "Gildan",
"material": "7.75 oz 50% cotton, 50% polyester.",
"style": "18000"
},
"colors": [{
"name": "Kiwi",
"hex": "88b95d",
"images": [{
"url": "http://i1.ooshirts.com/images/lab_shirts/Kiwi-5-R.jpg",
"label": "Right"
}, {
"url": "http://i1.ooshirts.com/images/lab_shirts/Kiwi-5-L.jpg",
"label": "Left"
}, {
"url": "http://i1.ooshirts.com/images/lab_shirts/Kiwi-5-F.jpg",
"label": "Front"
}, {
"url": "http://i1.ooshirts.com/images/lab_shirts/Kiwi-5-B.jpg",
"label": "Back"
}],
"sizes": [
"sml",
"med",
"lrg",
"xlg",
"xxl",
"xxxl",
"xxxxl",
"xxxxxl"
]
}, {
"name": "Irish Green",
"hex": "3da858",
"images": [{
"url": "http://i1.ooshirts.com/images/lab_shirts/Irish-Green-5-F.jpg",
"label": "Front"
}, {
"url": "http://i1.ooshirts.com/images/lab_shirts/Irish-Green-5-L.jpg",
"label": "Left"
}, {
"url": "http://i1.ooshirts.com/images/lab_shirts/Irish-Green-5-R.jpg",
"label": "Right"
}, {
"url": "http://i1.ooshirts.com/images/lab_shirts/Irish-Green-5-B.jpg",
"label": "Back"
}],
"sizes": [
"sml",
"med",
"lrg",
"xlg",
"xxl",
"xxxl",
"xxxxl",
"xxxxxl"
]
}],
"additionalImages": [{
"label": "Front",
"url": "http://i1.ooshirts.com/products/5/front.jpg"
}, {
"label": "Back",
"url": "http://i1.ooshirts.com/products/5/back.jpg"
}, {
"label": "Collar",
"url": "http://i1.ooshirts.com/products/5/collar.jpg"
}],
"image": {
"label": "Catalog",
"url": "http://www.ooshirts.com/products/5/catalog.jpg"
},
"available": true,
"url": "https://api.scalablepress.com/v2/products/gildan-sweatshirt-crew",
"availabilityUrl": "https://api.scalablepress.com/v2/products/gildan-sweatshirt-crew/availability",
"productId": "gildan-sweatshirt-crew"
}
This response isn't too bad, but some products have upwards of 50 colors and each color has around 4 images.
Question:
I am looking to make my code a little better and easier to access the images. Is there a better way to handle the array?
View: <%= image_tag #product['colors'].to_a[0].to_a[2].to_a[1].to_a[1].to_a[0].to_a[1] %>
controller:
def show_product
#product = scalable_press.show_product(params[:product])
end
private
def scalable_press
ScalablePress.new
end
class ScalablePress
include HTTParty
base_uri 'https://api.scalablepress.com'
def initialize
#options = { basic_auth: { password: 'APIKEY' }, verify: false}
end
def products_in_category(category)
response = self.class.get("https://api.scalablepress.com/v2/categories/#{category}", #options)
response["products"]
end
def categories
response = self.class.get("https://api.scalablepress.com/v2/categories", #options)
end
def show_product(product)
response = self.class.get("https://api.scalablepress.com/v2/products/#{product}", #options)
# response["products"]
end
end
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/