diff options
| author | Astrid Smith | 2010-09-17 17:42:58 -0700 |
|---|---|---|
| committer | Astrid Smith | 2010-09-17 17:42:58 -0700 |
| commit | 49cb0aba379e56edbc22c4090f393ea2e82dab39 (patch) | |
| tree | be80d4856e5f9a0baf0a141a646a7bd37ff7b118 | |
| parent | 1b82dcd6eb9d8c60263cfe137a30bebabd4dd49c (diff) | |
Now I handle, in a broken way, both usernames and IPs.
| -rwxr-xr-x | wikiscraper.pl | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/wikiscraper.pl b/wikiscraper.pl index 7da198f..a482bcb 100755 --- a/wikiscraper.pl +++ b/wikiscraper.pl @@ -18,17 +18,26 @@ while (defined (my $page = $dumpfile->next)) open (FILE, ">", $page->title); print FILE $_->text; close FILE; + + my $user = $_->contributor->id; + if (!defined $user) { + $user = $_->contributor->ip; + $user =~ s/\./_/g; + $user = "ip_" . $user; + } else { + $user = "id_" . $user; + } my @command = ("ci", "-t-" . $page->title, "-d" . $_->timestamp, ($_->comment ne "" ? "-m" . $_->comment : "-mNo message"), "-r" . $_->id, - "-w" . $_->contributor->astext, + "-w" . $user, "-l", $page->title, ); - system(@command); print join " ", @command, "\n"; + system(@command); } } |
