Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove node_modules folder from repo

  • Loading branch information...
commit a2a26172b7c0b7c211f3700921358c338700cd3b 1 parent 1da0c98
@rogeriopvl authored
Showing with 52 additions and 3,333 deletions.
  1. +1 −0  .gitignore
  2. +0 −22 node_modules/colors/MIT-LICENSE.txt
  3. +0 −77 node_modules/colors/ReadMe.md
  4. +0 −269 node_modules/colors/colors.js
  5. +0 −74 node_modules/colors/example.html
  6. +0 −65 node_modules/colors/example.js
  7. +0 −19 node_modules/colors/package.json
  8. +0 −65 node_modules/colors/test.js
  9. +0 −8 node_modules/instagram-node-lib/.npmignore
  10. +0 −44 node_modules/instagram-node-lib/HISTORY.md
  11. +0 −15 node_modules/instagram-node-lib/LICENSE.md
  12. +0 −508 node_modules/instagram-node-lib/README.md
  13. +0 −48 node_modules/instagram-node-lib/lib/class.instagram.geographies.js
  14. +0 −245 node_modules/instagram-node-lib/lib/class.instagram.js
  15. +0 −50 node_modules/instagram-node-lib/lib/class.instagram.locations.js
  16. +0 −116 node_modules/instagram-node-lib/lib/class.instagram.media.js
  17. +0 −52 node_modules/instagram-node-lib/lib/class.instagram.oauth.js
  18. +0 −127 node_modules/instagram-node-lib/lib/class.instagram.subscriptions.js
  19. +0 −50 node_modules/instagram-node-lib/lib/class.instagram.tags.js
  20. +0 −145 node_modules/instagram-node-lib/lib/class.instagram.users.js
  21. +0 −44 node_modules/instagram-node-lib/package.json
  22. +0 −47 node_modules/instagram-node-lib/test/helpers.js
  23. +0 −158 node_modules/instagram-node-lib/test/initialize.js
  24. +0 −79 node_modules/instagram-node-lib/test/instagram.geographies.js
  25. +0 −55 node_modules/instagram-node-lib/test/instagram.js
  26. +0 −142 node_modules/instagram-node-lib/test/instagram.locations.js
  27. +0 −181 node_modules/instagram-node-lib/test/instagram.media.js
  28. +0 −106 node_modules/instagram-node-lib/test/instagram.oauth.js
  29. +0 −108 node_modules/instagram-node-lib/test/instagram.subscriptions.js
  30. +0 −139 node_modules/instagram-node-lib/test/instagram.tags.js
  31. +0 −238 node_modules/instagram-node-lib/test/instagram.users.js
  32. +51 −37 package.json
