Skip to content

Instantly share code, notes, and snippets.

@jedmund
Created March 24, 2013 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jedmund/5233111 to your computer and use it in GitHub Desktop.
Save jedmund/5233111 to your computer and use it in GitHub Desktop.
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