Created
October 26, 2017 03:50
-
-
Save evitolins/477e4886f9451d0310cfbe058415de0e to your computer and use it in GitHub Desktop.
Grab your gistBox urls and associated labels into JSON
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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