Created
March 24, 2013 19:13
-
-
Save jedmund/5233111 to your computer and use it in GitHub Desktop.
This file contains 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
function getUser(username) { | |
var config = Instagram.config; | |
var url = config.api_host + "/v1/users/" + searchUsers(username, _usernameToId) + | |
"/?access_token=" + config.access_token + "&callback=?"; | |
$.getJSON(url, function(data) { | |
console.log(data); | |
}); | |
} | |
function searchUsers(q, callback) { | |
var config = Instagram.config; | |
url = config.api_host + "/v1/users/search?q=" + q + | |
"&access_token=" + config.access_token + "&callback=?"; | |
$.getJSON(url, callback); | |
} | |
function _usernameToId(json) { | |
return json.data[0].id; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment