Skip to content

Instantly share code, notes, and snippets.

@aNNiMON
Last active December 2, 2015 11:01
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 aNNiMON/80a06b5898fc4e831c3c to your computer and use it in GitHub Desktop.
Save aNNiMON/80a06b5898fc4e831c3c to your computer and use it in GitHub Desktop.
List vk audios on page
function saveFile(filename, data) {
var blob = new Blob([data], {type:'text/plain'});
var saveLink = document.createElement("a");
saveLink.download = filename;
saveLink.innerHTML = "Save file";
if (window.webkitURL != null) {
saveLink.href = window.webkitURL.createObjectURL(blob);
} else {
saveLink.href = window.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.getElementsByTagName('input');
var out = '';
for(var i = 0; i < inputs.length; i++) {
if (inputs[i].type.toLowerCase() == 'hidden')
out += '\n' + inputs[i].value;
}
saveFile("list.txt", out);
function saveFile(e,t){var n=new Blob([t],{type:"text/plain"}),i=document.createElement("a");i.download=e,i.innerHTML="Save file",null!=window.webkitURL?i.href=window.webkitURL.createObjectURL(n):(i.href=window.URL.createObjectURL(n),i.onclick=destroyClickedElement,i.style.display="none",document.body.appendChild(i)),i.click()}function destroyClickedElement(e){document.body.removeChild(e.target)}for(var inputs=document.getElementsByTagName("input"),out="",i=0;i<inputs.length;i++)"hidden"==inputs[i].type.toLowerCase()&&(out+="\n"+inputs[i].value);saveFile("list.txt",out);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment