summaryrefslogtreecommitdiff
path: root/show-user-whitelist.rb
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-06-02 12:26:24 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-06-02 12:26:24 -0400
commit3e06c6586453d5c592f3391d2ac0056c49568f86 (patch)
tree326ef20b07f089ab4f0f3b263e4423778534f518 /show-user-whitelist.rb
parent01bccbc17309d454e1ab3e0a118d84ed9ccc79f3 (diff)
mv user-whitelist.rb show-user-whitelist.rb, have autoban.sh update files
Diffstat (limited to 'show-user-whitelist.rb')
-rwxr-xr-xshow-user-whitelist.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/show-user-whitelist.rb b/show-user-whitelist.rb
new file mode 100755
index 0000000..a9d3060
--- /dev/null
+++ b/show-user-whitelist.rb
@@ -0,0 +1,25 @@
+#!/usr/bin/env ruby
+# -*- coding: utf-8 -*-
+
+load 'mwapi.rb'
+require 'yaml'
+
+mw = MWApi.new('https://wiki.parabolagnulinux.org/api.php')
+credentials = YAML.load_file('credentials.yml')
+mw.login(credentials['username'], credentials['password'])
+
+users = []
+aufrom = ''
+while not aufrom.nil? do
+ audata = mw.query(
+ :list => :allusers,
+ :aurights => :autopatrol,
+ :aulimit => 5000,
+ :aufrom => aufrom)
+ users.concat(audata['query']['allusers'])
+ aufrom = (audata['query-continue'].nil?) ? nil : audata['query-continue']['allusers']['aufrom']
+end
+
+users.each do |user|
+ print "#{user['name']}\n"
+end