View
1  .gitignore
@@ -1,2 +1,3 @@
.DS_Store
+node_modules
photos/
View
22 node_modules/colors/MIT-LICENSE.txt
@@ -1,22 +0,0 @@
-Copyright (c) 2010
-
-Marak Squires
-Alexis Sellier (cloudhead)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
View
77 node_modules/colors/ReadMe.md
@@ -1,77 +0,0 @@
-# colors.js - get color and style in your node.js console ( and browser ) like what
-
-<img src="http://i.imgur.com/goJdO.png" border = "0"/>
-
-
-## Installation
-
- npm install colors
-
-## colors and styles!
-
-- bold
-- italic
-- underline
-- inverse
-- yellow
-- cyan
-- white
-- magenta
-- green
-- red
-- grey
-- blue
-- rainbow
-- zebra
-- random
-
-## Usage
-
-``` js
-var colors = require('./colors');
-
-console.log('hello'.green); // outputs green text
-console.log('i like cake and pies'.underline.red) // outputs red underlined text
-console.log('inverse the color'.inverse); // inverses the color
-console.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces)
-```
-
-# Creating Custom themes
-
-```js
-
-var require('colors');
-
-colors.setTheme({
- silly: 'rainbow',
- input: 'grey',
- verbose: 'cyan',
- prompt: 'grey',
- info: 'green',
- data: 'grey',
- help: 'cyan',
- warn: 'yellow',
- debug: 'blue',
- error: 'red'
-});
-
-// outputs red text
-console.log("this is an error".error);
-
-// outputs yellow text
-console.log("this is a warning".warn);
-```
-
-
-### Contributors
-
-Marak (Marak Squires)
-Alexis Sellier (cloudhead)
-mmalecki (Maciej Małecki)
-nicoreed (Nico Reed)
-morganrallen (Morgan Allen)
-JustinCampbell (Justin Campbell)
-ded (Dustin Diaz)
-
-
-#### , Marak Squires , Justin Campbell, Dustin Diaz (@ded)
View
269 node_modules/colors/colors.js
@@ -1,269 +0,0 @@
-/*
-colors.js
-
-Copyright (c) 2010
-
-Marak Squires
-Alexis Sellier (cloudhead)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-*/
-
-var isHeadless = false;
-
-if (typeof module !== 'undefined') {
- isHeadless = true;
-}
-
-if (!isHeadless) {
- var exports = {};
- var module = {};
- var colors = exports;
- exports.mode = "browser";
-} else {
- exports.mode = "console";
-}
-
-//
-// Prototypes the string object to have additional method calls that add terminal colors
-//
-var addProperty = function (color, func) {
- var allowOverride = ['bold'];
- exports[color] = function(str) {
- return func.apply(str);
- };
- String.prototype.__defineGetter__(color, func);
-}
-
-//
-// Iterate through all default styles and colors
-//
-
-var x = ['bold', 'underline', 'italic', 'inverse', 'grey', 'black', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta'];
-x.forEach(function (style) {
-
- // __defineGetter__ at the least works in more browsers
- // http://robertnyman.com/javascript/javascript-getters-setters.html
- // Object.defineProperty only works in Chrome
- addProperty(style, function () {
- return stylize(this, style);
- });
-});
-
-function sequencer(map) {
- return function () {
- if (!isHeadless) {
- return this.replace(/( )/, '$1');
- }
- var exploded = this.split("");
- var i = 0;
- exploded = exploded.map(map);
- return exploded.join("");
- }
-}
-
-var rainbowMap = (function () {
- var rainbowColors = ['red','yellow','green','blue','magenta']; //RoY G BiV
- return function (letter, i, exploded) {
- if (letter == " ") {
- return letter;
- } else {
- return stylize(letter, rainbowColors[i++ % rainbowColors.length]);
- }
- }
-})();
-
-exports.addSequencer = function (name, map) {
- addProperty(name, sequencer(map));
-}
-
-exports.addSequencer('rainbow', rainbowMap);
-exports.addSequencer('zebra', function (letter, i, exploded) {
- return i % 2 === 0 ? letter : letter.inverse;
-});
-
-exports.setTheme = function (theme) {
- Object.keys(theme).forEach(function(prop){
- addProperty(prop, function(){
- return exports[theme[prop]](this);
- });
- });
-}
-
-function stylize(str, style) {
-
- if (exports.mode == 'console') {
- var styles = {
- //styles
- 'bold' : ['\033[1m', '\033[22m'],
- 'italic' : ['\033[3m', '\033[23m'],
- 'underline' : ['\033[4m', '\033[24m'],
- 'inverse' : ['\033[7m', '\033[27m'],
- //grayscale
- 'white' : ['\033[37m', '\033[39m'],
- 'grey' : ['\033[90m', '\033[39m'],
- 'black' : ['\033[30m', '\033[39m'],
- //colors
- 'blue' : ['\033[34m', '\033[39m'],
- 'cyan' : ['\033[36m', '\033[39m'],
- 'green' : ['\033[32m', '\033[39m'],
- 'magenta' : ['\033[35m', '\033[39m'],
- 'red' : ['\033[31m', '\033[39m'],
- 'yellow' : ['\033[33m', '\033[39m']
- };
- } else if (exports.mode == 'browser') {
- var styles = {
- //styles
- 'bold' : ['<b>', '</b>'],
- 'italic' : ['<i>', '</i>'],
- 'underline' : ['<u>', '</u>'],
- 'inverse' : ['<span style="background-color:black;color:white;">', '</span>'],
- //grayscale
- 'white' : ['<span style="color:white;">', '</span>'],
- 'grey' : ['<span style="color:grey;">', '</span>'],
- 'black' : ['<span style="color:black;">', '</span>'],
- //colors
- 'blue' : ['<span style="color:blue;">', '</span>'],
- 'cyan' : ['<span style="color:cyan;">', '</span>'],
- 'green' : ['<span style="color:green;">', '</span>'],
- 'magenta' : ['<span style="color:magenta;">', '</span>'],
- 'red' : ['<span style="color:red;">', '</span>'],
- 'yellow' : ['<span style="color:yellow;">', '</span>']
- };
- } else if (exports.mode == 'none') {
- return str;
- } else {
- console.log('unsupported mode, try "browser", "console" or "none"');
- }
- return styles[style][0] + str + styles[style][1];
-};
-
-// don't summon zalgo
-addProperty('zalgo', function () {
- return zalgo(this);
-});
-
-// please no
-function zalgo(text, options) {
- var soul = {
- "up" : [
- '̍','̎','̄','̅',
- '̿','̑','̆','̐',
- '͒','͗','͑','̇',
- '̈','̊','͂','̓',
- '̈','͊','͋','͌',
- '̃','̂','̌','͐',
- '̀','́','̋','̏',
- '̒','̓','̔','̽',
- '̉','ͣ','ͤ','ͥ',
- 'ͦ','ͧ','ͨ','ͩ',
- 'ͪ','ͫ','ͬ','ͭ',
- 'ͮ','ͯ','̾','͛',
- '͆','̚'
- ],
- "down" : [
- '̖','̗','̘','̙',
- '̜','̝','̞','̟',
- '̠','̤','̥','̦',
- '̩','̪','̫','̬',
- '̭','̮','̯','̰',
- '̱','̲','̳','̹',
- '̺','̻','̼','ͅ',
- '͇','͈','͉','͍',
- '͎','͓','͔','͕',
- '͖','͙','͚','̣'
- ],
- "mid" : [
- '̕','̛','̀','́',
- '͘','̡','̢','̧',
- '̨','̴','̵','̶',
- '͜','͝','͞',
- '͟','͠','͢','̸',
- '̷','͡',' ҉'
- ]
- },
- all = [].concat(soul.up, soul.down, soul.mid),
- zalgo = {};
-
- function randomNumber(range) {
- r = Math.floor(Math.random()*range);
- return r;
- };
-
- function is_char(character) {
- var bool = false;
- all.filter(function(i){
- bool = (i == character);
- });
- return bool;
- }
-
- function heComes(text, options){
- result = '';
- options = options || {};
- options["up"] = options["up"] || true;
- options["mid"] = options["mid"] || true;
- options["down"] = options["down"] || true;
- options["size"] = options["size"] || "maxi";
- var counts;
- text = text.split('');
- for(var l in text){
- if(is_char(l)) { continue; }
- result = result + text[l];
-
- counts = {"up" : 0, "down" : 0, "mid" : 0};
-
- switch(options.size) {
- case 'mini':
- counts.up = randomNumber(8);
- counts.min= randomNumber(2);
- counts.down = randomNumber(8);
- break;
- case 'maxi':
- counts.up = randomNumber(16) + 3;
- counts.min = randomNumber(4) + 1;
- counts.down = randomNumber(64) + 3;
- break;
- default:
- counts.up = randomNumber(8) + 1;
- counts.mid = randomNumber(6) / 2;
- counts.down= randomNumber(8) + 1;
- break;
- }
-
- var arr = ["up", "mid", "down"];
- for(var d in arr){
- var index = arr[d];
- for (var i = 0 ; i <= counts[index]; i++)
- {
- if(options[index]) {
- result = result + soul[index][randomNumber(soul[index].length)];
- }
- }
- }
- }
- return result;
- };
- return heComes(text);
-}
-
-addProperty('stripColors', function() {
- return ("" + this).replace(/\u001b\[\d+m/g,'');
-});
View
74 node_modules/colors/example.html
@@ -1,74 +0,0 @@
-<!DOCTYPE HTML>
-<html lang="en-us">
- <head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8">
- <title>Colors Example</title>
- <script src="colors.js"></script>
- </head>
- <body>
- <script>
-
- var test = colors.red("hopefully colorless output");
-
- document.write('Rainbows are fun!'.rainbow + '<br/>');
- document.write('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported
- document.write('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported
- //document.write('zalgo time!'.zalgo);
- document.write(test.stripColors);
- document.write("a".grey + " b".black);
-
- document.write("Zebras are so fun!".zebra);
-
- document.write(colors.rainbow('Rainbows are fun!'));
- document.write(colors.italic('So ') + colors.underline('are') + colors.bold(' styles! ') + colors.inverse('inverse')); // styles not widely supported
- document.write(colors.bold(colors.italic(colors.underline(colors.red('Chains are also cool.'))))); // styles not widely supported
- //document.write(colors.zalgo('zalgo time!'));
- document.write(colors.stripColors(test));
- document.write(colors.grey("a") + colors.black(" b"));
-
- colors.addSequencer("america", function(letter, i, exploded) {
- if(letter === " ") return letter;
- switch(i%3) {
- case 0: return letter.red;
- case 1: return letter.white;
- case 2: return letter.blue;
- }
- });
-
- colors.addSequencer("random", (function() {
- var available = ['bold', 'underline', 'italic', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta'];
-
- return function(letter, i, exploded) {
- return letter === " " ? letter : letter[available[Math.round(Math.random() * (available.length - 1))]];
- };
- })());
-
- document.write("AMERICA! F--K YEAH!".america);
- document.write("So apparently I've been to Mars, with all the little green men. But you know, I don't recall.".random);
-
- //
- // Custom themes
- //
-
- colors.setTheme({
- silly: 'rainbow',
- input: 'grey',
- verbose: 'cyan',
- prompt: 'grey',
- info: 'green',
- data: 'grey',
- help: 'cyan',
- warn: 'yellow',
- debug: 'blue',
- error: 'red'
- });
-
- // outputs red text
- document.write("this is an error".error);
-
- // outputs yellow text
- document.write("this is a warning".warn);
-
- </script>
- </body>
-</html>
View
65 node_modules/colors/example.js
@@ -1,65 +0,0 @@
-var colors = require('./colors');
-
-//colors.mode = "browser";
-
-var test = colors.red("hopefully colorless output");
-console.log('Rainbows are fun!'.rainbow);
-console.log('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported
-console.log('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported
-//console.log('zalgo time!'.zalgo);
-console.log(test.stripColors);
-console.log("a".grey + " b".black);
-
-console.log("Zebras are so fun!".zebra);
-
-console.log(colors.rainbow('Rainbows are fun!'));
-console.log(colors.italic('So ') + colors.underline('are') + colors.bold(' styles! ') + colors.inverse('inverse')); // styles not widely supported
-console.log(colors.bold(colors.italic(colors.underline(colors.red('Chains are also cool.'))))); // styles not widely supported
-//console.log(colors.zalgo('zalgo time!'));
-console.log(colors.stripColors(test));
-console.log(colors.grey("a") + colors.black(" b"));
-
-colors.addSequencer("america", function(letter, i, exploded) {
- if(letter === " ") return letter;
- switch(i%3) {
- case 0: return letter.red;
- case 1: return letter.white;
- case 2: return letter.blue;
- }
-});
-
-colors.addSequencer("random", (function() {
- var available = ['bold', 'underline', 'italic', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta'];
-
- return function(letter, i, exploded) {
- return letter === " " ? letter : letter[available[Math.round(Math.random() * (available.length - 1))]];
- };
-})());
-
-console.log("AMERICA! F--K YEAH!".america);
-console.log("So apparently I've been to Mars, with all the little green men. But you know, I don't recall.".random);
-
-//
-// Custom themes
-//
-
-colors.setTheme({
- silly: 'rainbow',
- input: 'grey',
- verbose: 'cyan',
- prompt: 'grey',
- info: 'green',
- data: 'grey',
- help: 'cyan',
- warn: 'yellow',
- debug: 'blue',
- error: 'red'
-});
-
-// outputs red text
-console.log("this is an error".error);
-
-// outputs yellow text
-console.log("this is a warning".warn);
-
-
View
19 node_modules/colors/package.json
@@ -1,19 +0,0 @@
-{
- "name": "colors",
- "description": "get colors in your node.js console like what",
- "version": "0.6.0-1",
- "author": {
- "name": "Marak Squires"
- },
- "repository": {
- "type": "git",
- "url": "http://github.com/Marak/colors.js.git"
- },
- "engines": {
- "node": ">=0.1.90"
- },
- "main": "colors",
- "readme": "# colors.js - get color and style in your node.js console ( and browser ) like what\n\n<img src=\"http://i.imgur.com/goJdO.png\" border = \"0\"/>\n\n\n## Installation\n\n npm install colors\n\n## colors and styles!\n\n- bold\n- italic\n- underline\n- inverse\n- yellow\n- cyan\n- white\n- magenta\n- green\n- red\n- grey\n- blue\n- rainbow\n- zebra\n- random\n\n## Usage\n\n``` js\nvar colors = require('./colors');\n\nconsole.log('hello'.green); // outputs green text\nconsole.log('i like cake and pies'.underline.red) // outputs red underlined text\nconsole.log('inverse the color'.inverse); // inverses the color\nconsole.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces)\n```\n\n# Creating Custom themes\n\n```js\n\nvar require('colors');\n\ncolors.setTheme({\n silly: 'rainbow',\n input: 'grey',\n verbose: 'cyan',\n prompt: 'grey',\n info: 'green',\n data: 'grey',\n help: 'cyan',\n warn: 'yellow',\n debug: 'blue',\n error: 'red'\n});\n\n// outputs red text\nconsole.log(\"this is an error\".error);\n\n// outputs yellow text\nconsole.log(\"this is a warning\".warn);\n```\n\n\n### Contributors \n\nMarak (Marak Squires)\nAlexis Sellier (cloudhead)\nmmalecki (Maciej Małecki)\nnicoreed (Nico Reed)\nmorganrallen (Morgan Allen)\nJustinCampbell (Justin Campbell)\nded (Dustin Diaz)\n\n\n#### , Marak Squires , Justin Campbell, Dustin Diaz (@ded)\n",
- "_id": "colors@0.6.0-1",
- "_from": "colors"
-}
View
65 node_modules/colors/test.js
@@ -1,65 +0,0 @@
-var assert = require('assert'),
- colors = require('./colors');
-
-//
-// This is a pretty nice example on how tests shouldn't be written. However,
-// it's more about API stability than about really testing it (although it's
-// a pretty complete test suite).
-//
-
-var s = 'string';
-
-function a(s, code) {
- return '\033[' + code.toString() + 'm' + s + '\033[39m';
-}
-
-function aE(s, color, code) {
- assert.equal(s[color], a(s, code));
- assert.equal(colors[color](s), a(s, code));
- assert.equal(s[color], colors[color](s));
- assert.equal(s[color].stripColors, s);
- assert.equal(s[color].stripColors, colors.stripColors(s));
-}
-
-function h(s, color) {
- return '<span style="color:' + color + ';">' + s + '</span>';
- // that's pretty dumb approach to testing it
-}
-
-var stylesColors = ['white', 'grey', 'black', 'blue', 'cyan', 'green', 'magenta', 'red', 'yellow'];
-var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', 'rainbow']);
-
-colors.mode = 'console';
-assert.equal(s.bold, '\033[1m' + s + '\033[22m');
-assert.equal(s.italic, '\033[3m' + s + '\033[23m');
-assert.equal(s.underline, '\033[4m' + s + '\033[24m');
-assert.equal(s.inverse, '\033[7m' + s + '\033[27m');
-assert.ok(s.rainbow);
-aE(s, 'white', 37);
-aE(s, 'grey', 90);
-aE(s, 'black', 30);
-aE(s, 'blue', 34);
-aE(s, 'cyan', 36);
-aE(s, 'green', 32);
-aE(s, 'magenta', 35);
-aE(s, 'red', 31);
-aE(s, 'yellow', 33);
-assert.equal(s, 'string');
-
-colors.mode = 'browser';
-assert.equal(s.bold, '<b>' + s + '</b>');
-assert.equal(s.italic, '<i>' + s + '</i>');
-assert.equal(s.underline, '<u>' + s + '</u>');
-assert.equal(s.inverse, '<span style="background-color:black;color:white;">' + s + '</span>');
-assert.ok(s.rainbow);
-stylesColors.forEach(function (color) {
- assert.equal(s[color], h(s, color));
- assert.equal(colors[color](s), h(s, color));
-});
-
-colors.mode = 'none';
-stylesAll.forEach(function (style) {
- assert.equal(s[style], s);
- assert.equal(colors[style](s), s);
-});
-
View
8 node_modules/instagram-node-lib/.npmignore
@@ -1,8 +0,0 @@
-
-# Remove Coffeescript #
-#######################
-*.coffee
-
-# Remove Testing Environment #
-##############################
-*.sh
View
44 node_modules/instagram-node-lib/HISTORY.md
@@ -1,44 +0,0 @@
-
-0.1.0 / 2012-08-20
-==================
-
- * Fixed Issue #4 -- thanks to @joemccann for the suggestion/code
-
-0.0.7 / 2011-06-23
-==================
-
- * Added more control for server responses in oauth.ask_for_access_token
- * Added Instagram.oauth tests
- * Added Instagram.set tests
- * Added test server option (mostly for oauth testing)
-
-0.0.6 / 2011-06-09
-==================
-
- * Removed auto-response from ask_for_access_token
-
-0.0.5 / 2011-05-21
-==================
-
- * Added self/liked
-
-0.0.4 / 2011-05-03
-==================
-
- * Added additional tests
- * Handled ENOTCONN errors (IG closes the connection fast)
-
-0.0.3 / 2011-04-15
-==================
-
- * Added OAuth methods
-
-0.0.2 / 2011-04-10
-==================
-
- * Updated name and published through npm
-
-0.0.1 / 2011-04-07
-==================
-
- * Initial release
View
15 node_modules/instagram-node-lib/LICENSE.md
@@ -1,15 +0,0 @@
-
-## License
-
-(The MIT X License)
-
-Copyright (c) 2011 David W. McKelvey &lt;david@mckelveycreative.com&gt;
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-Except as contained in this notice, the name(s) of the above copyright holders shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization.
-
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
508 node_modules/instagram-node-lib/README.md
@@ -1,508 +0,0 @@
-## What It Is
-
-The Instagram Node Lib is a helper library for [node](http://nodejs.org) that makes communicating with the [Instagram API](http://instagram.com/developer/) easy.
-
-## Simple Example
-
-Following is an example that loads the library, sets my CLIENT_ID and CLIENT_SECRET for accessing the API and makes a simple call to get information on the tag `#blue`.
-
- Instagram = require('instagram-node-lib');
-
- Instagram.set('client_id', 'YOUR-CLIENT-ID');
- Instagram.set('client_secret', 'YOUR-CLIENT-SECRET');
-
- Instagram.tags.info({
- name: 'blue',
- complete: function(data){
- console.log(data);
- }
- });
-
-When successful, the data logged in the console would be a javascript object like `{ media_count: 10863, name: 'blue' }`.
-
-## Installation
-
- $ npm install instagram-node-lib
-
-## Setup
-
-To use the library, you'll need to require it and at minimum, set your CLIENT_ID and CLIENT_SECRET given to you by Instagram.
-
- Instagram = require('instagram-node-lib');
-
- Instagram.set('client_id', 'YOUR-CLIENT-ID');
- Instagram.set('client_secret', 'YOUR-CLIENT-SECRET');
-
-Optionally, if you intend to use the real-time API to manage subscriptions, then you can also set a global callback url. (You may also provide/override the callback url when subscribing.)
-
- Instagram.set('callback_url', 'CALLBACK-URL');
-
-If you intend to use user-specific methods (e.g. relationships), then you must also set a global redirect_uri (matching that in your [app settings in the API](http://instagram.com/developer/manage/)).
-
- Instagram.set('redirect_uri', 'YOUR-REDIRECT-URI');
-
-Lastly, if you find that the default max sockets of 5 is too few for the http(s) client, you can increase it as needed with the set method. The new max sockets value must be a positive integer greater than zero.
-
- Instagram.set('maxSockets', 10);
-
-## Available Methods
-
-All of the methods below follow a similar pattern. Each accepts a single javascript object with the needed parameters to complete the API call. Required parameters are shown below; refer to [the API docs](http://instagram.com/developer/endpoints/) for the optional parameters. All parameters are passed through to the request, so use the exact terms that the API docs provide.
-
-In addition, the parameters object may include two functions, one of which will be executed at the conclusion of the request (i.e. `complete` and `error`).
-
- {
- name: 'blue',
- complete: function(data, pagination){
- // data is a javascript object/array/null matching that shipped Instagram
- // when available (mostly /recent), pagination is a javascript object with the pagination information
- },
- error: function(errorMessage, errorObject, caller){
- // errorMessage is the raised error message
- // errorObject is either the object that caused the issue, or the nearest neighbor
- // caller is the method in which the error occurred
- }
- }
-
-In the event you do not provide a `complete` or `error` function, the library has fallback functions which post results to the console log.
-
-### Media
-
-The following media methods are available. Required parameters are shown below, see the [Instagram API docs](http://instagram.com/developer/endpoints/media/) for the optional parameters.
-
-#### Popular
-
-Get the a set of 32 current popular media, each with all it's associated likes and comments.
-
- Instagram.media.popular();
- -> [ { media object },
- { media object },
- { media object }, ... ]
-
-#### Info
-
-Get the metadata for a single media item by media id.
-
- Instagram.media.info({ media_id: 3 });
- -> { media object }
-
-#### Search
-
-With a latitude and longitude (and an optional distance), find nearby media by geography.
-
- Instagram.media.search({ lat: 48.858844300000001, lng: 2.2943506 });
- -> [ { media object },
- { media object },
- { media object }, ... ]
-
-#### Likes
-
-Akin to an info request, this method only returns an array of likers for the media.
-
- Instagram.media.likes({ media_id: 3 });
- -> [ { username: 'krisrak',
- profile_picture: 'http://profile/path.jpg',
- id: '#',
- full_name: 'Rak Kris' },
- { username: 'mikeyk',
- profile_picture: 'http://profile/path.jpg',
- id: '#',
- full_name: 'Mike Krieger' } ]
-
-Using an `access_token`, you can have the token user like or unlike a media item.
-
- Instagram.media.like({ media_id: 3 });
- -> null // null is success, an error is failure
-
- Instagram.media.unlike({ media_id: 3 });
- -> null // null is success, an error is failure
-
-#### Comments
-
-Akin to an info request, this method only returns an array of comments on the media.
-
- Instagram.media.comments({ media_id: 3 });
- -> [ { created_time: '1279306830',
- text: 'Love the sign here',
- from:
- { username: 'mikeyk',
- profile_picture: 'http://profile/path.jpg',
- id: '#',
- full_name: 'Mike Krieger' },
- id: '8' },
- { created_time: '1279315804',
- text: 'Chilako taco',
- from:
- { username: 'kevin',
- profile_picture: 'http://profile/path.jpg',
- id: '#',
- full_name: 'Kevin Systrom' },
- id: '3' } ]
-
-Using an `access_token`, you can have the token user comment upon or delete their comment from a media item.
-
- Instagram.media.comment({ media_id: 3, text: 'Instagame was here.' });
- -> { created_time: '1302926497',
- text: 'Instagame was here.',
- from:
- { username: 'instagame',
- profile_picture: 'http://profile/path.jpg',
- id: '#',
- full_name: '' },
- id: '67236858' }
-
- Instagram.media.uncomment({ media_id: 3, comment_id: 67236858 });
- -> null // null is success, an error is failure
-
-#### Subscriptions
-
-Geography subscriptions for media are also available with the following methods. A `callback_url` is required if not specified globally, and you may also provide a `verify_token` if you want to keep track of which subscription is coming back. Note that while `unsubscribe` is identical to the generic subscriptions method below, here, `unsubscribe_all` only removes geography subscriptions.
-
- Instagram.media.subscribe({ lat: 48.858844300000001, lng: 2.2943506, radius: 1000 });
- -> { object: 'geography',
- object_id: '#',
- aspect: 'media',
- callback_url: 'http://your.callback/path',
- type: 'subscription',
- id: '#' }
-
- Instagram.media.unsubscribe({ id: # });
- -> null // null is success, an error is failure
-
- Instagram.media.unsubscribe_all();
- -> null // null is success, an error is failure
-
-### Tags
-
-The following tag methods are available. Required parameters are shown below, see the [Instagram API docs](http://instagram.com/developer/endpoints/tags/) for the optional parameters.
-
-#### Info
-
-Get the metadata for a single tag by name.
-
- Instagram.tags.info({ name: 'blue' });
- -> { media_count: 10863, name: 'blue' }
-
-#### Recent
-
-Get an array of media that have been tagged with the tag recently.
-
- Instagram.tags.recent({ name: 'blue' });
- -> [ { media object },
- { media object },
- { media object }, ... ]
-
-#### Search
-
-Search for matching tags by name (q).
-
- Instagram.tags.search({ q: 'blue' });
- -> [ { media_count: 10872, name: 'blue' },
- { media_count: 931, name: 'bluesky' },
- { media_count: 178, name: 'blueeyes' }, ... ]
-
-#### Subscriptions
-
-Tag subscriptions are also available with the following methods. A `callback_url` is required if not specified globally, and you may also provide a `verify_token` if you want to keep track of which subscription is coming back. Note that while `unsubscribe` is identical to the generic subscriptions method below, here, `unsubscribe_all` only removes tag subscriptions.
-
- Instagram.tags.subscribe({ object_id: 'blue' });
- -> { object: 'tag',
- object_id: 'blue',
- aspect: 'media',
- callback_url: 'http://your.callback/path',
- type: 'subscription',
- id: '#' }
-
- Instagram.tags.unsubscribe({ id: # });
- -> null // null is success, an error is failure
-
- Instagram.tags.unsubscribe_all();
- -> null // null is success, an error is failure
-
-### Locations
-
-The following location methods are available. Required parameters are shown below, see the [Instagram API docs](http://instagram.com/developer/endpoints/locations/) for the optional parameters.
-
-#### Info
-
-Get the metadata for a single location by location id.
-
- Instagram.locations.info({ location_id: 1 });
- -> { latitude: 37.78265474565738,
- id: '1',
- longitude: -122.387866973877,
- name: 'Dogpatch Labs' }
-
-#### Recent
-
-Get an array of media that have been located with the matching location (by id) recently.
-
- Instagram.locations.recent({ location_id: 1 });
- -> [ { media object },
- { media object },
- { media object }, ... ]
-
-#### Search
-
-With a latitude and longitude (and an optional distance), find nearby locations by geography.
-
- Instagram.locations.search({ lat: 48.858844300000001, lng: 2.2943506 });
- -> [ { latitude: 48.8588443,
- id: '723695',
- longitude: 2.2943506,
- name: 'Restaurant Jules Verne' },
- { latitude: 48.8588443,
- id: '788029',
- longitude: 2.2943506,
- name: 'Eiffel Tower, Paris' },
- { latitude: 48.858543,
- id: '1894075',
- longitude: 2.2938285,
- name: 'Caf� de l\'homme' }, ... ]
-
-#### Subscriptions
-
-Location subscriptions are also available with the following methods. A `callback_url` is required when subscribing if not specified globally, and you may also provide a `verify_token` if you want to keep track of which subscription is coming back. Note that while `unsubscribe` is identical to the generic subscriptions method below, here, `unsubscribe_all` only removes location subscriptions.
-
- Instagram.locations.subscribe({ object_id: '1257285' });
- -> { object: 'location',
- object_id: '1257285',
- aspect: 'media',
- callback_url: 'http://your.callback/path',
- type: 'subscription',
- id: '#' }
-
- Instagram.locations.unsubscribe({ id: # });
- -> null // null is success, an error is failure
-
- Instagram.locations.unsubscribe_all();
- -> null // null is success, an error is failure
-
-### Users
-
-The following user methods are available. Required parameters are shown below, see the [Instagram API docs](http://instagram.com/developer/endpoints/users/) for the optional parameters.
-
-#### Info
-
-Get the metadata for a single user by user id.
-
- Instagram.users.info({ user_id: 291024 });
- -> { username: 'mckelvey',
- counts: { media: 526, followed_by: 293, follows: 265 },
- profile_picture: 'http://profile/path.jpg',
- id: '291024',
- full_name: 'David McKelvey' }
-
-#### Search
-
-Search for matching users by name (q).
-
- Instagram.users.search({ q: 'mckelvey' });
- -> [ { username: 'mckelvey',
- profile_picture: 'http://profile/path.jpg',
- id: '291024',
- full_name: 'David McKelvey' }, ... ]
-
-#### Self
-
-Get the user media feed for the `access_token` supplied. This method obviously then requires `access_token` rather than simply `client_id`; see the OAuth section on obtaining an `access_token`. You can either supply it here or set it within the library.
-
- Instagram.users.self();
- -> [ { media object },
- { media object },
- { media object }, ... ]
-
-#### Liked by Self
-
-Get the media that has been liked by the user for the `access_token` supplied. This method obviously then requires `access_token` rather than simply `client_id`; see the OAuth section on obtaining an `access_token`. You can either supply it here or set it within the library.
-
- Instagram.users.liked_by_self();
- -> [ { media object },
- { media object },
- { media object }, ... ]
-
-#### Recent
-
-Get the user media feed for a user by user_id. This method requires `access_token` rather than simply `client_id` in case the requested user media is protected and the requesting user is not authorized to view the media; see the OAuth section on obtaining an `access_token`. You can either supply it here or set it within the library.
-
- Instagram.users.recent({ user_id: 291024 });
- -> [ { media object },
- { media object },
- { media object }, ... ]
-
-#### Relationships
-
-The following methods allow you to view and alter user-to-user relationships via an `access_token` (assuming the scope `relationships` has been authorized for the token). Do review the outgoing and incoming references in the [Instagram API Relationship Docs](http://instagram.com/developer/endpoints/relationships/) as they can be confusing since they act in relation to the `access_token` used. _I didn't have any users to fully test the request/approve/ignore against; let me know if you encounter difficulties._
-
- Instagram.users.follows({ user_id: 291024 });
- -> [ { username: 'mckelvey',
- profile_picture: 'http://profile/path.jpg',
- id: '291024',
- full_name: 'David McKelvey' }, ... ]
-
- Instagram.users.followed_by({ user_id: 291024 });
- -> [ { username: 'instagame',
- profile_picture: 'http://profile/path.jpg',
- id: '1340677',
- full_name: '' }, ... ]
-
- Instagram.users.requested_by({ user_id: 291024 });
- -> [ { username: 'instagame',
- profile_picture: 'http://profile/path.jpg',
- id: '1340677',
- full_name: '' }, ... ]
-
- Instagram.users.relationship({ user_id: 291024 });
- -> { outgoing_status: 'follows', // access_token user follows user 291024
- incoming_status: 'none' } // user 291024 has no relationship with the access_token user
-
- Instagram.users.follow({ user_id: 291024 });
- -> { outgoing_status: 'follows' } // success: access_token user follows user 291024
-
- Instagram.users.unfollow({ user_id: 291024 });
- -> { outgoing_status: 'none' } // success: access_token user no longer follows user 291024
-
- Instagram.users.block({ user_id: 291024 });
- -> { incoming_status: 'blocked_by_you' } // success: access_token user has blocked user 291024
-
- Instagram.users.unblock({ user_id: 291024 });
- -> { incoming_status: 'none' } // success: access_token user no longer blocks user 291024
-
- Instagram.users.approve({ user_id: 291024 });
- -> { incoming_status: 'followed_by' } // success: access_token user has allowed user 291024 to follow
-
- Instagram.users.ignore({ user_id: 291024 });
- -> { incoming_status: 'requested_by' } // success: access_token user has ignored user 291024's follow request
-
-#### Subscriptions
-
-User subscriptions are also available with the following methods. A `callback_url` is required when subscribing if not specified globally, and you may also provide a `verify_token` if you want to keep track of which subscription is coming back. Note that because Instagram user subscriptions are based on your API client's authenticated users, `unsubscribe` is equivalent to `unsubscribe_all`, so only `unsubscribe_all` is provided.
-
- Instagram.users.subscribe();
- -> { object: 'user',
- aspect: 'media',
- callback_url: 'http://your.callback/path',
- type: 'subscription',
- id: '#' }
-
- Instagram.users.unsubscribe_all();
- -> null // null is success, an error is failure
-
-### Real-time Subscriptions
-
-In addition to the above subscription methods within tags, locations and media, you can also interact with any subscription directly with the methods below. As with the others, it will be helpful to review the [Instagram API docs](http://instagram.com/developer/realtime/) for additional information.
-
-Be sure to include a GET route/method for the callback handshake at the `callback_url` that can handle the setup. This library includes a handshake method (example below based on Express), to which you can provide the request, the response and a complete method that will act upon the `verify_token` should you have provided it in the initial request.
-
- app.get('/subscribe', function(request, response){
- Instagram.subscriptions.handshake(request, response);
- });
-
-#### Subscribe
-
-The subscription request differs here in that it will not know what kind of object (tag, location, geography) to which you want to subscribe, so be sure to specify it. A `callback_url` is required when subscribing if not specified globally, and you may also provide a `verify_token` if you want to keep track of which subscription is coming back.
-
- Instagram.subscriptions.subscribe({ object: 'tag', object_id: 'blue' });
- -> { object: 'tag',
- object_id: 'blue',
- aspect: 'media',
- callback_url: 'http://your.callback/path',
- type: 'subscription',
- id: '#' }
-
-#### Subscriptions
-
-Retrieve a list of all your subscriptions.
-
- Instagram.subscriptions.list();
- -> [ { object: 'tag',
- object_id: 'blue',
- aspect: 'media',
- callback_url: 'http://your.callback/path',
- type: 'subscription',
- id: '#' }, ... ]
-
-#### Unsubscribe
-
-To unsubscribe from a single subscription, you must provide the subscription id.
-
- Instagram.subscriptions.unsubscribe({ id: # });
- -> null // null is success, an error is failure
-
-#### Unsubscribe All
-
-Unsubscribe from all subscriptions of all kinds.
-
- Instagram.subscriptions.unsubscribe_all();
- -> null // null is success, an error is failure
-
-## OAuth
-
-In order to perform specific methods upon user data, you will need to have authorization from them through [Instagram OAuth](http://instagram.com/developer/auth/). Several methods are provided so that you can request authorization from users. You will need to specify your redirect_uri from your [application setup at Instagram](http://instagram.com/developer/manage/).
-
- Instagram.set('redirect_uri', 'YOUR-REDIRECT-URI');
-
-#### Authorization Url
-
-To obtain a user url for the link to Instagram, use the authorization_url method. You can include the optional parameters as needed, but be sure to use spaces instead of pluses (as they will be encoded to pluses).
-
- url = Instagram.oauth.authorization_url({
- scope: 'comments likes' // use a space when specifying a scope; it will be encoded into a plus
- display: 'touch'
- });
-
-#### Ask for an Access Token
-
-The example below uses Express to specify a route to respond to the user's return from Instagram. It will pass the access_token and user object returned to a provided complete function. Your complete and error functions should handle your app server response (passed as a parameter for oauth only) *or* include a redirect parameter for simple redirects.
-
-If you choose to use the simple redirect, be advised that due to the event model of node.js, your users may reach the redirect address before the complete method is executed.
-
- app.get('/oauth', function(request, response){
- Instagram.oauth.ask_for_access_token({
- request: request,
- response: response,
- redirect: 'http://your.redirect/url', // optional
- complete: function(params, response){
- // params['access_token']
- // params['user']
- response.writeHead(200, {'Content-Type': 'text/plain'});
- // or some other response ended with
- response.end();
- },
- error: function(errorMessage, errorObject, caller, response){
- // errorMessage is the raised error message
- // errorObject is either the object that caused the issue, or the nearest neighbor
- // caller is the method in which the error occurred
- response.writeHead(406, {'Content-Type': 'text/plain'});
- // or some other response ended with
- response.end();
- }
- });
- return null;
- });
-
-## Developers
-
-Hey, this is my first Node.js project, my first NPM package, and my first public repo (and happy to finally be giving back for all the code I've enjoyed over the years). If you have suggestions please email me, register an issue, fork (dev please) and branch, etc. (You know the routine probably better than I.)
-
-If you add additional functionality, your pull request must have corresponding additional tests and supporting documentation.
-
-I've used [CoffeeScript](http://jashkenas.github.com/coffee-script) to write this library. If you haven't tried it, I highly recommend it. CoffeeScript takes some of the work out of javascript structures. Refer to the CoffeeScript docs for installation and usage.
-
-### Contributors
-
- * [Andrew Senter](https://github.com/andrewsenter)
- * [Olivier Balais](https://github.com/bobey)
- * [Joe McCann](https://github.com/joemccann)
-
-Both Andrew and Olivier suggested better ways of handling the server response when requesting a token during OAuth. Joe provided a correction for [issue #4](https://github.com/mckelvey/instagram-node-lib/issues/4).
-
-### Tests
-
-There is a test suite in the /tests folder with the tests I used to ensure the library functions as intended. If you're adding or changing functionality, please add to or update the corresponding tests before issuing a pull request. The tests require [Express](https://github.com/visionmedia/express), [Expresso](https://github.com/visionmedia/expresso) and [Should](https://github.com/visionmedia/should.js):
-
- npm install express
- npm install expresso
- npm install should
-
-In addition, either export or add to your shell profile your CLIENT_ID, CLIENT_SECRET, ACCESS_TOKEN (if applicable) and CALLBACK_URL so that they are available during testing.
View
48 node_modules/instagram-node-lib/lib/class.instagram.geographies.js
@@ -1,48 +0,0 @@
-// Generated by CoffeeScript 1.3.3
-
-/*
-Geographies
-*/
-
-
-(function() {
- var InstagramGeographies;
-
- InstagramGeographies = (function() {
-
- function InstagramGeographies(parent) {
- this.parent = parent;
- }
-
- InstagramGeographies.prototype.recent = function(params) {
- params['client_id'] = this.parent._config.client_id;
- params['path'] = "/" + this.parent._api_version + "/geographies/" + params['geography_id'] + "/media/recent?" + (this.parent._to_querystring(params));
- return this.parent._request(params);
- };
-
- /*
- Subscriptions
- */
-
-
- InstagramGeographies.prototype.subscribe = function(params) {
- params['object'] = 'geography';
- return this.parent.subscriptions._subscribe(params);
- };
-
- InstagramGeographies.prototype.unsubscribe = function(params) {
- return this.parent.subscriptions._unsubscribe(params);
- };
-
- InstagramGeographies.prototype.unsubscribe_all = function(params) {
- params['object'] = 'geography';
- return this.parent.subscriptions._unsubscribe(params);
- };
-
- return InstagramGeographies;
-
- })();
-
- module.exports = InstagramGeographies;
-
-}).call(this);
View
245 node_modules/instagram-node-lib/lib/class.instagram.js
@@ -1,245 +0,0 @@
-// Generated by CoffeeScript 1.3.3
-(function() {
- var APIClient, InstagramAPI, querystring;
-
- querystring = require('querystring');
-
- InstagramAPI = (function() {
-
- function InstagramAPI() {
- var module, moduleClass, _i, _len, _ref;
- this._api_version = 'v1';
- this._http_client = require('http');
- this._https_client = require('https');
- this._config = {
- client_id: process.env['CLIENT_ID'] != null ? process.env['CLIENT_ID'] : 'CLIENT-ID',
- client_secret: process.env['CLIENT_SECRET'] != null ? process.env['CLIENT_SECRET'] : 'CLIENT-SECRET',
- callback_url: process.env['CALLBACK_URL'] != null ? process.env['CALLBACK_URL'] : 'CALLBACK-URL',
- redirect_uri: process.env['REDIRECT_URI'] != null ? process.env['REDIRECT_URI'] : 'REDIRECT_URI',
- access_token: process.env['ACCESS_TOKEN'] != null ? process.env['ACCESS_TOKEN'] : null,
- maxSockets: 5
- };
- this._options = {
- host: process.env['TEST_HOST'] != null ? process.env['TEST_HOST'] : 'api.instagram.com',
- port: process.env['TEST_PORT'] != null ? process.env['TEST_PORT'] : null,
- method: "GET",
- path: '',
- headers: {
- 'User-Agent': 'Instagram Node Lib 0.0.9',
- 'Accept': 'application/json',
- 'Content-Length': 0
- }
- };
- _ref = ['media', 'tags', 'users', 'locations', 'geographies', 'subscriptions', 'oauth'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- module = _ref[_i];
- moduleClass = require("./class.instagram." + module);
- this[module] = new moduleClass(this);
- }
- }
-
- /*
- Generic Response Methods
- */
-
-
- InstagramAPI.prototype._error = function(e, value, caller) {
- var message;
- if (value === void 0) {
- value = '[undefined]';
- }
- if (value === null) {
- value = '[null]';
- }
- message = "" + e + " occurred: " + value + " in " + caller;
- console.log(message);
- return message;
- };
-
- InstagramAPI.prototype._complete = function(data, pagination) {
- var i;
- for (i in data) {
- console.log(data[i]);
- }
- if (pagination != null) {
- return console.log(pagination);
- }
- };
-
- /*
- Shared Data Manipulation Methods
- */
-
-
- InstagramAPI.prototype._to_querystring = function(params) {
- var i, obj;
- obj = {};
- for (i in params) {
- if (i !== 'complete' && i !== 'error') {
- obj[i] = params[i];
- }
- }
- return querystring.stringify(obj);
- };
-
- InstagramAPI.prototype._merge = function(obj1, obj2) {
- var i;
- for (i in obj2) {
- obj1[i] = obj2[i];
- }
- return obj1;
- };
-
- InstagramAPI.prototype._to_value = function(key, value) {
- if (typeof value !== 'object') {
- return value;
- }
- if (value[key] != null) {
- return value[key];
- }
- return null;
- };
-
- InstagramAPI.prototype._to_object = function(key, value) {
- var obj;
- if (typeof value === 'object' && (value[key] != null)) {
- return value;
- }
- obj = {};
- return obj[key] = value;
- };
-
- InstagramAPI.prototype._clone = function(from_object) {
- var property, to_object;
- to_object = {};
- for (property in from_object) {
- to_object[property] = from_object[property];
- }
- return to_object;
- };
-
- /*
- Set Methods
- */
-
-
- InstagramAPI.prototype._set_maxSockets = function(value) {
- if (parseInt(value) === value && value > 0) {
- this._http_client.Agent.defaultMaxSockets = value;
- return this._https_client.Agent.defaultMaxSockets = value;
- }
- };
-
- InstagramAPI.prototype.set = function(property, value) {
- if (this._config[property] !== void 0) {
- this._config[property] = value;
- }
- if (this._options[property] !== void 0) {
- this._options[property] = value;
- }
- if (typeof this["_set_" + property] === 'function') {
- return this["_set_" + property](value);
- }
- };
-
- /*
- Shared Request Methods
- */
-
-
- InstagramAPI.prototype._credentials = function(params, require) {
- if (params == null) {
- params = {};
- }
- if (require == null) {
- require = null;
- }
- if ((require != null) && (params[require] != null) || (params['access_token'] != null) || (params['client_id'] != null)) {
- return params;
- }
- if (require !== null && (this._config[require] != null)) {
- params[require] = this._config[require];
- } else if (this._config['access_token'] != null) {
- params['access_token'] = this._config['access_token'];
- } else if (this._config['client_id'] != null) {
- params['client_id'] = this._config['client_id'];
- }
- return params;
- };
-
- InstagramAPI.prototype._request = function(params) {
- var appResponse, complete, error, http_client, options, post_data, request, _ref, _ref1;
- options = this._clone(this._options);
- if (params['method'] != null) {
- options['method'] = params['method'];
- }
- if (params['path'] != null) {
- options['path'] = params['path'];
- }
- options['path'] = process.env['TEST_PATH_PREFIX'] != null ? "" + process.env['TEST_PATH_PREFIX'] + options['path'] : options['path'];
- complete = (_ref = params['complete']) != null ? _ref : params['complete'] = this._complete;
- appResponse = params['response'];
- error = (_ref1 = params['error']) != null ? _ref1 : params['error'] = this._error;
- if (options['method'] !== "GET" && (params['post_data'] != null)) {
- post_data = this._to_querystring(params['post_data']);
- } else {
- post_data = '';
- }
- options['headers']['Content-Length'] = post_data.length;
- if (process.env['TEST_PROTOCOL'] === 'http') {
- http_client = this._http_client;
- } else {
- http_client = this._https_client;
- }
- request = http_client.request(options, function(response) {
- var data;
- data = '';
- response.setEncoding('utf8');
- response.on('data', function(chunk) {
- return data += chunk;
- });
- return response.on('end', function() {
- var pagination, parsedResponse;
- try {
- parsedResponse = JSON.parse(data);
- if ((parsedResponse != null) && (parsedResponse['meta'] != null) && parsedResponse['meta']['code'] !== 200) {
- return error(parsedResponse['meta']['error_type'], parsedResponse['meta']['error_message'], "_request");
- } else if (parsedResponse['access_token'] != null) {
- return complete(parsedResponse, appResponse);
- } else {
- pagination = typeof parsedResponse['pagination'] === 'undefined' ? {} : parsedResponse['pagination'];
- return complete(parsedResponse['data'], pagination);
- }
- } catch (e) {
- if (appResponse != null) {
- return error(e, data, '_request', appResponse);
- } else {
- return error(e, data, '_request');
- }
- }
- });
- });
- if (post_data != null) {
- request.write(post_data);
- }
- request.addListener('error', function(connectionException) {
- if (connectionException.code !== 'ENOTCONN') {
- if (appResponse != null) {
- return error(connectionException, options, "_request", appResponse);
- } else {
- return error(connectionException, options, "_request");
- }
- }
- });
- return request.end();
- };
-
- return InstagramAPI;
-
- })();
-
- APIClient = new InstagramAPI;
-
- module.exports = APIClient;
-
-}).call(this);
View
50 node_modules/instagram-node-lib/lib/class.instagram.locations.js
@@ -1,50 +0,0 @@
-// Generated by CoffeeScript 1.3.3
-(function() {
- var InstagramLocations;
-
- InstagramLocations = (function() {
-
- function InstagramLocations(parent) {
- this.parent = parent;
- }
-
- InstagramLocations.prototype.info = function(params) {
- var credentials;
- credentials = this.parent._credentials({});
- params['path'] = "/" + this.parent._api_version + "/locations/" + params['location_id'] + "?" + (this.parent._to_querystring(credentials));
- return this.parent._request(params);
- };
-
- InstagramLocations.prototype.recent = function(params) {
- params = this.parent._credentials(params);
- params['path'] = "/" + this.parent._api_version + "/locations/" + params['location_id'] + "/media/recent?" + (this.parent._to_querystring(params));
- return this.parent._request(params);
- };
-
- InstagramLocations.prototype.search = function(params) {
- params = this.parent._credentials(params);
- params['path'] = "/" + this.parent._api_version + "/locations/search?" + (this.parent._to_querystring(params));
- return this.parent._request(params);
- };
-
- InstagramLocations.prototype.subscribe = function(params) {
- params['object'] = 'location';
- return this.parent.subscriptions._subscribe(params);
- };
-
- InstagramLocations.prototype.unsubscribe = function(params) {
- return this.parent.subscriptions._unsubscribe(params);
- };
-
- InstagramLocations.prototype.unsubscribe_all = function(params) {
- params['object'] = 'location';
- return this.parent.subscriptions._unsubscribe(params);
- };
-
- return InstagramLocations;
-
- })();
-
- module.exports = InstagramLocations;
-
-}).call(this);
View
116 node_modules/instagram-node-lib/lib/class.instagram.media.js
@@ -1,116 +0,0 @@
-// Generated by CoffeeScript 1.3.3
-(function() {
- var InstagramMedia;
-
- InstagramMedia = (function() {
-
- function InstagramMedia(parent) {
- this.parent = parent;
- }
-
- /*
- Basic Media
- */
-
-
- InstagramMedia.prototype.popular = function(params) {
- var credentials;
- credentials = this.parent._credentials({});
- params['path'] = "/" + this.parent._api_version + "/media/popular?" + (this.parent._to_querystring(credentials));
- return this.parent._request(params);
- };
-
- InstagramMedia.prototype.info = function(params) {
- var credentials;
- credentials = this.parent._credentials({});
- params['path'] = "/" + this.parent._api_version + "/media/" + params['media_id'] + "?" + (this.parent._to_querystring(credentials));
- return this.parent._request(params);
- };
-
- InstagramMedia.prototype.search = function(params) {
- params = this.parent._credentials(params);
- params['path'] = "/" + this.parent._api_version + "/media/search?" + (this.parent._to_querystring(params));
- return this.parent._request(params);
- };
-
- /*
- Likes
- */
-
-
- InstagramMedia.prototype.likes = function(params) {
- var credentials;
- credentials = this.parent._credentials({});
- params['path'] = "/" + this.parent._api_version + "/media/" + params['media_id'] + "/likes?" + (this.parent._to_querystring(credentials));
- return this.parent._request(params);
- };
-
- InstagramMedia.prototype.like = function(params) {
- params['post_data'] = this.parent._credentials({}, 'access_token');
- params['method'] = 'POST';
- params['path'] = "/" + this.parent._api_version + "/media/" + params['media_id'] + "/likes";
- return this.parent._request(params);
- };
-
- InstagramMedia.prototype.unlike = function(params) {
- params = this.parent._credentials(params, 'access_token');
- params['method'] = 'DELETE';
- params['path'] = "/" + this.parent._api_version + "/media/" + params['media_id'] + "/likes?" + (this.parent._to_querystring(params));
- return this.parent._request(params);
- };
-
- /*
- Comments
- */
-
-
- InstagramMedia.prototype.comments = function(params) {
- var credentials;
- credentials = this.parent._credentials({});
- params['path'] = "/" + this.parent._api_version + "/media/" + params['media_id'] + "/comments?" + (this.parent._to_querystring(credentials));
- return this.parent._request(params);
- };
-
- InstagramMedia.prototype.comment = function(params) {
- params['post_data'] = this.parent._credentials({
- text: params['text']
- }, 'access_token');
- params['method'] = 'POST';
- params['path'] = "/" + this.parent._api_version + "/media/" + params['media_id'] + "/comments";
- return this.parent._request(params);
- };
-
- InstagramMedia.prototype.uncomment = function(params) {
- var credentials;
- credentials = this.parent._credentials({}, 'access_token');
- params['method'] = 'DELETE';
- params['path'] = "/" + this.parent._api_version + "/media/" + params['media_id'] + "/comments/" + params['comment_id'] + "?" + (this.parent._to_querystring(credentials));
- return this.parent._request(params);
- };
-
- /*
- Subscriptions
- */
-
-
- InstagramMedia.prototype.subscribe = function(params) {
- params['object'] = 'geography';
- return this.parent.subscriptions._subscribe(params);
- };
-
- InstagramMedia.prototype.unsubscribe = function(params) {
- return this.parent.subscriptions._unsubscribe(params);
- };
-
- InstagramMedia.prototype.unsubscribe_all = function(params) {
- params['object'] = 'geography';
- return this.parent.subscriptions._unsubscribe(params);
- };
-
- return InstagramMedia;
-
- })();
-
- module.exports = InstagramMedia;
-
-}).call(this);
View
52 node_modules/instagram-node-lib/lib/class.instagram.oauth.js
@@ -1,52 +0,0 @@
-// Generated by CoffeeScript 1.3.3
-(function() {
- var InstagramOAuth;
-
- InstagramOAuth = (function() {
-
- function InstagramOAuth(parent) {
- this.parent = parent;
- }
-
- InstagramOAuth.prototype.authorization_url = function(params) {
- params['client_id'] = this.parent._config.client_id;
- params['redirect_uri'] = params['redirect_uri'] === void 0 || params['redirect_uri'] === null ? this.parent._config.redirect_uri : params['redirect_uri'];
- params['response_type'] = 'code';
- return "https://" + this.parent._options['host'] + "/oauth/authorize/?" + (this.parent._to_querystring(params));
- };
-
- InstagramOAuth.prototype.ask_for_access_token = function(params) {
- var parsed_query, token_params, url;
- url = require('url');
- parsed_query = url.parse(params['request'].url, true).query;
- if (parsed_query.error != null) {
- return this.parent._error("" + parsed_query.error + ": " + parsed_query.error_reason + ": " + parsed_query.error_description, parsed_query, 'handshake');
- } else if (parsed_query.code != null) {
- token_params = {
- complete: params['complete'],
- response: params['response'],
- method: "POST",
- path: "/oauth/access_token",
- post_data: {
- client_id: this.parent._config.client_id,
- client_secret: this.parent._config.client_secret,
- grant_type: 'authorization_code',
- redirect_uri: params['redirect_uri'] === void 0 || params['redirect_uri'] === null ? this.parent._config.redirect_uri : params['redirect_uri'],
- code: parsed_query.code
- }
- };
- this.parent._request(token_params);
- if (params['redirect'] != null) {
- params['response'].redirect(params['redirect']);
- return params['response'].end();
- }
- }
- };
-
- return InstagramOAuth;
-
- })();
-
- module.exports = InstagramOAuth;
-
-}).call(this);
View
127 node_modules/instagram-node-lib/lib/class.instagram.subscriptions.js
@@ -1,127 +0,0 @@
-// Generated by CoffeeScript 1.3.3
-(function() {
- var InstagramSubscriptions, crypto, url;
-
- url = require('url');
-
- crypto = require('crypto');
-
- InstagramSubscriptions = (function() {
-
- function InstagramSubscriptions(parent) {
- this.parent = parent;
- }
-
- /*
- Verification Methods
- */
-
-
- InstagramSubscriptions.prototype.handshake = function(request, response, complete) {
- var body, headers, parsedRequest;
- parsedRequest = url.parse(request.url, true);
- if (parsedRequest['query']['hub.mode'] === 'subscribe' && (parsedRequest['query']['hub.challenge'] != null) && parsedRequest['query']['hub.challenge'].length > 0) {
- body = parsedRequest['query']['hub.challenge'];
- headers = {
- 'Content-Length': body.length,
- 'Content-Type': 'text/plain'
- };
- response.writeHead(200, headers);
- response.write(body);
- if ((parsedRequest['query']['hub.verify_token'] != null) && (complete != null)) {
- complete(parsedRequest['query']['hub.verify_token']);
- }
- } else {
- response.writeHead(400);
- }
- return response.end();
- };
-
- InstagramSubscriptions.prototype.verified = function(request) {
- var calculated_signature, encoding, hmac;
- if (request.rawBody === null || request.headers['x-hub-signature'] === void 0 || request.headers['x-hub-signature'] === null) {
- return false;
- }
- hmac = crypto.createHmac('sha1', this.parent._config.client_secret);
- hmac.update(request.rawBody);
- calculated_signature = hmac.digest(encoding = 'hex');
- if (calculated_signature !== request.headers['x-hub-signature']) {
- return false;
- }
- return true;
- };
-
- /*
- Shared Subscription Methods
- */
-
-
- InstagramSubscriptions.prototype._subscribe = function(params) {
- var i, _i, _len, _ref;
- params['method'] = "POST";
- params['path'] = "/" + this.parent._api_version + "/subscriptions/";
- if ((typeof params['callback_url'] === 'undefined' || params['callback_url'] === null) && this.parent._config.callback_url !== null) {
- params['callback_url'] = this.parent._config.callback_url;
- }
- params['post_data'] = {
- object: params['object'],
- aspect: 'media',
- client_id: this.parent._config.client_id,
- client_secret: this.parent._config.client_secret,
- callback_url: params['callback_url']
- };
- _ref = ['object_id', 'verify_token', 'lat', 'lng', 'radius'];
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
- i = _ref[_i];
- if (params[i] != null) {
- params['post_data'][i] = params[i];
- }
- }
- return this.parent._request(params);
- };
-
- InstagramSubscriptions.prototype._unsubscribe = function(params) {
- params['method'] = "DELETE";
- params['path'] = "/" + this.parent._api_version + "/subscriptions/";
- if (params['id'] != null) {
- params['path'] += "?id=" + params['id'];
- } else {
- params['path'] += "?object=" + params['object'];
- }
- params['path'] += "&client_secret=" + this.parent._config.client_secret + "&client_id=" + this.parent._config.client_id;
- return this.parent._request(params);
- };
-
- /*
- Shared Public Methods
- */
-
-
- InstagramSubscriptions.prototype.subscribe = function(params) {
- return this._subscribe(params);
- };
-
- InstagramSubscriptions.prototype.list = function(params) {
- params = this.parent._clone(params);
- params['path'] = "/" + this.parent._api_version + "/subscriptions?client_secret=" + this.parent._config.client_secret + "&client_id=" + this.parent._config.client_id;
- return this.parent._request(params);
- };
-
- InstagramSubscriptions.prototype.unsubscribe = function(params) {
- return this._unsubscribe(params);
- };
-
- InstagramSubscriptions.prototype.unsubscribe_all = function(params) {
- if (params['object'] === void 0 || !(params['object'] != null)) {
- params['object'] = 'all';
- }
- return this._unsubscribe(params);
- };
-
- return InstagramSubscriptions;
-
- })();
-
- module.exports = InstagramSubscriptions;
-
-}).call(this);
View
50 node_modules/instagram-node-lib/lib/class.instagram.tags.js
@@ -1,50 +0,0 @@
-// Generated by CoffeeScript 1.3.3
-(function() {
- var InstagramTags;
-
- InstagramTags = (function() {
-
- function InstagramTags(parent) {
- this.parent = parent;
- }
-
- InstagramTags.prototype.info = function(params) {
- var credentials;
- credentials = this.parent._credentials({});
- params['path'] = "/" + this.parent._api_version + "/tags/" + params['name'] + "?" + (this.parent._to_querystring(credentials));
- return this.parent._request(params);
- };
-
- InstagramTags.prototype.recent = function(params) {
- params = this.parent._credentials(params);
- params['path'] = "/" + this.parent._api_version + "/tags/" + params['name'] + "/media/recent?" + (this.parent._to_querystring(params));
- return this.parent._request(params);
- };
-
- InstagramTags.prototype.search = function(params) {
- params = this.parent._credentials(params);
- params['path'] = "/" + this.parent._api_version + "/tags/search?" + (this.parent._to_querystring(params));
- return this.parent._request(params);
- };
-
- InstagramTags.prototype.subscribe = function(params) {
- params['object'] = 'tag';
- return this.parent.subscriptions._subscribe(params);
- };
-
- InstagramTags.prototype.unsubscribe = function(params) {
- return this.parent.subscriptions._unsubscribe(params);
- };
-
- InstagramTags.prototype.unsubscribe_all = function(params) {
- params['object'] = 'tag';
- return this.parent.subscriptions._unsubscribe(params);
- };
-
- return InstagramTags;
-
- })();
-
- module.exports = InstagramTags;
-
-}).call(this);
View
145 node_modules/instagram-node-lib/lib/class.instagram.users.js
@@ -1,145 +0,0 @@
-// Generated by CoffeeScript 1.3.3
-(function() {
- var InstagramUsers;
-
- InstagramUsers = (function() {
-
- function InstagramUsers(parent) {
- this.parent = parent;
- }
-
- /*
- User Basics
- */
-
-
- InstagramUsers.prototype.info = function(params) {
- var credentials;
- credentials = this.parent._credentials({});
- params['path'] = "/" + this.parent._api_version + "/users/" + params['user_id'] + "?" + (this.parent._to_querystring(credentials));
- return this.parent._request(params);
- };
-
- InstagramUsers.prototype.search = function(params) {
- params = this.parent._credentials(params);
- params['path'] = "/" + this.parent._api_version + "/users/search?" + (this.parent._to_querystring(params));
- return this.parent._request(params);
- };
-
- /*
- Media
- */
-
-
- InstagramUsers.prototype.self = function(params) {
- params = this.parent._credentials(params, 'access_token');
- params['path'] = "/" + this.parent._api_version + "/users/self/feed?" + (this.parent._to_querystring(params));
- return this.parent._request(params);
- };
-
- InstagramUsers.prototype.liked_by_self = function(params) {
- params = this.parent._credentials(params, 'access_token');
- params['path'] = "/" + this.parent._api_version + "/users/self/media/liked?" + (this.parent._to_querystring(params));
- return this.parent._request(params);
- };
-
- InstagramUsers.prototype.recent = function(params) {
- params = this.parent._credentials(params, 'access_token');
- params['path'] = "/" + this.parent._api_version + "/users/" + params['user_id'] + "/media/recent?" + (this.parent._to_querystring(params));
- return this.parent._request(params);
- };
-
- /*
- Relationships
- */
-
-
- InstagramUsers.prototype.follows = function(params) {
- var credentials;
- credentials = this.parent._credentials({}, 'access_token');
- params['path'] = "/" + this.parent._api_version + "/users/" + params['user_id'] + "/follows?" + (this.parent._to_querystring(credentials));
- return this.parent._request(params);
- };
-
- InstagramUsers.prototype.followed_by = function(params) {
- var credentials;
- credentials = this.parent._credentials({}, 'access_token');
- params['path'] = "/" + this.parent._api_version + "/users/" + params['user_id'] + "/followed-by?" + (this.parent._to_querystring(credentials));
- return this.parent._request(params);
- };
-
- InstagramUsers.prototype.requested_by = function(params) {
- var credentials;
- credentials = this.parent._credentials({}, 'access_token');
- params['path'] = "/" + this.parent._api_version + "/users/self/requested-by?" + (this.parent._to_querystring(credentials));
- return this.parent._request(params);
- };
-
- InstagramUsers.prototype.relationship = function(params) {
- var credentials;
- credentials = this.parent._credentials({}, 'access_token');
- if (params['action'] != null) {
- params['method'] = 'POST';
- params['post_data'] = {
- access_token: credentials['access_token'],
- action: params['action']
- };
- params['path'] = "/" + this.parent._api_version + "/users/" + params['user_id'] + "/relationship";
- } else {
- params['path'] = "/" + this.parent._api_version + "/users/" + params['user_id'] + "/relationship?" + (this.parent._to_querystring(credentials));
- }
- return this.parent._request(params);
- };
-
- InstagramUsers.prototype.follow = function(params) {
- params['action'] = 'follow';
- return this.relationship(params);
- };
-
- InstagramUsers.prototype.unfollow = function(params) {
- params['action'] = 'unfollow';
- return this.relationship(params);
- };
-
- InstagramUsers.prototype.block = function(params) {
- params['action'] = 'block';
- return this.relationship(params);
- };
-
- InstagramUsers.prototype.unblock = function(params) {
- params['action'] = 'unblock';
- return this.relationship(params);
- };
-
- InstagramUsers.prototype.approve = function(params) {
- params['action'] = 'approve';
- return this.relationship(params);
- };
-
- InstagramUsers.prototype.ignore = function(params) {
- params['action'] = 'ignore';
- return this.relationship(params);
- };
-
- /*
- Subscriptions
- */
-
-
- InstagramUsers.prototype.subscribe = function(params) {
- params['object'] = 'user';
- return this.parent.subscriptions._subscribe(params);
- };
-
- InstagramUsers.prototype.unsubscribe_all = function(params) {
- params['object'] = 'user';
- return this.parent.subscriptions._unsubscribe(params);
- };
-
- return InstagramUsers;
-
- })();
-
- module.exports = InstagramUsers;
-
-}).call(this);
View
44 node_modules/instagram-node-lib/package.json
@@ -1,44 +0,0 @@
-{
- "name": "instagram-node-lib",
- "description": "This package is a wrapper for the Instagram API.",
- "version": "0.1.0",
- "author": {
- "name": "David W. McKelvey",
- "email": "david@mckelveycreative.com",
- "url": "http://david.mckelveycreative.com/"
- },
- "contributors": [],
- "keywords": [
- "instagram",
- "api",
- "lib"
- ],
- "main": "./lib/class.instagram.js",
- "engines": {
- "node": ">= 0.4.5"
- },
- "directories": {
- "lib": "./lib"
- },
- "files": [
- ""
- ],
- "homepage": "https://github.com/mckelvey/instagram-node-lib",
- "repository": {
- "type": "git",
- "url": "git://github.com/mckelvey/instagram-node-lib.git"
- },
- "scripts": {
- "test set": "expresso ./test/instagram.js",
- "test geographies": "expresso ./test/instagram.geographies.js",
- "test locations": "expresso ./test/instagram.locations.js",
- "test media": "expresso ./test/instagram.media.js",
- "test tags": "expresso ./test/instagram.tags.js",
- "test users": "expresso ./test/instagram.users.js",
- "test subscriptions": "expresso ./test/instagram.subscriptions.js",
- "test oauth": "expresso ./test/instagram.oauth.js"
- },
- "readme": "## What It Is\n\nThe Instagram Node Lib is a helper library for [node](http://nodejs.org) that makes communicating with the [Instagram API](http://instagram.com/developer/) easy.\n\n## Simple Example\n\nFollowing is an example that loads the library, sets my CLIENT_ID and CLIENT_SECRET for accessing the API and makes a simple call to get information on the tag `#blue`.\n\n Instagram = require('instagram-node-lib');\n\n Instagram.set('client_id', 'YOUR-CLIENT-ID');\n Instagram.set('client_secret', 'YOUR-CLIENT-SECRET');\n\n Instagram.tags.info({\n name: 'blue',\n complete: function(data){\n console.log(data);\n }\n });\n\nWhen successful, the data logged in the console would be a javascript object like `{ media_count: 10863, name: 'blue' }`.\n\n## Installation\n\n $ npm install instagram-node-lib\n\n## Setup\n\nTo use the library, you'll need to require it and at minimum, set your CLIENT_ID and CLIENT_SECRET given to you by Instagram.\n\n Instagram = require('instagram-node-lib');\n\n Instagram.set('client_id', 'YOUR-CLIENT-ID');\n Instagram.set('client_secret', 'YOUR-CLIENT-SECRET');\n\nOptionally, if you intend to use the real-time API to manage subscriptions, then you can also set a global callback url. (You may also provide/override the callback url when subscribing.)\n\n Instagram.set('callback_url', 'CALLBACK-URL');\n\nIf you intend to use user-specific methods (e.g. relationships), then you must also set a global redirect_uri (matching that in your [app settings in the API](http://instagram.com/developer/manage/)).\n\n Instagram.set('redirect_uri', 'YOUR-REDIRECT-URI');\n\nLastly, if you find that the default max sockets of 5 is too few for the http(s) client, you can increase it as needed with the set method. The new max sockets value must be a positive integer greater than zero.\n\n Instagram.set('maxSockets', 10);\n\n## Available Methods\n\nAll of the methods below follow a similar pattern. Each accepts a single javascript object with the needed parameters to complete the API call. Required parameters are shown below; refer to [the API docs](http://instagram.com/developer/endpoints/) for the optional parameters. All parameters are passed through to the request, so use the exact terms that the API docs provide.\n\nIn addition, the parameters object may include two functions, one of which will be executed at the conclusion of the request (i.e. `complete` and `error`).\n\n {\n name: 'blue',\n complete: function(data, pagination){\n // data is a javascript object/array/null matching that shipped Instagram\n // when available (mostly /recent), pagination is a javascript object with the pagination information\n },\n error: function(errorMessage, errorObject, caller){\n // errorMessage is the raised error message\n // errorObject is either the object that caused the issue, or the nearest neighbor\n // caller is the method in which the error occurred\n }\n }\n\nIn the event you do not provide a `complete` or `error` function, the library has fallback functions which post results to the console log.\n\n### Media\n\nThe following media methods are available. Required parameters are shown below, see the [Instagram API docs](http://instagram.com/developer/endpoints/media/) for the optional parameters.\n\n#### Popular\n\nGet the a set of 32 current popular media, each with all it's associated likes and comments.\n\n Instagram.media.popular();\n -> [ { media object },\n { media object },\n { media object }, ... ]\n\n#### Info\n\nGet the metadata for a single media item by media id.\n\n Instagram.media.info({ media_id: 3 });\n -> { media object }\n\n#### Search\n\nWith a latitude and longitude (and an optional distance), find nearby media by geography.\n\n Instagram.media.search({ lat: 48.858844300000001, lng: 2.2943506 });\n -> [ { media object },\n { media object },\n { media object }, ... ]\n\n#### Likes\n\nAkin to an info request, this method only returns an array of likers for the media.\n\n Instagram.media.likes({ media_id: 3 });\n -> [ { username: 'krisrak',\n profile_picture: 'http://profile/path.jpg',\n id: '#',\n full_name: 'Rak Kris' },\n { username: 'mikeyk',\n profile_picture: 'http://profile/path.jpg',\n id: '#',\n full_name: 'Mike Krieger' } ]\n\nUsing an `access_token`, you can have the token user like or unlike a media item.\n\n Instagram.media.like({ media_id: 3 });\n -> null // null is success, an error is failure\n\n Instagram.media.unlike({ media_id: 3 });\n -> null // null is success, an error is failure\n\n#### Comments\n\nAkin to an info request, this method only returns an array of comments on the media.\n\n Instagram.media.comments({ media_id: 3 });\n -> [ { created_time: '1279306830',\n text: 'Love the sign here',\n from: \n { username: 'mikeyk',\n profile_picture: 'http://profile/path.jpg',\n id: '#',\n full_name: 'Mike Krieger' },\n id: '8' },\n { created_time: '1279315804',\n text: 'Chilako taco',\n from: \n { username: 'kevin',\n profile_picture: 'http://profile/path.jpg',\n id: '#',\n full_name: 'Kevin Systrom' },\n id: '3' } ]\n\nUsing an `access_token`, you can have the token user comment upon or delete their comment from a media item.\n\n Instagram.media.comment({ media_id: 3, text: 'Instagame was here.' });\n -> { created_time: '1302926497',\n text: 'Instagame was here.',\n from:\n { username: 'instagame',\n profile_picture: 'http://profile/path.jpg',\n id: '#',\n full_name: '' },\n id: '67236858' }\n\n Instagram.media.uncomment({ media_id: 3, comment_id: 67236858 });\n -> null // null is success, an error is failure\n\n#### Subscriptions\n\nGeography subscriptions for media are also available with the following methods. A `callback_url` is required if not specified globally, and you may also provide a `verify_token` if you want to keep track of which subscription is coming back. Note that while `unsubscribe` is identical to the generic subscriptions method below, here, `unsubscribe_all` only removes geography subscriptions.\n\n Instagram.media.subscribe({ lat: 48.858844300000001, lng: 2.2943506, radius: 1000 });\n -> { object: 'geography',\n object_id: '#',\n aspect: 'media',\n callback_url: 'http://your.callback/path',\n type: 'subscription',\n id: '#' }\n\n Instagram.media.unsubscribe({ id: # });\n -> null // null is success, an error is failure\n\n Instagram.media.unsubscribe_all();\n -> null // null is success, an error is failure\n\n### Tags\n\nThe following tag methods are available. Required parameters are shown below, see the [Instagram API docs](http://instagram.com/developer/endpoints/tags/) for the optional parameters.\n\n#### Info\n\nGet the metadata for a single tag by name.\n\n Instagram.tags.info({ name: 'blue' });\n -> { media_count: 10863, name: 'blue' }\n\n#### Recent\n\nGet an array of media that have been tagged with the tag recently. \n\n Instagram.tags.recent({ name: 'blue' });\n -> [ { media object },\n { media object },\n { media object }, ... ]\n\n#### Search\n\nSearch for matching tags by name (q).\n\n Instagram.tags.search({ q: 'blue' });\n -> [ { media_count: 10872, name: 'blue' },\n { media_count: 931, name: 'bluesky' },\n { media_count: 178, name: 'blueeyes' }, ... ]\n\n#### Subscriptions\n\nTag subscriptions are also available with the following methods. A `callback_url` is required if not specified globally, and you may also provide a `verify_token` if you want to keep track of which subscription is coming back. Note that while `unsubscribe` is identical to the generic subscriptions method below, here, `unsubscribe_all` only removes tag subscriptions.\n\n Instagram.tags.subscribe({ object_id: 'blue' });\n -> { object: 'tag',\n object_id: 'blue',\n aspect: 'media',\n callback_url: 'http://your.callback/path',\n type: 'subscription',\n id: '#' }\n\n Instagram.tags.unsubscribe({ id: # });\n -> null // null is success, an error is failure\n\n Instagram.tags.unsubscribe_all();\n -> null // null is success, an error is failure\n\n### Locations\n\nThe following location methods are available. Required parameters are shown below, see the [Instagram API docs](http://instagram.com/developer/endpoints/locations/) for the optional parameters.\n\n#### Info\n\nGet the metadata for a single location by location id.\n\n Instagram.locations.info({ location_id: 1 });\n -> { latitude: 37.78265474565738,\n id: '1',\n longitude: -122.387866973877,\n name: 'Dogpatch Labs' }\n\n#### Recent\n\nGet an array of media that have been located with the matching location (by id) recently.\n\n Instagram.locations.recent({ location_id: 1 });\n -> [ { media object },\n { media object },\n { media object }, ... ]\n\n#### Search\n\nWith a latitude and longitude (and an optional distance), find nearby locations by geography.\n\n Instagram.locations.search({ lat: 48.858844300000001, lng: 2.2943506 });\n -> [ { latitude: 48.8588443,\n id: '723695',\n longitude: 2.2943506,\n name: 'Restaurant Jules Verne' },\n { latitude: 48.8588443,\n id: '788029',\n longitude: 2.2943506,\n name: 'Eiffel Tower, Paris' },\n { latitude: 48.858543,\n id: '1894075',\n longitude: 2.2938285,\n name: 'Caf� de l\\'homme' }, ... ]\n\n#### Subscriptions\n\nLocation subscriptions are also available with the following methods. A `callback_url` is required when subscribing if not specified globally, and you may also provide a `verify_token` if you want to keep track of which subscription is coming back. Note that while `unsubscribe` is identical to the generic subscriptions method below, here, `unsubscribe_all` only removes location subscriptions.\n\n Instagram.locations.subscribe({ object_id: '1257285' });\n -> { object: 'location',\n object_id: '1257285',\n aspect: 'media',\n callback_url: 'http://your.callback/path',\n type: 'subscription',\n id: '#' }\n\n Instagram.locations.unsubscribe({ id: # });\n -> null // null is success, an error is failure\n\n Instagram.locations.unsubscribe_all();\n -> null // null is success, an error is failure\n\n### Users\n\nThe following user methods are available. Required parameters are shown below, see the [Instagram API docs](http://instagram.com/developer/endpoints/users/) for the optional parameters.\n\n#### Info\n\nGet the metadata for a single user by user id.\n\n Instagram.users.info({ user_id: 291024 });\n -> { username: 'mckelvey',\n counts: { media: 526, followed_by: 293, follows: 265 },\n profile_picture: 'http://profile/path.jpg',\n id: '291024',\n full_name: 'David McKelvey' }\n\n#### Search\n\nSearch for matching users by name (q).\n\n Instagram.users.search({ q: 'mckelvey' });\n -> [ { username: 'mckelvey',\n profile_picture: 'http://profile/path.jpg',\n id: '291024',\n full_name: 'David McKelvey' }, ... ]\n\n#### Self\n\nGet the user media feed for the `access_token` supplied. This method obviously then requires `access_token` rather than simply `client_id`; see the OAuth section on obtaining an `access_token`. You can either supply it here or set it within the library.\n\n Instagram.users.self();\n -> [ { media object },\n { media object },\n { media object }, ... ]\n\n#### Liked by Self\n\nGet the media that has been liked by the user for the `access_token` supplied. This method obviously then requires `access_token` rather than simply `client_id`; see the OAuth section on obtaining an `access_token`. You can either supply it here or set it within the library.\n\n Instagram.users.liked_by_self();\n -> [ { media object },\n { media object },\n { media object }, ... ]\n\n#### Recent\n\nGet the user media feed for a user by user_id. This method requires `access_token` rather than simply `client_id` in case the requested user media is protected and the requesting user is not authorized to view the media; see the OAuth section on obtaining an `access_token`. You can either supply it here or set it within the library.\n\n Instagram.users.recent({ user_id: 291024 });\n -> [ { media object },\n { media object },\n { media object }, ... ]\n\n#### Relationships\n\nThe following methods allow you to view and alter user-to-user relationships via an `access_token` (assuming the scope `relationships` has been authorized for the token). Do review the outgoing and incoming references in the [Instagram API Relationship Docs](http://instagram.com/developer/endpoints/relationships/) as they can be confusing since they act in relation to the `access_token` used. _I didn't have any users to fully test the request/approve/ignore against; let me know if you encounter difficulties._\n\n Instagram.users.follows({ user_id: 291024 });\n -> [ { username: 'mckelvey',\n profile_picture: 'http://profile/path.jpg',\n id: '291024',\n full_name: 'David McKelvey' }, ... ]\n\n Instagram.users.followed_by({ user_id: 291024 });\n -> [ { username: 'instagame',\n profile_picture: 'http://profile/path.jpg',\n id: '1340677',\n full_name: '' }, ... ]\n\n Instagram.users.requested_by({ user_id: 291024 });\n -> [ { username: 'instagame',\n profile_picture: 'http://profile/path.jpg',\n id: '1340677',\n full_name: '' }, ... ]\n\n Instagram.users.relationship({ user_id: 291024 });\n -> { outgoing_status: 'follows', // access_token user follows user 291024\n incoming_status: 'none' } // user 291024 has no relationship with the access_token user\n\n Instagram.users.follow({ user_id: 291024 });\n -> { outgoing_status: 'follows' } // success: access_token user follows user 291024\n\n Instagram.users.unfollow({ user_id: 291024 });\n -> { outgoing_status: 'none' } // success: access_token user no longer follows user 291024\n\n Instagram.users.block({ user_id: 291024 });\n -> { incoming_status: 'blocked_by_you' } // success: access_token user has blocked user 291024\n\n Instagram.users.unblock({ user_id: 291024 });\n -> { incoming_status: 'none' } // success: access_token user no longer blocks user 291024\n\n Instagram.users.approve({ user_id: 291024 });\n -> { incoming_status: 'followed_by' } // success: access_token user has allowed user 291024 to follow\n\n Instagram.users.ignore({ user_id: 291024 });\n -> { incoming_status: 'requested_by' } // success: access_token user has ignored user 291024's follow request\n\n#### Subscriptions\n\nUser subscriptions are also available with the following methods. A `callback_url` is required when subscribing if not specified globally, and you may also provide a `verify_token` if you want to keep track of which subscription is coming back. Note that because Instagram user subscriptions are based on your API client's authenticated users, `unsubscribe` is equivalent to `unsubscribe_all`, so only `unsubscribe_all` is provided.\n\n Instagram.users.subscribe();\n -> { object: 'user',\n aspect: 'media',\n callback_url: 'http://your.callback/path',\n type: 'subscription',\n id: '#' }\n\n Instagram.users.unsubscribe_all();\n -> null // null is success, an error is failure\n\n### Real-time Subscriptions\n\nIn addition to the above subscription methods within tags, locations and media, you can also interact with any subscription directly with the methods below. As with the others, it will be helpful to review the [Instagram API docs](http://instagram.com/developer/realtime/) for additional information.\n\nBe sure to include a GET route/method for the callback handshake at the `callback_url` that can handle the setup. This library includes a handshake method (example below based on Express), to which you can provide the request, the response and a complete method that will act upon the `verify_token` should you have provided it in the initial request.\n\n app.get('/subscribe', function(request, response){\n Instagram.subscriptions.handshake(request, response); \n });\n\n#### Subscribe\n\nThe subscription request differs here in that it will not know what kind of object (tag, location, geography) to which you want to subscribe, so be sure to specify it. A `callback_url` is required when subscribing if not specified globally, and you may also provide a `verify_token` if you want to keep track of which subscription is coming back.\n\n Instagram.subscriptions.subscribe({ object: 'tag', object_id: 'blue' });\n -> { object: 'tag',\n object_id: 'blue',\n aspect: 'media',\n callback_url: 'http://your.callback/path',\n type: 'subscription',\n id: '#' }\n\n#### Subscriptions\n\nRetrieve a list of all your subscriptions.\n\n Instagram.subscriptions.list();\n -> [ { object: 'tag',\n object_id: 'blue',\n aspect: 'media',\n callback_url: 'http://your.callback/path',\n type: 'subscription',\n id: '#' }, ... ]\n\n#### Unsubscribe\n\nTo unsubscribe from a single subscription, you must provide the subscription id.\n\n Instagram.subscriptions.unsubscribe({ id: # });\n -> null // null is success, an error is failure\n\n#### Unsubscribe All\n\nUnsubscribe from all subscriptions of all kinds.\n\n Instagram.subscriptions.unsubscribe_all();\n -> null // null is success, an error is failure\n\n## OAuth\n\nIn order to perform specific methods upon user data, you will need to have authorization from them through [Instagram OAuth](http://instagram.com/developer/auth/). Several methods are provided so that you can request authorization from users. You will need to specify your redirect_uri from your [application setup at Instagram](http://instagram.com/developer/manage/).\n\n Instagram.set('redirect_uri', 'YOUR-REDIRECT-URI');\n\n#### Authorization Url\n\nTo obtain a user url for the link to Instagram, use the authorization_url method. You can include the optional parameters as needed, but be sure to use spaces instead of pluses (as they will be encoded to pluses).\n\n url = Instagram.oauth.authorization_url({\n scope: 'comments likes' // use a space when specifying a scope; it will be encoded into a plus\n display: 'touch'\n });\n\n#### Ask for an Access Token\n\nThe example below uses Express to specify a route to respond to the user's return from Instagram. It will pass the access_token and user object returned to a provided complete function. Your complete and error functions should handle your app server response (passed as a parameter for oauth only) *or* include a redirect parameter for simple redirects.\n\nIf you choose to use the simple redirect, be advised that due to the event model of node.js, your users may reach the redirect address before the complete method is executed.\n\n app.get('/oauth', function(request, response){\n Instagram.oauth.ask_for_access_token({\n request: request,\n response: response,\n redirect: 'http://your.redirect/url', // optional\n complete: function(params, response){\n // params['access_token']\n // params['user']\n response.writeHead(200, {'Content-Type': 'text/plain'});\n // or some other response ended with\n response.end();\n },\n error: function(errorMessage, errorObject, caller, response){\n // errorMessage is the raised error message\n // errorObject is either the object that caused the issue, or the nearest neighbor\n // caller is the method in which the error occurred\n response.writeHead(406, {'Content-Type': 'text/plain'});\n // or some other response ended with\n response.end();\n }\n });\n return null;\n });\n\n## Developers\n\nHey, this is my first Node.js project, my first NPM package, and my first public repo (and happy to finally be giving back for all the code I've enjoyed over the years). If you have suggestions please email me, register an issue, fork (dev please) and branch, etc. (You know the routine probably better than I.)\n\nIf you add additional functionality, your pull request must have corresponding additional tests and supporting documentation.\n\nI've used [CoffeeScript](http://jashkenas.github.com/coffee-script) to write this library. If you haven't tried it, I highly recommend it. CoffeeScript takes some of the work out of javascript structures. Refer to the CoffeeScript docs for installation and usage. \n\n### Contributors\n\n * [Andrew Senter](https://github.com/andrewsenter)\n * [Olivier Balais](https://github.com/bobey)\n * [Joe McCann](https://github.com/joemccann)\n\nBoth Andrew and Olivier suggested better ways of handling the server response when requesting a token during OAuth. Joe provided a correction for [issue #4](https://github.com/mckelvey/instagram-node-lib/issues/4).\n\n### Tests\n\nThere is a test suite in the /tests folder with the tests I used to ensure the library functions as intended. If you're adding or changing functionality, please add to or update the corresponding tests before issuing a pull request. The tests require [Express](https://github.com/visionmedia/express), [Expresso](https://github.com/visionmedia/expresso) and [Should](https://github.com/visionmedia/should.js):\n\n npm install express\n npm install expresso\n npm install should\n\nIn addition, either export or add to your shell profile your CLIENT_ID, CLIENT_SECRET, ACCESS_TOKEN (if applicable) and CALLBACK_URL so that they are available during testing.\n",
- "_id": "instagram-node-lib@0.1.0",
- "_from": "instagram-node-lib"
-}
View
47 node_modules/instagram-node-lib/test/helpers.js
@@ -1,47 +0,0 @@
-// Generated by CoffeeScript 1.3.3
-(function() {
- var indent;
-
- indent = " ";
-
- module.exports = {
- indent: indent,
- helper: function(title, Instagram, type, method, params, assertions) {
- if (title == null) {
- title = '';
- }
- if (params == null) {
- params = {};
- }
- params['complete'] = function(data, pagination) {
- console.log("\n" + title + "\n" + indent + "connection/parsing succeeded");
- try {
- assertions(data, pagination);
- return console.log("" + indent + "data met assertions");
- } catch (e) {
- console.log("" + indent + "data failed to meet the assertion(s): " + e);
- throw e;
- }
- };
- params['error'] = function(e, data, caller) {
- console.log("" + indent + "error: " + e + "\n" + indent + "data: " + data + "\n" + indent + "caller: " + caller);
- throw e;
- };
- return Instagram[type][method](params);
- },
- output: function(message, value) {
- if (value == null) {
- value = null;
- }
- console.log("" + indent + message);
- if (value != null) {
- if (typeof value === 'object') {
- return console.log(("" + indent + indent + "it was: ") + JSON.stringify(value));
- } else {
- return console.log("" + indent + indent + "it was: " + value);
- }
- }
- }
- };
-
-}).call(this);
View
158 node_modules/instagram-node-lib/test/initialize.js
@@ -1,158 +0,0 @@
-// Generated by CoffeeScript 1.3.3
-
-/*
-Initialize Instagram
-*/
-
-
-(function() {
- var CALLBACK_URL, HOST, Instagram, PATH, PORT, app, callback, express, url;
-
- Instagram = require('../lib/class.instagram');
-
- /*