summaryrefslogtreecommitdiff
path: root/block-users.rb
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-01-24 21:07:45 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-01-24 21:07:45 -0500
commit73c5ac5fb7be9c9e42b39588e7f65f57f265bfe2 (patch)
tree420ebbabf993be149187898348dc1beb56c358ed /block-users.rb
parent84d268f0d9c7efb267118e1cca54366bead0f58e (diff)
mv block-{spammers,users}.rb
Diffstat (limited to 'block-users.rb')
-rwxr-xr-xblock-users.rb21
1 files changed, 21 insertions, 0 deletions
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