An open API service indexing awesome lists of open source software.

https://github.com/johnnythetank/angular-instagram-api-factory

AngularJS factory for Instagram JSON REST API requests
https://github.com/johnnythetank/angular-instagram-api-factory

Last synced: 11 months ago
JSON representation

AngularJS factory for Instagram JSON REST API requests

Awesome Lists containing this project

README

          

**angular-instagram-api-factory** is an angularjs module with a instagram api factory.

[![npm version](https://badge.fury.io/js/angular-instagram-api-factory.png)](https://badge.fury.io/js/angular-instagram-api-factory)
[![Bower version](https://badge.fury.io/bo/angular-instagram-api-factory.png)](https://badge.fury.io/bo/angular-instagram-api-factory)

Author: Jonathan Hornung ([JohnnyTheTank](https://github.com/JohnnyTheTank))

:warning: **This use case is not supported anymore. On June 1, 2016 Instagram changed the permissions and all apps moved automatically to Sandbox Mode if they were not approved through the [review process](https://www.instagram.com/developer/review/).**

## Usage

1. Install via either [bower](http://bower.io/), [npm](https://www.npmjs.com/) or downloaded files:
1. `bower install --save angular-instagram-api-factory`
2. `npm install --save angular-instagram-api-factory`
3. download [angular-instagram-api-factory.zip](https://github.com/JohnnyTheTank/angular-instagram-api-factory/zipball/master)
2. Add `jtt_instagram` to your application's module dependencies.
3. Include dependencies in your HTML.
1. When using bower:
```html

```
2. When using npm:
```html

```
3. when using downloaded files
```html

```
4. Use the factory `instagramFactory`

### factory methods

#### getMedia

```js
instagramFactory.getMediaFromUserById({
userId: "",
count: "", // (optional) valid values: 1-33 | default: 20
min_id: "", // (optional)
max_id: "", // (optional)
min_timestamp: "", // (optional)
max_timestamp: "", // (optional)
access_token: "",
}).then(function (_data) {
//on success
}).catch(function (_data) {
//on error
});
```

```js
instagramFactory.getMediaByTag({
tag: "",
count: "", // (optional) valid values: 1-33 | default: 20
min_tag_id: "", // (optional)
max_tag_id: "", // (optional)
min_timestamp: "", // (optional)
max_timestamp: "", // (optional)
access_token: "",
}).then(function (_data) {
//on success
}).catch(function (_data) {
//on error
});
```

```js
instagramFactory.getMediaFromLocationById({
locationId: "",
count: "", // (optional) valid values: 1-33 | default: 20
min_id: "", // (optional)
max_id: "", // (optional)
min_timestamp: "", // (optional)
max_timestamp: "", // (optional)
access_token: "",
}).then(function (_data) {
//on success
}).catch(function (_data) {
//on error
});
```

```js
instagramFactory.getMediaByCoordinates({
lat: "",
lng: "",
distance: "", // (optional) in meters, default: 1000
count: "", // (optional) valid values: 1-33 | default: 20 (this parameter maybe don't work correct)
min_timestamp: "", // (optional)
max_timestamp: "", // (optional)
access_token: "",
}).then(function (_data) {
//on success
}).catch(function (_data) {
//on error
});
```

#### getUser
```js
instagramFactory.getUserById({
userId: "",
access_token: "",
}).then(function (_data) {
//on success
}).catch(function (_data) {
//on error
});
```

## Instagram JSONP API

* Docs: https://instagram.com/developer/endpoints/
* Api Console: https://apigee.com/console/instagram
* Username Converter: http://jelled.com/instagram/lookup-user-id

## More angular-api-factories
[bandsintown](https://github.com/JohnnyTheTank/angular-bandsintown-api-factory) - [dailymotion](https://github.com/JohnnyTheTank/angular-dailymotion-api-factory) - [facebook](https://github.com/JohnnyTheTank/angular-facebook-api-factory) - [flickr](https://github.com/JohnnyTheTank/angular-flickr-api-factory) - [footballdata](https://github.com/JohnnyTheTank/angular-footballdata-api-factory) - [github](https://github.com/JohnnyTheTank/angular-github-api-factory) - [openweathermap](https://github.com/JohnnyTheTank/angular-openweathermap-api-factory) - [tumblr](https://github.com/JohnnyTheTank/angular-tumblr-api-factory) - [vimeo](https://github.com/JohnnyTheTank/angular-vimeo-api-factory) - [wikipedia](https://github.com/JohnnyTheTank/angular-wikipedia-api-factory) - [youtube](https://github.com/JohnnyTheTank/angular-youtube-api-factory)

## License

MIT