Created
April 1, 2016 12:52
-
-
Save aNNiMON/7f7929aeb1eb3f46d07725a21a5ffd84 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
function saveFile(filename, data) { | |
var blob = new Blob([data], {type:'text/plain'}); | |
var saveLink = document.createElement("a"); | |
saveLink.download = filename; | |
saveLink.innerHTML = "Save file"; | |
var url = window.URL || window.webkitURL || window.mozURL || window.msURL; | |
saveLink.href = url.createObjectURL(blob); | |
saveLink.onclick = destroyClickedElement; | |
saveLink.style.display = "none"; | |
document.body.appendChild(saveLink); | |
saveLink.click(); | |
} | |
function destroyClickedElement(event) { | |
document.body.removeChild(event.target); | |
} | |
var inputs = document.getElementsByClassName('audio_row'); | |
var out = ''; | |
for (var i = 0; i < inputs.length; i++) { | |
out += '\n\n' + inputs[i].getAttribute('data-performer') + ' - ' + inputs[i].getAttribute('data-title'); | |
out += '\n' + inputs[i].getAttribute('data-url'); | |
} | |
saveFile("audio-links.txt", out); |
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
function saveFile(t,e){var i=new Blob([e],{type:"text/plain"}),n=document.createElement("a");n.download=t,n.innerHTML="Save file";var o=window.URL||window.webkitURL||window.mozURL||window.msURL;n.href=o.createObjectURL(i),n.onclick=destroyClickedElement,n.style.display="none",document.body.appendChild(n),n.click()}function destroyClickedElement(t){document.body.removeChild(t.target)}for(var inputs=document.getElementsByClassName("audio_row"),out="",i=0;i<inputs.length;i++)out+="\n\n"+inputs[i].getAttribute("data-performer")+" - "+inputs[i].getAttribute("data-title"),out+="\n"+inputs[i].getAttribute("data-url");saveFile("audio-links.txt",out); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment