0.1.2 • Published 10 years ago

mediacrush v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

node-mediacrush

Build Status Dependency Status

MediaCrush API wrapper.

Example

var mediacrush = require('mediacrush');

mediacrush.getInfo('kmopZLGFVRYs', function(error, data) {
  if (error) {
    throw error;
  }

  // => {
  // =>   "blob_type": "image",
  // =>   "compression": 1,
  // =>   "extras": [],
  // =>   "files": [
  // =>     {
  // =>       "file": "/kmopZLGFVRYs.png",
  // =>       "type": "image/png",
  // =>       "url": "https://cdn.mediacru.sh/kmopZLGFVRYs.png"
  // =>     }
  // =>   ],
  // =>   "flags": {},
  // =>   "hash": "kmopZLGFVRYs",
  // =>   "metadata": {
  // =>     "dimensions": {
  // =>       "height": 2000,
  // =>       "width": 2000
  // =>     }
  // =>   },
  // =>   "original": "/kmopZLGFVRYs.png",
  // =>   "type": "image/png"
  // => }
});

Installation

$ npm install mediacrush

API

var mediacrush = require('mediacrush');

mediacrush.createAlbum(hashes, callback)

Takes an Array of MediaCrush hashes and groups them into an album on MediaCrush. Calls callback(error, response) when response returns.

mediacrush.getInfo(hash, callback)

Gets information on String or Array hash from MediaCrush and calls callback(error, response).

mediacrush.uploadURL(url, callback)

Uploads the image found at String url to MediaCrush and calls callback(error, response).