Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

trying for a cleaner design paradigm

  • Loading branch information...
commit 443d716b29d1f9085090eb8949c5a8f63cc1782e 1 parent 9e2819f
@Swizec authored
Showing with 7 additions and 2 deletions.
  1. +6 −1 index.js
  2. +1 −1  tests.js
View
7 index.js
@@ -6,9 +6,14 @@ var http = require('http'),
function InstagramClient() {
this.client_id = '';
this.client_secret = '';
+
+ this.media = new InstagramMediaClient();
+}
+
+function InstagramMediaClient() {
}
-InstagramClient.prototype.media = function (id, callback) {
+InstagramMediaClient.prototype.id = function (id, callback) {
var options = {
host: 'api.instagram.com',
path: '/v1/media/'+id+'?client_id='+this.client_id
View
2  tests.js
@@ -6,7 +6,7 @@ var instagram = require('./index.js').createClient('a8d764b1a7fe4089959910ee6bdc
exports.testMediaFetchById = function (test) {
test.expect(2);
- instagram.media(100, function (media, error) {
+ instagram.media.id(100, function (media, error) {
test.ok(media['type']);
test.equal(error, null, "Returned an error");
Please sign in to comment.
Something went wrong with that request. Please try again.