Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added API endpoint for user related request

  • Loading branch information...
commit 2601b018ae90903b2f2991b1c691b94b797797d3 1 parent 0816bab
Florian Brandel authored
Showing with 24 additions and 0 deletions.
  1. +24 −0 index.js
24 index.js
View
@@ -11,6 +11,7 @@ function InstagramClient(client_id, client_secret) {
this.media = new InstagramMediaClient(this);
this.tags = new InstagramTagsClient(this);
this.locations = new InstagramLocationsClient(this);
+ this.users = new InstagramUsersClient(this);
}
InstagramClient.prototype.fetch = function (path, params, callback) {
@@ -114,7 +115,30 @@ InstagramLocationsClient.prototype.search = function (params, callback) {
this.parent.fetch('/v1/locations/search', params, callback);
}
+function InstagramUsersClient (parent) {
+ this.parent = parent;
+}
+
+InstagramUsersClient.prototype.id = function (id, callback) {
+ this.parent.fetch('/v1/users/'+id, callback);
+}
+
+InstagramUsersClient.prototype.media = function (id, params, callback) {
+ this.parent.fetch('/v1/users/'+id+'/media/recent', params, callback);
+}
+
+InstagramUsersClient.prototype.self = function (params, callback) {
+ this.parent.fetch('/v1/users/self/feed', params, callback);
+}
+InstagramUsersClient.prototype.search = function (params, callback) {
+ if (typeof params == "string") {
+ params = {
+ q: params
+ }
+ }
+ this.parent.fetch('/v1/users/search/', params, callback);
+}
exports.createClient = function (client_id, client_secret) {
var instagram_client = new InstagramClient(client_id, client_secret);
Please sign in to comment.
Something went wrong with that request. Please try again.