Last active
August 20, 2019 18:45
-
-
Save brandonhellman/6e17387a48d484bad1d54c47a3d279c3 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
// ==UserScript== | |
// @name Forker Include List For Turkernator | |
// @namespace https://github.com/Kadauchi | |
// @version 1.0.1 | |
// @description Does things... | |
// @author Kadauchi | |
// @icon http://i.imgur.com/oGRQwPN.png | |
// @include https://worker.mturk.com/?hit_forker | |
// ==/UserScript== | |
const confirmed = confirm('Download Include List?'); | |
if (confirmed) { | |
const list = JSON.parse(localStorage.getItem('_finder_il')) || {}; | |
const transformed = Object.entries(list).reduce((acc, [key, value]) => { | |
return { | |
...acc, | |
[key] : { | |
term: value.term, | |
name: value.name, | |
sound_cb: !!value.sound_cb, | |
noti_cb: !!value.noti_cb, | |
push_cb: !!value.push_cb, | |
} | |
} | |
}, {}); | |
const el = document.createElement('a'); | |
el.href = `data:text/plain;charset=utf-8,${encodeURIComponent(JSON.stringify(transformed))}`; | |
el.download = 'forker-include-list-for-turkernator.json'; | |
document.body.appendChild(el); | |
el.click(); | |
document.body.removeChild(el); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment