Created
March 4, 2016 21:42
-
-
Save adamloving/8bad7be08cd970428939 to your computer and use it in GitHub Desktop.
Node instagram search example (including getting an access token)
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
const Instagram = require('instagram-node-lib') | |
Instagram.set('client_id', 'xxx') | |
Instagram.set('client_secret', 'xxx') | |
// to get an access_token | |
let url = Instagram.oauth.authorization_url({ | |
redirect_uri: 'http://mysite.com' | |
}) | |
url = url.replace('response_type=code', 'response_type=token') | |
console.log(url) | |
// after you've got one... | |
Instagram.set('access_token', 'xxx') | |
Instagram.tags.recent({ | |
name: "seattle", | |
complete: (data) => { | |
console.log(data) | |
}, | |
error: console.log | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment