Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- json and gist
- // if the following fails for you, please check if you have to update wslib's curl method by the one in
- // json/extString-curl.scd
- q = ();
- // set your username / password here if you wanna create personalized gists, but its optional.
- q.username = nil;
- q.password = nil;
- ////////////////////////////// get existing gists /////////////
- q.list = Gist.allGistsFor("LFSaw", q.username, q.password);
- q.list.first.id
- // the gist dict for the latest gist of the user "LFSaw"
- q.gist = Gist.getGist(q.list.first.id)
- q.gist.files.asArray.first.content
- // the gist dict for an example gist for the OpenSynthDef world
- q.gist = Gist.getGist(1109924)
- q.gist.files.asArray.first.content.postln.interpret.play
- ////////////////////////////// post new gists /////////////
- ( // test
- var content = (
- 'SynthDef.sc': "SynthDef(\out, {Out.ar(0, FSinOsc.ar(247))})",
- 'SynthDef2.sc': "SynthDef(\out, {|a = \"12\"| var c = 'b'.kr; Out.ar(0, FSinOsc.ar(b))})"
- );
- Gist.contentAsJsonString(content)
- )
- ( // post new gist
- var descr = "My 44th API submittet SynthDef gist";
- var public = true;
- var content = (
- 'SynthDef.sc': "SynthDef(\"out\", {Out.ar(0, FSinOsc.ar(247); \\haha)})"
- );
- q.postGist(descr, content, public, q.username, q.password);
- )
Add Comment
Please, Sign In to add comment