Ticket #8 (closed feature: wontfix)

Opened 16 months ago

Last modified 16 months ago

Strip numbers from URL

Reported by: guest Owned by: Cheez
Priority: Low Milestone: 1.9
Component: HellaWorld Version: 1.8
Keywords: Cc:

Description

I made a small Javascript which strips an url of it's characters, only leaving the numbers. You can use this as the file strip.js and call it with onChange="stripurl(this) on line 74 of templates/default.php Import the strip.js on line 57 with <script src="js/strip.js" type="text/javascript"></script>

  function stripurl(newzbinurl) {
    var strValidChars = "0123456789";
    var strChar;
    var newvalue='';
    var nzbid = newzbinurl.value.substr(9); //ignorge first part of URL to strip the v3-part.
    if (nzbid.length == 0) return;

    for (i = 0; i < nzbid.length; i++) {
        strChar = nzbid.charAt(i);
        if (strValidChars.indexOf(strChar) > -1) {
            newvalue = newvalue + strChar;
        }
    }
    if (newvalue.length != 0) {
        newzbinurl.value = newvalue;
    }
  }

Cheers, Lennard

Change History

Changed 16 months ago by Cheez

  • status changed from new to closed
  • resolution set to wontfix

I guess the input box isn't too clear. You can enter a URL to an NZB file there, and it will download that NZB file directly into hellanzb. If it stripped all but numbers from the URL, it would break that feature. If you want to be able to add quickly from a newzbin page, I would recommend the bookrmarklet or, if you're a Firefox user, the Hellafox Extension

Note: See TracTickets for help on using tickets.