// ==UserScript== // @name vkontakte music download // @namespace vkontakte // @description Music download for // @include * // ==/UserScript== function trim(str) { return str.replace(/"/g, ""); } function addLyric(id) { var img = document.getElementById("imgbutton"+id); var str = img.getAttribute("onclick"); var re=/operate((d+)[^0-9]+(d+)[^0-9]+(d+),[^0-9a-zA-Z]+([0-9a-zA-Z]+)/; var arr=re.exec(str); var addon=document.createElement("a"); var user=arr[3]; if (user user=parseInt(user)+100000; user=(user.toString())bstr(1); } var tr=img.parentNode.parentNode; var title_a=tr.getElementsByTagName('td')[1].getElementsByTagName('b')[0].innerHTML; var title_t=tr.getElementsByTagName('td')[1].getElementsByTagName('span')[0].innerHTML; var songtitle = title_a+" - "+title_t; songtitle = trim(songtitle); addon.setAttribute("title",songtitle); addon.setAttribute("alt",songtitle); var link="cs"+arr[2]+"./u"+user+"/audio/"+arr[4]+".mp3"; addon.setAttribute("href",link); addon.innerHTML="u0441u043Au0430u0447u0430u0442u044C"; var span = document.getElementById("title"+id); var title=span.innerHTML.replace(/]+>/g,""); var artb=document.getElementById("performer"+id); var artist=artb.innerHTML.replace(/]+>/g,""); var newdiv=document.createElement("div"); var addon1=document.createElement("a"); addon1.setAttribute("href","lyricspluginwmplayer03/plugin/?artist="+encodeURIComponent(artist)+"&title="+encodeURIComponent(title)); addon1.setAttribute("target","_blank"); addon1.innerHTML="u0442u0435u043Au0441u0442"; newdiv.appendChild(addon); newdiv.innerHTML += " | "; newdiv.appendChild(addon1); newdiv.className="duration"; var thisuserstr=document.getElementById("myprofile").childNodes[0].getAttribute("href"); var userre=//id([0-9]+)?/; var thisuser=userre.exec(thisuserstr)[1]; var notelink="[[audio"+thisuser+"_"+arr[1]+"]]"; blogcode=''+songtitle.replace(/'/g,"'")+''; var codebutton=document.createElement("a"); codebutton.setAttribute("onclick","javas?1?ript:document.getElementById('bloginput').setAttribute('value','"+blogcode+"');document.getElementById('noteinput').setAttribute('value','"+notelink+"');document.getElementById('blogcode').style.display='block';"); codebutton.innerHTML="u0432u0441u0442u0430u0432u0438u0442u044c"; codebutton.setAttribute("href","#"); newdiv.innerHTML += " | "; newdiv.appendChild(codebutton); artb.parentNode.parentNode.appendChild(newdiv); } function addLyrics() { var parent = document.getElementById("audios"); if (!parent) { parent = document.getElementById("bigResult"); } if(parent){ code=document.createElement("div"); code.setAttribute("id","blogcode"); code.style.display='none'; code.setAttribute("style","font-size:30px;background-color:white;display:none;position:absolute;width:500px;height:100px;top:100px;left:2