0.5.0 • Published 9 years ago
angular-instagram-api-factory v0.5.0
angular-instagram-api-factory is an angularjs module with a instagram api factory.
Author: Jonathan Hornung (JohnnyTheTank)
Usage
- Install via either bower, npm or downloaded files:
bower install --save angular-instagram-api-factory
npm install --save angular-instagram-api-factory
- download angular-instagram-api-factory.zip
- Add
jtt_instagram
to your application's module dependencies. - Include dependencies in your HTML.
- When using bower:
<script src="bower_components/angular-instagram-api-factory/src/angular-instagram-api-factory.min.js"></script>
- When using npm:
<script src="node_modules/angular-instagram-api-factory/src/angular-instagram-api-factory.min.js"></script>
- when using downloaded files
<script src="angular-instagram-api-factory.min.js"></script>
- Use the factory
instagramFactory
factory methods
getMedia
instagramFactory.getMediaFromUserById({
userId: "<USER_ID>",
count: "<COUNT>", // (optional) valid values: 1-33 | default: 20
min_id: "<MIN_ID>", // (optional)
max_id: "<MAX_ID>", // (optional)
min_timestamp: "<MIN_TIMESTAMP>", // (optional)
max_timestamp: "<MAX_TIMESTAMP>", // (optional)
access_token: "<YOUR_ACCESS_TOKEN>",
}).then(function (_data) {
//on success
}).catch(function (_data) {
//on error
});
instagramFactory.getMediaByTag({
tag: "<TAG>",
count: "<COUNT>", // (optional) valid values: 1-33 | default: 20
min_tag_id: "<MIN_TAG_ID>", // (optional)
max_tag_id: "<MAX_TAG_ID>", // (optional)
min_timestamp: "<MIN_TIMESTAMP>", // (optional)
max_timestamp: "<MAX_TIMESTAMP>", // (optional)
access_token: "<YOUR_ACCESS_TOKEN>",
}).then(function (_data) {
//on success
}).catch(function (_data) {
//on error
});
instagramFactory.getMediaFromLocationById({
locationId: "<LOCATION_ID>",
count: "<COUNT>", // (optional) valid values: 1-33 | default: 20
min_id: "<MIN_ID>", // (optional)
max_id: "<MAX_ID>", // (optional)
min_timestamp: "<MIN_TIMESTAMP>", // (optional)
max_timestamp: "<MAX_TIMESTAMP>", // (optional)
access_token: "<YOUR_ACCESS_TOKEN>",
}).then(function (_data) {
//on success
}).catch(function (_data) {
//on error
});
instagramFactory.getMediaByCoordinates({
lat: "<LAT>",
lng: "<LNG>",
distance: "<DISTANCE>", // (optional) in meters, default: 1000
count: "<COUNT>", // (optional) valid values: 1-33 | default: 20 (this parameter maybe don't work correct)
min_timestamp: "<MIN_TIMESTAMP>", // (optional)
max_timestamp: "<MAX_TIMESTAMP>", // (optional)
access_token: "<YOUR_ACCESS_TOKEN>",
}).then(function (_data) {
//on success
}).catch(function (_data) {
//on error
});
getUser
instagramFactory.getUserById({
userId: "<USER_ID>",
access_token: "<YOUR_ACCESS_TOKEN>",
}).then(function (_data) {
//on success
}).catch(function (_data) {
//on error
});
Instagram JSONP API
- Doku: https://instagram.com/developer/endpoints/
- Api Console: https://apigee.com/console/instagram
- Username Converter: http://jelled.com/instagram/lookup-user-id
License
MIT
0.5.0
9 years ago