Mediacrush API wrapper
JavaScript
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitattributes
.gitignore
.travis.yml
LICENSE.txt
README.md
index.js
package.json

README.md

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.urlInfo(urls, callback)

Accepts and Array of urls previously uploaded to MediaCrush. Calls callback(error, response) when response returns.

mediacrush.uploadURL(url, callback)

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