/Instagram-for-MooTools

Talk to the Instagram API by using JavaScript

Primary LanguageJavaScript

Instagram for MooTools

Instagram is a growing platform to quickly share pictures with your friends.
With this classes you can connect to nearly all Instagram API Endpoints just by using JavaScript.

Polaroid Camera Icon by Petter Myhr

Screenshot

How to use

At first, you have to register a new client on the developer page of Instagram.
This library just requires the client id and if you use services that require authentication, also the callback url.

You have to use the Instagram.Base.js first. It's the base for all other files.
Use the other files as required.
If you just want to use the Media and Tags Endpoints, your code would look like

#HTML
<script src="js/Instagram.Base.js"></script>
<script src="js/Instagram.Media.js"></script>
<script src="js/Instagram.Tags.js"></script>

Initialize

Syntax:

#JS
var myInstagram = new Instagram(options);

Arguments:

  1. options - (options) see below

Options:

  • client_id - (string) Your applications client_id
  • redirect_uri - (string) The defined callback URL of your application
  • scope - (array) A list of scopes your application require - Take a look at the Instagram API description

Media

Media API Endpoints Documentation

getMedia

Syntax:

#JS
myInstagram.getMedia(media_id);

Arguments:

  1. media_id

Events
mediaInformation

searchMedia

Syntax:

#JS
myInstagram.searchMedia(lat, lng, distance, min_time, max_time);

Arguments:

  1. lat - Latitude of the center search coordinate. If used, lng is required.
  2. lng - Longitude of the center search coordinate. If used, lat is required.
  3. distance - Default is 1km (distance=1000), max distance is 5km
  4. min_time - A unix timestamp. All media returned will be taken later than this timestamp.
  5. max_time - A unix timestamp. All media returned will be taken earlier than this timestamp.

Events
mediaData

getPopularMedia

Syntax:

#JS
myInstagram.getPopularMedia();

Events
mediaData

Tags

Tag API Endpoints Documentation

getTagInformation

Syntax:

#JS
myInstagram.getTagInformation(tag);

Arguments:

  1. tag - (string)

Events
tagInformation

getTagMedia

Syntax:

#JS
myInstagram.getTagMedia(tag);

Arguments:

  1. tag - (string)

Events
mediaData

searchTag

Syntax:

#JS
myInstagram.searchTag(input);

Arguments:

  1. input - (string)

Events
tagSearch

User

This Endpoints require and authorized user.
User API Endpoints Documentation

getUser

getFeed

getUserMedia

searchTag

getLikedMedia

searchUser

Relationship

This Endpoints require and authorized user.
Relationship API Endpoints Documentation

getFollows

getFollowedBy

getRequestedBy

getRelationship

Comment

This Endpoints require and authorized user.
Comment API Endpoints Documentation

getComments

Like

This Endpoints require and authorized user.
Like API Endpoints Documentation

getLikes

Location

Location API Endpoints Documentation

getLocation

getLocationMedia

searchLocation