Class to handle gists (https://gist.github.com/)
hoppfrosch
WTFPL (http://sam.zoy.org/wtfpl/)
0.3.0 (20130816) | hoppfrosch (Internal reorganization concerning documentation) - #1,#2 |
0.2.0 (20130102) | hoppfrosch (Create new gist & delete existing gist) |
0.1.2 (20130102) | hoppfrosch (Functions AKK2StandardControlCharacter(), Standard2AHKControlCharacter()) |
0.1.1 (20121015) | hoppfrosch (Memberfunction getJSON()) |
0.1.0 (20121015) | hoppfrosch (Initial) |
Gist-class | Class to handle gists (https://gist.github.com/) |
Functions | |
delete | |
files | Returns an array with filenames stored in gist |
get | Returns an Object with current GIST |
getJSON | Returns the JSON string with current GIST |
put | Creates a new gist |
url | Returns the URL of the gist |
version | Current version of the class (Versioning scheme according to http://semver.org) |
__basic_auth_header | Creates authorization token for github (**INTERNAL**) |
__extractIDFromURL | Extracts ID from a given gist-url(**INTERNAL**) |
__HTTPdelete | HTTPdelete on Github-URL (**INTERNAL**) |
__HTTPget_obj | HTTPget on Github-URL, returning result as Object (**INTERNAL**) |
__HTTPget | HTTPget on Github-URL, returning result as JSON-String (**INTERNAL**) |
__HTTPpost | HTTPpost JSON-string to on Github-URL, returning result as JSON-String (**INTERNAL**) |
__New | Constructor |
AHK2StandardControlCharacter | Replace AHK-style control characters to Standard |
Standard2AHKControlCharacter | Replace Standard control characters to AHK-style |
put( Contents, Title = "AutoHotkey", Public = "1" )
Creates a new gist
Contents | Contents of the new gist (required) |
Title | title (filename) of the new gist (optional - default: “Autohotkey”) |
Public | Flag to indicate wheter new gist should be public (optional - default: 1 (true)) |
GIST-Object
20120928 (Original) | hoppfrosch |
version()
Current version of the class (Versioning scheme according to http://semver.org)
current version number of the class
20120621 (Original) | hoppfrosch |
__HTTPdelete( url )
HTTPdelete on Github-URL (**INTERNAL**)
url | URL to delete - it’s a relative URL to “https://api.github.com” (required) |
String (“{“message”:”Not Found”}” in case of Error)
20130102 (Original) | hoppfrosch |
__HTTPget_obj( url )
HTTPget on Github-URL, returning result as Object (**INTERNAL**)
url | URL to get - it’s a relative URL to “https://api.github.com” (required) |
json object, (empty object in case of error)
20120928 (Original) | hoppfrosch |
__HTTPget( url )
HTTPget on Github-URL, returning result as JSON-String (**INTERNAL**)
url | URL to get - it’s a relative URL to “https://api.github.com” (required) |
String (“{“message”:”Not Found”}” in case of Error)
20120928 (Original) | hoppfrosch |
__HTTPpost( Contents, url = "/gists" )
HTTPpost JSON-string to on Github-URL, returning result as JSON-String (**INTERNAL**)
Contents | Contents to post |
url | URL to get - it’s a relative URL to “https://api.github.com” (required) |
String (“{“message”:”Not Found”}” in case of Error)
20130201 (Original) | hoppfrosch |
__New( user = "AHKUser", password = "AHKUser2012", debug = 1 )
Constructor
user | Username for https://gist.github.com/ |
password | Password for https://gist.github.com/ |
20120621 (Original) | hoppfrosch 20130102 Removed ID as parameter |
AHK2StandardControlCharacter( J )
Replace AHK-style control characters to Standard
J | String to convert to Standard style |
String in Standard Style
20130201 (Original) | hoppfrosch |
Original | geekdude - http://www.autohotkey.com |
delete( id = )
Returns an array with filenames stored in gist
files()
Returns an Object with current GIST
get( id = )
Returns the JSON string with current GIST
getJSON( id = )
Creates a new gist
put( Contents, Title = "AutoHotkey", Public = "1" )
Returns the URL of the gist
url()
Current version of the class (Versioning scheme according to http://semver.org)
version()
Creates authorization token for github (**INTERNAL**)
__basic_auth_header()
Extracts ID from a given gist-url(**INTERNAL**)
__extractIDFromURL( url )
HTTPdelete on Github-URL (**INTERNAL**)
__HTTPdelete( url )
HTTPget on Github-URL, returning result as Object (**INTERNAL**)
__HTTPget_obj( url )
HTTPget on Github-URL, returning result as JSON-String (**INTERNAL**)
__HTTPget( url )
HTTPpost JSON-string to on Github-URL, returning result as JSON-String (**INTERNAL**)
__HTTPpost( Contents, url = "/gists" )
Constructor
__New( user = "AHKUser", password = "AHKUser2012", debug = 1 )
Replace AHK-style control characters to Standard
AHK2StandardControlCharacter( J )
Replace Standard control characters to AHK-style
Standard2AHKControlCharacter( J )