Pranks > Let's Stalk People!

Openbook - Connect and share whether you want to or not

<< < (3/3)

Godot:
For Greasemonkey:


--- Code: ---// ==UserScript==
// @name           More Evil
// @namespace      http://phonelosers.org/
// @include        http://www.tomscott.com/evil/
// ==/UserScript==

var script = document.createElement('script');
script.innerHTML = 'function parseNumber(num) { return num; }';
document.getElementsByTagName('head')[0].appendChild(script);

--- End code ---

It bypasses the number parsing altogether, though, so it doesn't give nicely formatted numbers like usual.

Here is a longer version that parses the numbers:


--- Code: ---// ==UserScript==
// @name           More Evil
// @namespace      http://phonelosers.org/
// @include        http://www.tomscott.com/evil/
// ==/UserScript==

var script = document.createElement('script');
script.innerHTML = 'function parseNumber(num) {         \
  var digits = num.toString().replace(/[^0-9]/g, \'\'); \
  var parsed = \'\';                                    \
  if (digits.match(/^0[127]\\d{9}$/)) {                 \
    parsed += \'(\' + digits.substr(0,5) + \') \';      \
    parsed += digits.substr(6);                         \
  }                                                     \
  if (digits.match(/^[2-9]\\d{9}$/)) {                  \
    parsed += \'(\' + digits.substr(0,3) + \') \';      \
    parsed += digits.substr(3,3) + \'-\';               \
    parsed += digits.substr(6);                         \
  }                                                     \
  if (parsed.length == 0) { parsed = num; }             \
  return parsed;                                        \
}';
document.getElementsByTagName('head')[0].appendChild(script);

--- End code ---

thefinn93:
That doesn't seem to work... I just installed it and it did nothing.

Godot:

--- Quote from: thefinn93 on May 23, 2010, 06:47:58 PM ---That doesn't seem to work... I just installed it and it did nothing.

--- End quote ---

Neither of them? The second one is exactly what I am using right now in Greasemonkey in Firefox 3.6.3 and I am getting the full numbers. I even deleted my existing copy, and reinstalled it by copying what I posted, and is working.

Are you sure Greasemonkey and the script are enabled and "http://www.tomscott.com/evil/" is in the Included Pages for the script?

BTW, it is now available at http://userscripts.org/scripts/show/77452

thefinn93:
I tried the second one, but I was runnng Firefox 3.5.9. I'm updating now.

EDIT: it still doesn't work

Godot:
Here is a Perl script that allows mass collection of phone numbers from public Facebook groups. It needs an API token to work. If you don't want to get your own, you can just use the one from Tom Scott's page. Just view the source for the page and look for the line starting with "var token = ". It will output a tab-delimited list of Facebook IDs, names, and phone numbers.


--- Code: ---#!/usr/bin/perl -w

use warnings;
use strict;
use JSON;
use LWP::Simple;

my $access_token = 'Replace with a valid access token for the Facebook Graph API.';
my $search_query = 'lost "need numbers"';

my $fetch_delay = 1;
my $group_limit = 1000;

my $us_phone_regex = '1?\s*\W?\s*([2-9][0-8][0-9])\s*\W?\s*([2-9][0-9]{2})\s*\W?\s*([0-9]{4})+';

my $json = new JSON;

my $content = get 'https://graph.facebook.com/search?limit=' . $group_limit . '&q=' . $search_query . '&type=group&access_token=' . $access_token;
my $groups = $json->allow_nonref->utf8->relaxed->escape_slash->loose->allow_singlequote->allow_barekey->decode($content);

foreach my $group(@{$groups->{data}}) {

 sleep $fetch_delay;
 my $content = get 'https://graph.facebook.com/' . $group->{id} . '/feed?access_token=' . $access_token;
 my $posts = $json->allow_nonref->utf8->relaxed->escape_slash->loose->allow_singlequote->allow_barekey->decode($content);

 foreach my $post(@{$posts->{data}}) {
  if($post->{message} =~ /$us_phone_regex/) {
   print "$post->{from}->{id}\t$post->{from}->{name}\t($1) $2-$3\n";
  }
 }

}

--- End code ---

It took no more than 15 minutes to collect 8000 numbers.

Navigation

[0] Message Index

[*] Previous page

Go to full version