voxel-share
Take a snapshot in voxel.js and share on imgur.com/twitter.com.
Props to imgur.com for enabling CORS and accepting base64 image uploads via the browser. :D
usage
Create a share tool:
var share = // pass a copy of the game game: game // api key from https://api.imgur.com/oauth2/addclient key: 'abcd1234' // specify a message to set as caption/tweet message: 'Greetings from voxel.js! @voxeljs' // type of image: image/png or image/jpg type: 'image/png' // quality of image. between 0 and 1 quality: 075 // do something else with the image link after it's uploaded { // Open the tweet dialog with image link this; };
Then upon desired event, open/close the share dialog:
window;
Check the example for a more in-depth usage.
install
With npm do:
npm install voxel-share
Use browserify to require('voxel-share')
.
release history
- 0.3.0 - Added afterUpload feature. Thanks @maxogden!
- 0.2.0 - update to work with imgur api v3. Thanks @maxogden!
- 0.1.0 - initial release
license
Copyright (c) 2013 Kyle Robinson Young
Licensed under the MIT license.