A JavaScript library for creating anonymous gists.
-
First add jQuery to your project's dependencies.
-
Include
gist.min.js
in your project.
bower install gist --save
var gistName = "HelloWorld"
var gistDesciption = "An example gist."
var payload = {
data: "Hello, World!"
};
gist.create(
gistName,
gistDesciption,
JSON.stringify(payload),
function(success) {
// handle success
console.log(gist.getGistUrl(success));
},
function(error) {
// handle error
console.log(e);
});
See demo for a demo of this code.
Please feel free to contribute. Pull requests are welcome.