Meteor Imgur Upload Package
meteor add simple:imgur
A meteor package that lets you upload images to Imgur. Is very nice to use with mdg:camera, as in the example app included in this repo.
API Documentation
Both API methods work on client and server.
Imgur.upload(options, callback)
Arguments
options(required) an object with options, described below.callback(error, data)(required) a callback that is called with two arguments, 'error', and 'data'.errora Meteor.Error describing the reason the photo could not be uploaded.dataan object that contains the response from the Imgur API, documented here. The most useful property isdata.link, which contains the URL of the newly uploaded image.
Options
apiKeythe Imgur Client ID. Get it by signing up for the API at https://api.imgur.com/oauth2/addclient.imagethe image data, can a base64-encoded image data string or the URL of an image somewhere on the internet.type,name,title,description,albumoptional properties exactly as documented at https://api.imgur.com/endpoints/image#image-upload.
Imgur.toThumbnail(imageUrl, size)
Arguments
imageUrlthe URL for an image on Imgur, for example "http://i.imgur.com/wbJ84Wm.jpg".sizethe key of the desired thumbnail size, chosen from the list at the bottom of https://api.imgur.com/models/image. You can also use a constant from the list below.Imgur.SMALL_SQUAREImgur.BIG_SQUAREImgur.SMALL_THUMBNAILImgur.MEDIUM_THUMBNAILImgur.LARGE_THUMBNAILImgur.HUGE_THUMBNAIL