Posted 04 August 2015 - 03:16 PM
So after reading albeit too much into the web github API here goes.
Introducing the github "gist" api for computercraft. Gist as you know is like a pastebin service, but on github, allowing people to use advanced features.
To download this API simply run
you need to get a personal access token from here: https://github.com/settings/tokens save it somewhere safe, you'll need it to use this and it will not save it for you.
The functions you will be most interested in are:
First you need to run the login
login: takes your Personal Access Token, and a nickname to store it under (this is to access the web API, and it is not available outside of the API)
ex login("token", "mini")
To create a gist use
createGist(the nick you provided, filetable, a description, and a bool)
If the bool is true the gist will be public!
returns the ID of the gist
To update an existing gist you will use
updateGist(nick, ID, filetable)
returns ID
filetable format:
getGistFiles(ID)
This will return a table that looks like:
Moved over to the token systemFeel free to use in your OS / program / whatever, just give me a shoutout.
Introducing the github "gist" api for computercraft. Gist as you know is like a pastebin service, but on github, allowing people to use advanced features.
To download this API simply run
pastebin get 21t6LFZA gist
And load then it os.loadAPI("<file location>")you need to get a personal access token from here: https://github.com/settings/tokens save it somewhere safe, you'll need it to use this and it will not save it for you.
The functions you will be most interested in are:
First you need to run the login
login: takes your Personal Access Token, and a nickname to store it under (this is to access the web API, and it is not available outside of the API)
ex login("token", "mini")
To create a gist use
createGist(the nick you provided, filetable, a description, and a bool)
If the bool is true the gist will be public!
returns the ID of the gist
To update an existing gist you will use
updateGist(nick, ID, filetable)
returns ID
filetable format:
{
file1="contents",
file2="contents of file 2"
}
To get files in the gist use:getGistFiles(ID)
This will return a table that looks like:
{
file1 = {
content="contents"
},
file2 = {
contents="contents of file 2"
}
}
To get a list of gists that you have made call getUsersGists(nick)Changelog
April 11, 2016Moved over to the token system
Edited on 12 April 2016 - 12:40 AM