Created
March 10, 2015 17:13
-
-
Save pdehaan/7bd63699ba011d64f87f to your computer and use it in GitHub Desktop.
Creates an anonymous, secret Gist.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var fs = require('fs'); | |
var github = require('octonode'); | |
var client = github.client(); | |
var gist = client.gist(); | |
gist.create({ | |
description: 'gist description', | |
files: { | |
'file1.txt': { | |
content: fs.readFileSync('./file1.txt', 'utf-8') | |
} | |
} | |
}, callback); | |
function callback(err, data) { | |
if (err) { | |
return console.error(err); | |
} | |
console.log(JSON.stringify(data, null, 2)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment