Skip to content

Instantly share code, notes, and snippets.

@Arefu
Last active January 10, 2019 00:56
Show Gist options
  • Save Arefu/5c2fd70a47a4ad677d4b0f056fa0aeea to your computer and use it in GitHub Desktop.
Save Arefu/5c2fd70a47a4ad677d4b0f056fa0aeea to your computer and use it in GitHub Desktop.
A UserScript that lets you download from CoolRoms.com faster then waiting the 100 seconds.
// ==UserScript==
// @name Portal Roms Instant Downloader
// @version 1
// @grant none
// @description No Wait Times For Portal Roms.
// @include http://www.portalroms.com/*
// ==/UserScript==
//This was only tested on the PS2 page, it should work on the other pages assuming they follow the same scheme.
var DownloadLink = "http://www.portalroms.com/torrents/"
var ConsoleNameClass = document.getElementsByClassName("field field-name-field-plataforma field-type-taxonomy-term-reference field-label-inline clearfix")[0].innerText;
var ConsoleName = ConsoleNameClass.replace("System:", "").trim().toLowerCase().replace(/ /g,'');
var GameNameClass = document.getElementsByClassName("field field-name-field-release field-type-text field-label-inline clearfix")[0].innerText;
var GameName = GameNameClass.replace("Release:", "").trim();
DownloadLink = DownloadLink+ConsoleName+"/"+GameName+".torrent";
document.getElementsByClassName("field field-name-field-link-para-download field-type-link-field field-label-inline clearfix")[0].innerHTML = "<div class=\"field-label\">Download link:&nbsp;</div><div class=\"field-items\"><div class=\"field-item even\"><a href="+encodeURI(DownloadLink)+" title=\"DOWNLOAD!\">DOWNLOAD! (USA)</a></div></div>";
@Arefu
Copy link
Author

Arefu commented Jan 10, 2019

Thanks to Chris for helping out with the URL escape stuff to get the download link to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment