summaryrefslogtreecommitdiff
path: root/user-pages-list.rb
blob: da054bc07cb3c6901310361fe227afbd3c5bdc37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/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'])

apcontinue = ''
while not apcontinue.nil? do
	data = mw.query(:list => :allpages, :apnamespace => 2, :aplimit => 200, :apcontinue => apcontinue)
	for page in data['query']['allpages']
		print "#{page['title']}\n"
	end
	if data['query-continue'].nil?
		apcontinue = nil
	else
		apcontinue = data['query-continue']['allpages']['apcontinue']
	end
end