Created
December 7, 2016 15:06
-
-
Save Katharine/8f9170c6bd43e6ab13dfe286c611e269 to your computer and use it in GitHub Desktop.
This file contains 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
// Paste the code below into the JavaScript console while logged in to CloudPebble for | |
// a link to a zip file containing all your CloudPebble projects. | |
console.log("Requesting export..."); | |
Ajax.Post('/ide/transition/export', {}).then(function(data) { | |
console.log("Request result: "); | |
console.log(data); | |
console.log("Waiting for archive. This may take a long time."); | |
return Ajax.PollTask(data.task_id, {on_bad_request: console.error}); | |
}).then(function(result) { | |
console.log("Export succeeded. Download it at " + result); | |
}).catch(function(error) { | |
console.error("Export failed."); | |
console.error(error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My code
https://github.com/klejnov/Pebble-Bobruisk-info/blob/master/src/js/app.js