sanitysama

VocaDB Do Something

Apr 18th, 2017
1,490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        vocadb
  3. // @namespace   95.211.209.53-e85f8079-b847-455f-b080-8467e2977711@sanitysama
  4. // @description delimiters
  5. // @include     http://vocadb.net/*
  6. // @version     1
  7. // @grant       none
  8. // @run-at      document-end
  9. // ==/UserScript==
  10.  
  11. var path1 = "http://vocadb.net/Album/DownloadTags/";
  12. var pathArray = window.location.pathname.split( '/' )[2];
  13. var path2 = "?setFormatString=true&formatString=%25artist%25%C2%B6%25discnumber%25%C2%B6%25track%25%C2%B6%25title%25%C2%B6%25album%25%C2%B6%25releaseyear%25%C2%B6(%25releaseevent%25)%20%25producers%25%25featvocalists%25";
  14. var link = path1.concat(pathArray,path2);
  15.  
  16. // 1. Create the button
  17. var button = document.createElement("button");
  18. button.innerHTML = "Do Something";
  19.  
  20. // 2. Append somewhere
  21. //var body = document.getElementsByTagName("body")[0];
  22. var node = document.getElementById("topBar");
  23. node.appendChild(button);
  24.  
  25. // 3. Add event handler
  26. button.addEventListener ("click", function() {
  27.   document.location.href = link;
  28. });
Advertisement
Add Comment
Please, Sign In to add comment