#JS SDK FOR INSTAGRAM APIs
This simple sdk written in CoffeeScript is for front-end developers to build applications with instagram apis easily. The script is based on jquery
##Usage
Integrate sdk with your application
<script src="jquery.js"></script>
<script src="instagram-js-sdk.min.js"></script>
Create a new instance of Instagram object
var IG = new Instagram();
Handle authorize
var param = {
client_id : YOUR_CLIENT_ID,
redirect_uri : YOUR_REDIRECT_URI,
scope : YOUR_SCOPE,
response_type: 'token'
}
IG.auth( param ); //then will go to the authorize page
//handle the fn token
var token = IG.getToken();
//you need to set token before you use it
IG.setOptions( {
token: token
} );
//or without using token
IG.setOptions({
client_id: your_client_id
})
//you code...
##API LIST
Details
fn: callback function
Params: object of params that customize the request defined by instagram apis
Basic params: count, max_id, min_id
Search
- searchUser( q, fn, params )
- searchPhoto( fn, params )
- searchTag( fn, params )
- searchLocation( fn, params )
Current User
- currentUser(fn) //return the basic info about the current auth user
- getFeeds( fn, params )
- getLikes( fn, params )
- getReqs( fn )
- getIdByName(name, fn) //return the user id or false if the user doesn't exist.
User
- getUser( uid, fn )
- getPhotos( uid, fn, params )
- getFollowing( uid, fn )
- getFans( uid, fn )
Relationship
- getRelationship( uid, fn )
- isPrivate( uid, fn )
- isFollowing( uid, fn )
- isFollowedBy( uid, fn )
- follow( uid, fn )
- unfollow( uid, fn )
- block( uid, fn )
- unblock( uid, fn )
- approve( uid, fn )
- deny( uid, fn )
Media
- getPhoto( pid, fn, params )
- getPopular( fn, params )
Comments
- getComments( pid, fn, params )
- postComment( pid, fn, params )
- deleteComment( pid, fn )
Likes
- getLikes( pid, fn, params )
- addLike( pid, fn )
- deleteLike( pid, fn )
Tags
- getTag( tagName, fn, params )
- getRecentTags( tagName, fn, params )
Locations
- getLocation( locId, fn, params )
- getRecentLocations( locId, fn, params )
Geography
- getNearBy( geoId, fn, params )
##Todo
- error handling
- remove jquery dependency
- ajax module
- object extend module