Skip to content

Instantly share code, notes, and snippets.

@evitolins
Created October 26, 2017 03:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evitolins/477e4886f9451d0310cfbe058415de0e to your computer and use it in GitHub Desktop.
Save evitolins/477e4886f9451d0310cfbe058415de0e to your computer and use it in GitHub Desktop.
Grab your gistBox urls and associated labels into JSON
// Run this in the JS console, after logging into your GistBox
var gists = app.gists.models;
var data = [];
var i, ii, g, l;
for (i=0; i<gists.length; i++) {
gist = gists[i];
g = {};
g.id = gist.id;
g.url = gist.attributes.link_url;
g.labels = [];
l = {};
labelData = app.labelHelpers.getLabelsForGistId(gist.id);
for (ii=0; ii<labelData.length; ii++) {
g.labels.push(labelData[ii].name);
}
data.push(g);
}
JSON.stringify(data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment