From 270ae138bfef5cea306b0aa7248475e45eb38ab8 Mon Sep 17 00:00:00 2001 From: reality Date: Fri, 12 Apr 2013 23:27:31 +0000 Subject: [PATCH] Initial API function for imgur detail getting [#350] --- modules/imgur/imgur.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/imgur/imgur.js b/modules/imgur/imgur.js index 2bc6512..825049d 100644 --- a/modules/imgur/imgur.js +++ b/modules/imgur/imgur.js @@ -25,6 +25,17 @@ var imgur = function(dbot) { this.api.getRandomImage(callback); } }.bind(this)); + }, + + 'getImageInfo': function(slug, callback) { + request.get({ + 'url': 'https://api.imgur.com/3/image/' + slug + '.json', + 'headers': { + 'Authorization': 'Client-ID 86fd3a8da348b65' + } + }, function(err, response, body) { + callback(body); + }); } }; @@ -35,6 +46,9 @@ var imgur = function(dbot) { }); } } + + this.onLoad = function() { + }.bind(this); }; exports.fetch = function(dbot) {