summaryrefslogtreecommitdiff
path: root/block-users.rb
blob: e9c2d84a961f8b4dbc49e7083848591c3f2fd7d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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