Class: imgur.Api

provides access to the imgur api.

this class is available in the server, only!

Table of Contents #

imgur.Api.DEFAULT_OPTIONS #

Default options used for imgur api http calls

new imgur.Api(apiKey, [options]) #

api.delete(deletehash, callback, [ctx = null]) #

callback gets two arguments (error, imgur.Response).

api.getImageInformation(hash, callback, [ctx = null]) #

callback gets two arguments (error, imgur.Response).

Example


  api = new imgur.Api("secretkey");
  api.getImageInformation('imagehash', function(err, response){
    if (err) {
      console.log(err);
    } else {
      console.log("image has type " + response.get('type'));
    }
  });

api.uploadFile(file) #

NOT YET IMPLEMENTED

api.uploadUrl(url, callback, [ctx = null]) #

callback gets two arguments (error, imgur.Response).

Example

  api = new imgur.Api("secretkey");
  api.uploadUrl("http://foo.bar/funny.gif", function(err, response){
    if (err) {
      console.log(err);
    } else {
      console.log("image uploaded. ID " + response.get('id'));
    }
  });

Documentation generated by mdoc.