From 73c5ac5fb7be9c9e42b39588e7f65f57f265bfe2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 24 Jan 2014 21:07:45 -0500 Subject: mv block-{spammers,users}.rb --- block-spammers.rb | 25 ------------------------- block-users.rb | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 25 deletions(-) delete mode 100755 block-spammers.rb create mode 100755 block-users.rb diff --git a/block-spammers.rb b/block-spammers.rb deleted file mode 100755 index bfd6dac..0000000 --- a/block-spammers.rb +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env ruby -# -*- coding: utf-8 -*- - -load 'mwapi.rb' -require 'yaml' -require 'pp' - -mw = MWApi.new('https://wiki.parabolagnulinux.org/api.php') -credentials = YAML.load_file('credentials.yml') -mw.login(credentials['username'], credentials['password']) - -file = File.open("/dev/stdin", "rb") -contents = file.read -users = contents.split("\n") -users.each_slice(100) do |list| -# begin - mw.block(list, { - :autoblock => '', - :noemail => '', - :reason => "Spammer (Autodetected: has made edits, but only to deleted pages)", - }) -# rescue -# print "Error blocking users #{list}\n" -# end -end diff --git a/block-users.rb b/block-users.rb new file mode 100755 index 0000000..e9c2d84 --- /dev/null +++ b/block-users.rb @@ -0,0 +1,21 @@ +#!/usr/bin/env ruby +# -*- coding: utf-8 -*- + +load 'mwapi.rb' +require 'yaml' +require 'pp' + +mw = MWApi.new('https://wiki.parabolagnulinux.org/api.php') +credentials = YAML.load_file('credentials.yml') +mw.login(credentials['username'], credentials['password']) + +file = File.open("/dev/stdin", "rb") +contents = file.read +users = contents.split("\n") +users.each_slice(500) do |list| + mw.block(list, { + :autoblock => '', + :noemail => '', + :reason => ARGV.join(' '), + }) +end -- cgit v1.2.3-54-g00ecf