Module: MediaWiki::Query::Lists::All
- Included in:
- MediaWiki::Query::Lists
- Defined in:
- lib/mediawiki/query/lists/all.rb
Instance Method Summary collapse
-
#get_all_blocks(limit = @query_limit_default) ⇒ Array<Fixnum>
Gets all block IDs on the wiki.
-
#get_all_categories(limit = @query_limit_default) ⇒ Array<String>
Gets all categories on the entire wiki.
-
#get_all_deleted_files(limit = @query_limit_default) ⇒ Array<String>
Gets an array of all deleted or archived files on the wiki.
-
#get_all_images(limit = @query_limit_default) ⇒ Array<String>
Gets all the images on the wiki.
-
#get_all_pages_in_namespace(namespace, limit = @query_limit_default) ⇒ Array<String>
Gets all pages within a namespace integer.
-
#get_all_protected_titles(protection_level = nil, limit = @query_limit_default) ⇒ Array<String>
Gets a list of all protected pages, by protection level if provided.
-
#get_all_transcluders(page, limit = @query_limit_default) ⇒ Array<String>
Gets all page titles that transclude a given page.
-
#get_all_users(group = nil, limit = @query_limit_default) ⇒ Hash<String, Fixnum>
Gets all users, or all users in a group.
Instance Method Details
#get_all_blocks(limit = @query_limit_default) ⇒ Array<Fixnum>
Gets all block IDs on the wiki. It seems like this only gets non-IP blocks, but the MediaWiki docs are a bit unclear.
74 75 76 77 78 79 80 81 82 |
# File 'lib/mediawiki/query/lists/all.rb', line 74 def get_all_blocks(limit = @query_limit_default) params = { list: 'blocks', bklimit: get_limited(limit), bkprop: 'id' } query_ary(params, 'blocks', 'id') end |
#get_all_categories(limit = @query_limit_default) ⇒ Array<String>
Gets all categories on the entire wiki.
11 12 13 14 15 16 17 18 |
# File 'lib/mediawiki/query/lists/all.rb', line 11 def get_all_categories(limit = @query_limit_default) params = { list: 'allcategories', aclimit: get_limited(limit) } query_ary(params, 'allcategories', '*') end |
#get_all_deleted_files(limit = @query_limit_default) ⇒ Array<String>
Gets an array of all deleted or archived files on the wiki.
105 106 107 108 109 110 111 112 |
# File 'lib/mediawiki/query/lists/all.rb', line 105 def get_all_deleted_files(limit = @query_limit_default) params = { list: 'filearchive', falimit: get_limited(limit) } query_ary(params, 'filearchive', 'name') end |
#get_all_images(limit = @query_limit_default) ⇒ Array<String>
Gets all the images on the wiki.
25 26 27 28 29 30 31 32 |
# File 'lib/mediawiki/query/lists/all.rb', line 25 def get_all_images(limit = @query_limit_default) params = { list: 'allimages', ailimit: get_limited(limit) } query_ary(params, 'allimages', 'name') end |
#get_all_pages_in_namespace(namespace, limit = @query_limit_default) ⇒ Array<String>
Gets all pages within a namespace integer.
40 41 42 43 44 45 46 47 48 |
# File 'lib/mediawiki/query/lists/all.rb', line 40 def get_all_pages_in_namespace(namespace, limit = @query_limit_default) params = { list: 'allpages', apnamespace: namespace, aplimit: get_limited(limit) } query_ary(params, 'allpages', 'title') end |
#get_all_protected_titles(protection_level = nil, limit = @query_limit_default) ⇒ Array<String>
Gets a list of all protected pages, by protection level if provided.
120 121 122 123 124 125 126 127 128 |
# File 'lib/mediawiki/query/lists/all.rb', line 120 def get_all_protected_titles(protection_level = nil, limit = @query_limit_default) params = { list: 'protectedtitles', ptlimit: get_limited(limit) } params[:ptlevel] = protection_level unless protection_level.nil? query_ary(params, 'protectedtitles', 'title') end |
#get_all_transcluders(page, limit = @query_limit_default) ⇒ Array<String>
Gets all page titles that transclude a given page.
90 91 92 93 94 95 96 97 98 |
# File 'lib/mediawiki/query/lists/all.rb', line 90 def get_all_transcluders(page, limit = @query_limit_default) params = { list: 'embeddedin', eititle: page, eilimit: get_limited(limit) } query_ary(params, 'embeddedin', 'title') end |
#get_all_users(group = nil, limit = @query_limit_default) ⇒ Hash<String, Fixnum>
Gets all users, or all users in a group.
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/mediawiki/query/lists/all.rb', line 56 def get_all_users(group = nil, limit = @query_limit_default) params = { list: 'allusers', aulimit: get_limited(limit) } params[:augroup] = group unless group.nil? query(params, {}) do |return_val, query| query['allusers'].each { |u| return_val[u['name']] = u['userid']} end end |