Advertisement
Reisyukaku

[greasemonkey] Roms43.com

Oct 31st, 2014
3,513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Updated Sept. 10th, 2015
  2. // by Reisyukaku
  3. // ==UserScript==
  4. // @name        Roms43 Downloader
  5. // @namespace   roms43
  6. // @description Download ROMs from roms43
  7. // @include     *roms43.com/download/*
  8. // @version     2
  9. // @grant       none
  10. // ==/UserScript==
  11.  
  12. //Strings
  13. var _3DSLink = "http://instantshare.net/3DS/";
  14. var _3DSCIALink = "http://instantshare.net/3DSCIA/";
  15. var _PS2Link = "http://instantshare.net/PS2/";
  16. var _PSPLink = "http://instantshare.net/PSP/";
  17.  
  18. var title3DS = document.evaluate('/html/body/div/div[1]/div[2]/div/div[2]/div[1]/h4', document, null, XPathResult.ANY_TYPE, null).iterateNext().textContent;
  19. var title3DSCIA = document.evaluate('/html/body/div/div[1]/div[2]/div/div[2]/div[2]/div[4]/div[1]/div[5]', document, null, XPathResult.ANY_TYPE, null).iterateNext().textContent;
  20. var titlePS2 = document.evaluate('/html/body/div/div[1]/div[2]/div/div[2]/div[2]/div[4]/div[1]/div[2]', document, null, XPathResult.ANY_TYPE, null).iterateNext().textContent;
  21. var titlePSP = document.evaluate('/html/body/div/div[1]/div[2]/div/div[2]/div[2]/div[4]/div[1]/div[2]', document, null, XPathResult.ANY_TYPE, null).iterateNext().textContent;
  22.  
  23. //Make button
  24. var but3ds = document.createElement('button');
  25. var but3dscia = document.createElement('button');
  26. var butps2 = document.createElement('button');
  27. var butpsp = document.createElement('button');
  28.  
  29. //Set buttons
  30. but3ds.innerHTML = 'Download .3ds file';
  31. but3ds.setAttribute('type', 'button');
  32. but3ds.setAttribute('onclick', "window.open(\"" + _3DSLink + title3DS + ".3ds\");", '_self');
  33. but3ds.name = 'dlBut';
  34.  
  35. but3dscia.innerHTML = 'Download .cia file';
  36. but3dscia.setAttribute('type', 'button');
  37. but3dscia.setAttribute('onclick', "window.open(\"" + _3DSCIALink + title3DSCIA + ".cia\");", '_self');
  38. but3dscia.name = 'dlBut';
  39.  
  40. butps2.innerHTML = 'Download .iso file';
  41. butps2.setAttribute('type', 'button');
  42. butps2.setAttribute('onclick', "window.open(\"" + _PS2Link + titlePS2 + "\");", '_self');
  43. butps2.name = 'dlBut';
  44.  
  45. butpsp.innerHTML = 'Download .iso file';
  46. butpsp.setAttribute('type', 'button');
  47. butpsp.setAttribute('onclick', "window.open(\"" + _PSPLink + titlePSP + "\");", '_self');
  48. butpsp.name = 'dlBut';
  49.  
  50. var type = document.evaluate('/html/body/div/div[1]/div[2]/div/ol/li[3]/a', document, null, XPathResult.ANY_TYPE, null).iterateNext().textContent;
  51.  
  52. if(type == "3DS ROMs"){
  53.     document.getElementsByClassName('panel panel-dark-blue')[0].appendChild(but3ds);
  54. }
  55. else if(type == "3DS CIA ROMs"){
  56.     document.getElementsByClassName('panel panel-dark-blue')[0].appendChild(but3dscia);
  57. }
  58. else if(type == "PS2 ISOs"){
  59.     document.getElementsByClassName('panel panel-dark-blue')[0].appendChild(butps2);
  60. }
  61. else if(type == "PSP ISOs"){
  62.     document.getElementsByClassName('panel panel-dark-blue')[0].appendChild(butpsp);
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement