News for hackers. Stuff that matters.
Re:Evil: A site that displays the phone numbers of random Fa... by X-Istence on Saturday May 22, 2010 @09:07PM (#1371454)
So, open the website in the webkit inspector, go to the script tab, open the console and paste this to get the full numbers. Just to make it just a tad bit more evil!

    function parseNumber(num) {
     
      var onlyMildlyEvil = false;
      var digits = num.toString().replace(/[^0-9]/g, '');
      var parsed = '';
          
      if (digits.match(/^0[127]\d{9}$/)) {
        // probably a UK phone number
        parsed += '(' + digits.substr(0,5) + ') ';
        parsed += digits.substr(6);
      }
      
      if (digits.match(/^[2-9]\d{9}$/)) {
        // probably a US phone number
        parsed += '(' + digits.substr(0,3) + ') ';
        parsed += digits.substr(3,3) + '-';
        parsed += digits.substr(6);
      }
      
      if (parsed.length == 0) { parsed = num; }
      
      if(onlyMildlyEvil) {
      
        parsed = "" + parsed;
        parsed = parsed.substr(0,parsed.length-3) + 'XXX';
      
      }
     
      return parsed;
     
    }

There are no comments on this comment yet.