mediawiktory 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.dokaz +1 -0
- data/.rubocop_todo.yml +16 -0
- data/.yardopts +2 -0
- data/CHANGELOG.md +10 -4
- data/CONTRIBUTING.md +6 -9
- data/README.md +153 -72
- data/bin/mediawiktory-gen +35 -0
- data/lib/media_wiktory.rb +2 -0
- data/lib/mediawiktory.rb +13 -14
- data/lib/mediawiktory/generator.rb +107 -0
- data/lib/mediawiktory/generator/api.rb +75 -0
- data/lib/mediawiktory/generator/module.rb +105 -0
- data/lib/mediawiktory/generator/param.rb +271 -0
- data/lib/mediawiktory/generator/renderable.rb +59 -0
- data/lib/mediawiktory/generator/templates/_action_method.erb +20 -0
- data/lib/mediawiktory/generator/templates/_module_in_param_docs.erb +2 -0
- data/lib/mediawiktory/generator/templates/_param_impl_boolean.erb +1 -0
- data/lib/mediawiktory/generator/templates/_param_impl_enum.erb +1 -0
- data/lib/mediawiktory/generator/templates/_param_impl_enum_of_modules.erb +1 -0
- data/lib/mediawiktory/generator/templates/_param_impl_string.erb +1 -0
- data/lib/mediawiktory/generator/templates/_param_impl_timestamp.erb +1 -0
- data/lib/mediawiktory/generator/templates/_param_method.erb +14 -0
- data/lib/mediawiktory/generator/templates/action.rb.erb +204 -0
- data/lib/mediawiktory/generator/templates/action_class.rb.erb +30 -0
- data/lib/mediawiktory/generator/templates/actions.rb.erb +31 -0
- data/lib/mediawiktory/generator/templates/api.rb.erb +65 -0
- data/lib/mediawiktory/{client.rb → generator/templates/client.rb.erb} +24 -10
- data/lib/mediawiktory/generator/templates/module_class.rb.erb +22 -0
- data/lib/mediawiktory/generator/templates/response.rb.erb +122 -0
- data/lib/mediawiktory/version.rb +4 -2
- data/lib/mediawiktory/wikipedia/actions.rb +2296 -0
- data/lib/mediawiktory/wikipedia/actions/abusefiltercheckmatch.rb +55 -0
- data/lib/mediawiktory/wikipedia/actions/abusefilterchecksyntax.rb +31 -0
- data/lib/mediawiktory/wikipedia/actions/abusefilterevalexpression.rb +31 -0
- data/lib/mediawiktory/wikipedia/actions/abusefilterunblockautopromote.rb +39 -0
- data/lib/mediawiktory/wikipedia/actions/addstudents.rb +52 -0
- data/lib/mediawiktory/wikipedia/actions/antispoof.rb +31 -0
- data/lib/mediawiktory/wikipedia/actions/base.rb +351 -0
- data/lib/mediawiktory/wikipedia/actions/block.rb +132 -0
- data/lib/mediawiktory/wikipedia/actions/bouncehandler.rb +31 -0
- data/lib/mediawiktory/wikipedia/actions/categorytree.rb +39 -0
- data/lib/mediawiktory/wikipedia/actions/centralauthtoken.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/centralnoticechoicedata.rb +39 -0
- data/lib/mediawiktory/wikipedia/actions/centralnoticequerycampaign.rb +31 -0
- data/lib/mediawiktory/wikipedia/actions/changeauthenticationdata.rb +39 -0
- data/lib/mediawiktory/wikipedia/actions/checktoken.rb +52 -0
- data/lib/mediawiktory/wikipedia/actions/cirrus-config-dump.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/cirrus-mapping-dump.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/cirrus-settings-dump.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/clearhasmsg.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/clientlogin.rb +86 -0
- data/lib/mediawiktory/wikipedia/actions/compare.rb +71 -0
- data/lib/mediawiktory/wikipedia/actions/createaccount.rb +86 -0
- data/lib/mediawiktory/wikipedia/actions/cspreport.rb +38 -0
- data/lib/mediawiktory/wikipedia/actions/cxconfiguration.rb +39 -0
- data/lib/mediawiktory/wikipedia/actions/cxdelete.rb +55 -0
- data/lib/mediawiktory/wikipedia/actions/cxpublish.rb +95 -0
- data/lib/mediawiktory/wikipedia/actions/cxsave.rb +87 -0
- data/lib/mediawiktory/wikipedia/actions/cxsuggestionlist.rb +81 -0
- data/lib/mediawiktory/wikipedia/actions/cxtoken.rb +31 -0
- data/lib/mediawiktory/wikipedia/actions/delete.rb +103 -0
- data/lib/mediawiktory/wikipedia/actions/deleteeducation.rb +65 -0
- data/lib/mediawiktory/wikipedia/actions/deleteglobalaccount.rb +47 -0
- data/lib/mediawiktory/wikipedia/actions/echomarkread.rb +77 -0
- data/lib/mediawiktory/wikipedia/actions/echomarkseen.rb +57 -0
- data/lib/mediawiktory/wikipedia/actions/edit.rb +266 -0
- data/lib/mediawiktory/wikipedia/actions/editmassmessagelist.rb +65 -0
- data/lib/mediawiktory/wikipedia/actions/emailuser.rb +62 -0
- data/lib/mediawiktory/wikipedia/actions/enlist.rb +89 -0
- data/lib/mediawiktory/wikipedia/actions/expandtemplates.rb +129 -0
- data/lib/mediawiktory/wikipedia/actions/fancycaptchareload.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/featuredfeed.rb +57 -0
- data/lib/mediawiktory/wikipedia/actions/feedcontributions.rb +121 -0
- data/lib/mediawiktory/wikipedia/actions/feedrecentchanges.rb +159 -0
- data/lib/mediawiktory/wikipedia/actions/feedwatchlist.rb +108 -0
- data/lib/mediawiktory/wikipedia/actions/filerevert.rb +55 -0
- data/lib/mediawiktory/wikipedia/actions/flagconfig.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/globalblock.rb +76 -0
- data/lib/mediawiktory/wikipedia/actions/globaluserrights.rb +94 -0
- data/lib/mediawiktory/wikipedia/actions/graph.rb +47 -0
- data/lib/mediawiktory/wikipedia/actions/help.rb +64 -0
- data/lib/mediawiktory/wikipedia/actions/imagerotate.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/import.rb +116 -0
- data/lib/mediawiktory/wikipedia/actions/jsonconfig.rb +60 -0
- data/lib/mediawiktory/wikipedia/actions/jsondata.rb +31 -0
- data/lib/mediawiktory/wikipedia/actions/languagesearch.rb +39 -0
- data/lib/mediawiktory/wikipedia/actions/linkaccount.rb +79 -0
- data/lib/mediawiktory/wikipedia/actions/liststudents.rb +63 -0
- data/lib/mediawiktory/wikipedia/actions/login.rb +55 -0
- data/lib/mediawiktory/wikipedia/actions/logout.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/managetags.rb +80 -0
- data/lib/mediawiktory/wikipedia/actions/massmessage.rb +55 -0
- data/lib/mediawiktory/wikipedia/actions/mergehistory.rb +79 -0
- data/lib/mediawiktory/wikipedia/actions/mobileview.rb +170 -0
- data/lib/mediawiktory/wikipedia/actions/move.rb +131 -0
- data/lib/mediawiktory/wikipedia/actions/oathvalidate.rb +47 -0
- data/lib/mediawiktory/wikipedia/actions/opensearch.rb +105 -0
- data/lib/mediawiktory/wikipedia/actions/options.rb +80 -0
- data/lib/mediawiktory/wikipedia/actions/pagetriageaction.rb +67 -0
- data/lib/mediawiktory/wikipedia/actions/pagetriagelist.rb +142 -0
- data/lib/mediawiktory/wikipedia/actions/pagetriagestats.rb +59 -0
- data/lib/mediawiktory/wikipedia/actions/pagetriagetagging.rb +83 -0
- data/lib/mediawiktory/wikipedia/actions/pagetriagetemplate.rb +39 -0
- data/lib/mediawiktory/wikipedia/actions/paraminfo.rb +91 -0
- data/lib/mediawiktory/wikipedia/actions/parse.rb +286 -0
- data/lib/mediawiktory/wikipedia/actions/parsoid-batch.rb +31 -0
- data/lib/mediawiktory/wikipedia/actions/patrol.rb +60 -0
- data/lib/mediawiktory/wikipedia/actions/protect.rb +121 -0
- data/lib/mediawiktory/wikipedia/actions/purge.rb +155 -0
- data/lib/mediawiktory/wikipedia/actions/query.rb +325 -0
- data/lib/mediawiktory/wikipedia/actions/refresheducation.rb +57 -0
- data/lib/mediawiktory/wikipedia/actions/removeauthenticationdata.rb +39 -0
- data/lib/mediawiktory/wikipedia/actions/resetpassword.rb +47 -0
- data/lib/mediawiktory/wikipedia/actions/review.rb +54 -0
- data/lib/mediawiktory/wikipedia/actions/reviewactivity.rb +60 -0
- data/lib/mediawiktory/wikipedia/actions/revisiondelete.rb +125 -0
- data/lib/mediawiktory/wikipedia/actions/rollback.rb +96 -0
- data/lib/mediawiktory/wikipedia/actions/rsd.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/sanitize-mapdata.rb +39 -0
- data/lib/mediawiktory/wikipedia/actions/scribunto-console.rb +62 -0
- data/lib/mediawiktory/wikipedia/actions/setglobalaccountstatus.rb +81 -0
- data/lib/mediawiktory/wikipedia/actions/setnotificationtimestamp.rb +180 -0
- data/lib/mediawiktory/wikipedia/actions/setpagelanguage.rb +81 -0
- data/lib/mediawiktory/wikipedia/actions/shortenurl.rb +31 -0
- data/lib/mediawiktory/wikipedia/actions/sitematrix.rb +91 -0
- data/lib/mediawiktory/wikipedia/actions/spamblacklist.rb +36 -0
- data/lib/mediawiktory/wikipedia/actions/stabilize.rb +76 -0
- data/lib/mediawiktory/wikipedia/actions/stashedit.rb +113 -0
- data/lib/mediawiktory/wikipedia/actions/strikevote.rb +60 -0
- data/lib/mediawiktory/wikipedia/actions/tag.rb +117 -0
- data/lib/mediawiktory/wikipedia/actions/templatedata.rb +148 -0
- data/lib/mediawiktory/wikipedia/actions/thank.rb +47 -0
- data/lib/mediawiktory/wikipedia/actions/titleblacklist.rb +51 -0
- data/lib/mediawiktory/wikipedia/actions/tokens.rb +36 -0
- data/lib/mediawiktory/wikipedia/actions/transcodereset.rb +47 -0
- data/lib/mediawiktory/wikipedia/actions/ulslocalization.rb +31 -0
- data/lib/mediawiktory/wikipedia/actions/unblock.rb +76 -0
- data/lib/mediawiktory/wikipedia/actions/undelete.rb +99 -0
- data/lib/mediawiktory/wikipedia/actions/unlinkaccount.rb +39 -0
- data/lib/mediawiktory/wikipedia/actions/upload.rb +172 -0
- data/lib/mediawiktory/wikipedia/actions/userrights.rb +107 -0
- data/lib/mediawiktory/wikipedia/actions/validatepassword.rb +55 -0
- data/lib/mediawiktory/wikipedia/actions/visualeditor.rb +96 -0
- data/lib/mediawiktory/wikipedia/actions/visualeditoredit.rb +164 -0
- data/lib/mediawiktory/wikipedia/actions/watch.rb +164 -0
- data/lib/mediawiktory/wikipedia/actions/webapp-manifest.rb +25 -0
- data/lib/mediawiktory/wikipedia/actions/wikilove.rb +79 -0
- data/lib/mediawiktory/wikipedia/actions/zeroconfig.rb +44 -0
- data/lib/mediawiktory/wikipedia/api.rb +80 -0
- data/lib/mediawiktory/wikipedia/client.rb +61 -0
- data/lib/mediawiktory/wikipedia/modules/abusefilters.rb +85 -0
- data/lib/mediawiktory/wikipedia/modules/abuselog.rb +101 -0
- data/lib/mediawiktory/wikipedia/modules/allcategories.rb +104 -0
- data/lib/mediawiktory/wikipedia/modules/alldeletedrevisions.rb +213 -0
- data/lib/mediawiktory/wikipedia/modules/allfileusages.rb +95 -0
- data/lib/mediawiktory/wikipedia/modules/allimages.rb +183 -0
- data/lib/mediawiktory/wikipedia/modules/alllinks.rb +108 -0
- data/lib/mediawiktory/wikipedia/modules/allmessages.rb +143 -0
- data/lib/mediawiktory/wikipedia/modules/allpages.rb +182 -0
- data/lib/mediawiktory/wikipedia/modules/allredirects.rb +108 -0
- data/lib/mediawiktory/wikipedia/modules/allrevisions.rb +181 -0
- data/lib/mediawiktory/wikipedia/modules/alltransclusions.rb +108 -0
- data/lib/mediawiktory/wikipedia/modules/allusers.rb +141 -0
- data/lib/mediawiktory/wikipedia/modules/authmanagerinfo.rb +63 -0
- data/lib/mediawiktory/wikipedia/modules/babel.rb +30 -0
- data/lib/mediawiktory/wikipedia/modules/backlinks.rb +100 -0
- data/lib/mediawiktory/wikipedia/modules/betafeatures.rb +30 -0
- data/lib/mediawiktory/wikipedia/modules/blocks.rb +127 -0
- data/lib/mediawiktory/wikipedia/modules/categories.rb +90 -0
- data/lib/mediawiktory/wikipedia/modules/categoryinfo.rb +30 -0
- data/lib/mediawiktory/wikipedia/modules/categorymembers.rb +183 -0
- data/lib/mediawiktory/wikipedia/modules/centralnoticelogs.rb +70 -0
- data/lib/mediawiktory/wikipedia/modules/checkuser.rb +83 -0
- data/lib/mediawiktory/wikipedia/modules/checkuserlog.rb +83 -0
- data/lib/mediawiktory/wikipedia/modules/contenttranslation.rb +83 -0
- data/lib/mediawiktory/wikipedia/modules/contenttranslationcorpora.rb +50 -0
- data/lib/mediawiktory/wikipedia/modules/contenttranslationlangtrend.rb +51 -0
- data/lib/mediawiktory/wikipedia/modules/contenttranslationstats.rb +22 -0
- data/lib/mediawiktory/wikipedia/modules/contenttranslationsuggestions.rb +70 -0
- data/lib/mediawiktory/wikipedia/modules/contributors.rb +90 -0
- data/lib/mediawiktory/wikipedia/modules/coordinates.rb +80 -0
- data/lib/mediawiktory/wikipedia/modules/cxpublishedtranslations.rb +54 -0
- data/lib/mediawiktory/wikipedia/modules/cxtranslatorstats.rb +30 -0
- data/lib/mediawiktory/wikipedia/modules/deletedrevisions.rb +169 -0
- data/lib/mediawiktory/wikipedia/modules/deletedrevs.rb +148 -0
- data/lib/mediawiktory/wikipedia/modules/duplicatefiles.rb +58 -0
- data/lib/mediawiktory/wikipedia/modules/embeddedin.rb +93 -0
- data/lib/mediawiktory/wikipedia/modules/extlinks.rb +66 -0
- data/lib/mediawiktory/wikipedia/modules/extracts.rb +81 -0
- data/lib/mediawiktory/wikipedia/modules/exturlusage.rb +92 -0
- data/lib/mediawiktory/wikipedia/modules/featureusage.rb +59 -0
- data/lib/mediawiktory/wikipedia/modules/filearchive.rb +104 -0
- data/lib/mediawiktory/wikipedia/modules/filerepoinfo.rb +35 -0
- data/lib/mediawiktory/wikipedia/modules/fileusage.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/flagged.rb +22 -0
- data/lib/mediawiktory/wikipedia/modules/g-allcategories.rb +91 -0
- data/lib/mediawiktory/wikipedia/modules/g-alldeletedrevisions.rb +200 -0
- data/lib/mediawiktory/wikipedia/modules/g-allfileusages.rb +82 -0
- data/lib/mediawiktory/wikipedia/modules/g-allimages.rb +170 -0
- data/lib/mediawiktory/wikipedia/modules/g-alllinks.rb +95 -0
- data/lib/mediawiktory/wikipedia/modules/g-allpages.rb +182 -0
- data/lib/mediawiktory/wikipedia/modules/g-allredirects.rb +95 -0
- data/lib/mediawiktory/wikipedia/modules/g-allrevisions.rb +168 -0
- data/lib/mediawiktory/wikipedia/modules/g-alltransclusions.rb +95 -0
- data/lib/mediawiktory/wikipedia/modules/g-backlinks.rb +100 -0
- data/lib/mediawiktory/wikipedia/modules/g-categories.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/g-categorymembers.rb +170 -0
- data/lib/mediawiktory/wikipedia/modules/g-contenttranslation.rb +83 -0
- data/lib/mediawiktory/wikipedia/modules/g-contenttranslationsuggestions.rb +70 -0
- data/lib/mediawiktory/wikipedia/modules/g-deletedrevisions.rb +156 -0
- data/lib/mediawiktory/wikipedia/modules/g-duplicatefiles.rb +58 -0
- data/lib/mediawiktory/wikipedia/modules/g-embeddedin.rb +93 -0
- data/lib/mediawiktory/wikipedia/modules/g-exturlusage.rb +79 -0
- data/lib/mediawiktory/wikipedia/modules/g-fileusage.rb +64 -0
- data/lib/mediawiktory/wikipedia/modules/g-geosearch.rb +116 -0
- data/lib/mediawiktory/wikipedia/modules/g-gettingstartedgetpages.rb +46 -0
- data/lib/mediawiktory/wikipedia/modules/g-images.rb +64 -0
- data/lib/mediawiktory/wikipedia/modules/g-imageusage.rb +100 -0
- data/lib/mediawiktory/wikipedia/modules/g-iwbacklinks.rb +67 -0
- data/lib/mediawiktory/wikipedia/modules/g-langbacklinks.rb +67 -0
- data/lib/mediawiktory/wikipedia/modules/g-links.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/g-linkshere.rb +64 -0
- data/lib/mediawiktory/wikipedia/modules/g-mostviewed.rb +51 -0
- data/lib/mediawiktory/wikipedia/modules/g-oldreviewedpages.rb +114 -0
- data/lib/mediawiktory/wikipedia/modules/g-pageswithprop.rb +59 -0
- data/lib/mediawiktory/wikipedia/modules/g-prefixsearch.rb +72 -0
- data/lib/mediawiktory/wikipedia/modules/g-projectpages.rb +58 -0
- data/lib/mediawiktory/wikipedia/modules/g-protectedtitles.rb +93 -0
- data/lib/mediawiktory/wikipedia/modules/g-querypage.rb +51 -0
- data/lib/mediawiktory/wikipedia/modules/g-random.rb +71 -0
- data/lib/mediawiktory/wikipedia/modules/g-recentchanges.rb +157 -0
- data/lib/mediawiktory/wikipedia/modules/g-redirects.rb +64 -0
- data/lib/mediawiktory/wikipedia/modules/g-revisions.rb +185 -0
- data/lib/mediawiktory/wikipedia/modules/g-search.rb +112 -0
- data/lib/mediawiktory/wikipedia/modules/g-templates.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/g-transcludedin.rb +64 -0
- data/lib/mediawiktory/wikipedia/modules/g-watchlist.rb +145 -0
- data/lib/mediawiktory/wikipedia/modules/g-watchlistraw.rb +109 -0
- data/lib/mediawiktory/wikipedia/modules/g-wblistentityusage.rb +64 -0
- data/lib/mediawiktory/wikipedia/modules/gadgetcategories.rb +48 -0
- data/lib/mediawiktory/wikipedia/modules/gadgets.rb +75 -0
- data/lib/mediawiktory/wikipedia/modules/geosearch.rb +129 -0
- data/lib/mediawiktory/wikipedia/modules/gettingstartedgetpages.rb +46 -0
- data/lib/mediawiktory/wikipedia/modules/globalallusers.rb +106 -0
- data/lib/mediawiktory/wikipedia/modules/globalblocks.rb +106 -0
- data/lib/mediawiktory/wikipedia/modules/globalgroups.rb +35 -0
- data/lib/mediawiktory/wikipedia/modules/globalusage.rb +58 -0
- data/lib/mediawiktory/wikipedia/modules/globaluserinfo.rb +43 -0
- data/lib/mediawiktory/wikipedia/modules/imageinfo.rb +142 -0
- data/lib/mediawiktory/wikipedia/modules/images.rb +64 -0
- data/lib/mediawiktory/wikipedia/modules/imageusage.rb +100 -0
- data/lib/mediawiktory/wikipedia/modules/info.rb +69 -0
- data/lib/mediawiktory/wikipedia/modules/iwbacklinks.rb +80 -0
- data/lib/mediawiktory/wikipedia/modules/iwlinks.rb +87 -0
- data/lib/mediawiktory/wikipedia/modules/json.rb +57 -0
- data/lib/mediawiktory/wikipedia/modules/jsonfm.rb +64 -0
- data/lib/mediawiktory/wikipedia/modules/langbacklinks.rb +80 -0
- data/lib/mediawiktory/wikipedia/modules/langlinks.rb +95 -0
- data/lib/mediawiktory/wikipedia/modules/links.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/linkshere.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/logevents.rb +151 -0
- data/lib/mediawiktory/wikipedia/modules/mapdata.rb +46 -0
- data/lib/mediawiktory/wikipedia/modules/mmsites.rb +30 -0
- data/lib/mediawiktory/wikipedia/modules/mostviewed.rb +51 -0
- data/lib/mediawiktory/wikipedia/modules/mystashedfiles.rb +51 -0
- data/lib/mediawiktory/wikipedia/modules/none.rb +22 -0
- data/lib/mediawiktory/wikipedia/modules/notifications.rb +174 -0
- data/lib/mediawiktory/wikipedia/modules/oath.rb +30 -0
- data/lib/mediawiktory/wikipedia/modules/oldreviewedpages.rb +114 -0
- data/lib/mediawiktory/wikipedia/modules/ores.rb +22 -0
- data/lib/mediawiktory/wikipedia/modules/pageassessments.rb +45 -0
- data/lib/mediawiktory/wikipedia/modules/pageimages.rb +72 -0
- data/lib/mediawiktory/wikipedia/modules/pagepropnames.rb +38 -0
- data/lib/mediawiktory/wikipedia/modules/pageprops.rb +43 -0
- data/lib/mediawiktory/wikipedia/modules/pageswithprop.rb +72 -0
- data/lib/mediawiktory/wikipedia/modules/pageterms.rb +43 -0
- data/lib/mediawiktory/wikipedia/modules/pageviews.rb +51 -0
- data/lib/mediawiktory/wikipedia/modules/php.rb +35 -0
- data/lib/mediawiktory/wikipedia/modules/phpfm.rb +42 -0
- data/lib/mediawiktory/wikipedia/modules/prefixsearch.rb +72 -0
- data/lib/mediawiktory/wikipedia/modules/projectpages.rb +58 -0
- data/lib/mediawiktory/wikipedia/modules/projects.rb +29 -0
- data/lib/mediawiktory/wikipedia/modules/protectedtitles.rb +106 -0
- data/lib/mediawiktory/wikipedia/modules/querypage.rb +51 -0
- data/lib/mediawiktory/wikipedia/modules/random.rb +71 -0
- data/lib/mediawiktory/wikipedia/modules/rawfm.rb +29 -0
- data/lib/mediawiktory/wikipedia/modules/recentchanges.rb +170 -0
- data/lib/mediawiktory/wikipedia/modules/redirects.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/references.rb +30 -0
- data/lib/mediawiktory/wikipedia/modules/revisions.rb +198 -0
- data/lib/mediawiktory/wikipedia/modules/search.rb +125 -0
- data/lib/mediawiktory/wikipedia/modules/siteinfo.rb +70 -0
- data/lib/mediawiktory/wikipedia/modules/siteviews.rb +43 -0
- data/lib/mediawiktory/wikipedia/modules/stashimageinfo.rb +85 -0
- data/lib/mediawiktory/wikipedia/modules/tags.rb +51 -0
- data/lib/mediawiktory/wikipedia/modules/templates.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/tokens.rb +35 -0
- data/lib/mediawiktory/wikipedia/modules/transcludedin.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/transcodestatus.rb +22 -0
- data/lib/mediawiktory/wikipedia/modules/unreadnotificationpages.rb +50 -0
- data/lib/mediawiktory/wikipedia/modules/usercontribs.rb +155 -0
- data/lib/mediawiktory/wikipedia/modules/userinfo.rb +43 -0
- data/lib/mediawiktory/wikipedia/modules/users.rb +82 -0
- data/lib/mediawiktory/wikipedia/modules/videoinfo.rb +143 -0
- data/lib/mediawiktory/wikipedia/modules/watchlist.rb +158 -0
- data/lib/mediawiktory/wikipedia/modules/watchlistraw.rb +122 -0
- data/lib/mediawiktory/wikipedia/modules/wbentityusage.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/wblistentityusage.rb +77 -0
- data/lib/mediawiktory/wikipedia/modules/wikibase.rb +35 -0
- data/lib/mediawiktory/wikipedia/modules/wikisets.rb +58 -0
- data/lib/mediawiktory/wikipedia/modules/xml.rb +37 -0
- data/lib/mediawiktory/wikipedia/modules/xmlfm.rb +44 -0
- data/lib/mediawiktory/wikipedia/response.rb +122 -0
- data/lib/nokogiri/more.rb +12 -12
- data/mediawiktory.gemspec +4 -0
- metadata +350 -257
- data/bin/mediawiktory +0 -13
- data/doc/mediawiki_api_types.md +0 -14
- data/examples/query.rb +0 -15
- data/examples/query_generator.rb +0 -15
- data/lib/faraday/naive_cache.rb +0 -40
- data/lib/mediawiktory/action.rb +0 -61
- data/lib/mediawiktory/generated/abusefiltercheckmatch.rb +0 -9
- data/lib/mediawiktory/generated/abusefilterchecksyntax.rb +0 -6
- data/lib/mediawiktory/generated/abusefilterevalexpression.rb +0 -6
- data/lib/mediawiktory/generated/abusefilters.rb +0 -12
- data/lib/mediawiktory/generated/abusefilterunblockautopromote.rb +0 -8
- data/lib/mediawiktory/generated/abuselog.rb +0 -14
- data/lib/mediawiktory/generated/actions_mixin.rb +0 -352
- data/lib/mediawiktory/generated/addstudents.rb +0 -9
- data/lib/mediawiktory/generated/allcategories.rb +0 -15
- data/lib/mediawiktory/generated/alldeletedrevisions.rb +0 -28
- data/lib/mediawiktory/generated/allfileusages.rb +0 -14
- data/lib/mediawiktory/generated/allimages.rb +0 -23
- data/lib/mediawiktory/generated/alllinks.rb +0 -15
- data/lib/mediawiktory/generated/allmessages.rb +0 -19
- data/lib/mediawiktory/generated/allpages.rb +0 -21
- data/lib/mediawiktory/generated/allredirects.rb +0 -15
- data/lib/mediawiktory/generated/allrevisions.rb +0 -24
- data/lib/mediawiktory/generated/alltransclusions.rb +0 -15
- data/lib/mediawiktory/generated/allusers.rb +0 -18
- data/lib/mediawiktory/generated/antispoof.rb +0 -6
- data/lib/mediawiktory/generated/authmanagerinfo.rb +0 -10
- data/lib/mediawiktory/generated/babel.rb +0 -7
- data/lib/mediawiktory/generated/backlinks.rb +0 -14
- data/lib/mediawiktory/generated/betafeatures.rb +0 -7
- data/lib/mediawiktory/generated/block.rb +0 -20
- data/lib/mediawiktory/generated/blocks.rb +0 -16
- data/lib/mediawiktory/generated/bouncehandler.rb +0 -7
- data/lib/mediawiktory/generated/categories.rb +0 -12
- data/lib/mediawiktory/generated/categoryinfo.rb +0 -7
- data/lib/mediawiktory/generated/categorymembers.rb +0 -23
- data/lib/mediawiktory/generated/categorytree.rb +0 -7
- data/lib/mediawiktory/generated/centralauthtoken.rb +0 -5
- data/lib/mediawiktory/generated/centralnoticechoicedata.rb +0 -7
- data/lib/mediawiktory/generated/centralnoticelogs.rb +0 -11
- data/lib/mediawiktory/generated/centralnoticequerycampaign.rb +0 -6
- data/lib/mediawiktory/generated/changeauthenticationdata.rb +0 -10
- data/lib/mediawiktory/generated/checktoken.rb +0 -8
- data/lib/mediawiktory/generated/checkuser.rb +0 -14
- data/lib/mediawiktory/generated/checkuserlog.rb +0 -13
- data/lib/mediawiktory/generated/cirrus-config-dump.rb +0 -5
- data/lib/mediawiktory/generated/cirrus-mapping-dump.rb +0 -5
- data/lib/mediawiktory/generated/cirrus-settings-dump.rb +0 -5
- data/lib/mediawiktory/generated/clearhasmsg.rb +0 -6
- data/lib/mediawiktory/generated/clientlogin.rb +0 -15
- data/lib/mediawiktory/generated/compare.rb +0 -11
- data/lib/mediawiktory/generated/contenttranslation.rb +0 -12
- data/lib/mediawiktory/generated/contenttranslationcorpora.rb +0 -8
- data/lib/mediawiktory/generated/contenttranslationlangtrend.rb +0 -8
- data/lib/mediawiktory/generated/contenttranslationstats.rb +0 -5
- data/lib/mediawiktory/generated/contenttranslationsuggestions.rb +0 -11
- data/lib/mediawiktory/generated/contributors.rb +0 -12
- data/lib/mediawiktory/generated/coordinates.rb +0 -12
- data/lib/mediawiktory/generated/createaccount.rb +0 -15
- data/lib/mediawiktory/generated/cspreport.rb +0 -8
- data/lib/mediawiktory/generated/cxconfiguration.rb +0 -7
- data/lib/mediawiktory/generated/cxdelete.rb +0 -10
- data/lib/mediawiktory/generated/cxpublish.rb +0 -15
- data/lib/mediawiktory/generated/cxpublishedtranslations.rb +0 -9
- data/lib/mediawiktory/generated/cxsave.rb +0 -14
- data/lib/mediawiktory/generated/cxsuggestionlist.rb +0 -12
- data/lib/mediawiktory/generated/cxtoken.rb +0 -7
- data/lib/mediawiktory/generated/cxtranslatorstats.rb +0 -6
- data/lib/mediawiktory/generated/delete.rb +0 -15
- data/lib/mediawiktory/generated/deletedrevisions.rb +0 -23
- data/lib/mediawiktory/generated/deletedrevs.rb +0 -20
- data/lib/mediawiktory/generated/deleteeducation.rb +0 -10
- data/lib/mediawiktory/generated/deleteglobalaccount.rb +0 -9
- data/lib/mediawiktory/generated/duplicatefiles.rb +0 -10
- data/lib/mediawiktory/generated/echomarkread.rb +0 -11
- data/lib/mediawiktory/generated/echomarkseen.rb +0 -9
- data/lib/mediawiktory/generated/edit.rb +0 -35
- data/lib/mediawiktory/generated/editmassmessagelist.rb +0 -10
- data/lib/mediawiktory/generated/emailuser.rb +0 -11
- data/lib/mediawiktory/generated/embeddedin.rb +0 -13
- data/lib/mediawiktory/generated/enlist.rb +0 -13
- data/lib/mediawiktory/generated/expandtemplates.rb +0 -16
- data/lib/mediawiktory/generated/extlinks.rb +0 -11
- data/lib/mediawiktory/generated/extracts.rb +0 -13
- data/lib/mediawiktory/generated/exturlusage.rb +0 -13
- data/lib/mediawiktory/generated/fancycaptchareload.rb +0 -5
- data/lib/mediawiktory/generated/featuredfeed.rb +0 -8
- data/lib/mediawiktory/generated/featureusage.rb +0 -10
- data/lib/mediawiktory/generated/feedcontributions.rb +0 -16
- data/lib/mediawiktory/generated/feedrecentchanges.rb +0 -22
- data/lib/mediawiktory/generated/feedwatchlist.rb +0 -14
- data/lib/mediawiktory/generated/filearchive.rb +0 -15
- data/lib/mediawiktory/generated/filerepoinfo.rb +0 -7
- data/lib/mediawiktory/generated/filerevert.rb +0 -10
- data/lib/mediawiktory/generated/fileusage.rb +0 -11
- data/lib/mediawiktory/generated/flagconfig.rb +0 -5
- data/lib/mediawiktory/generated/flagged.rb +0 -5
- data/lib/mediawiktory/generated/gadgetcategories.rb +0 -8
- data/lib/mediawiktory/generated/gadgets.rb +0 -11
- data/lib/mediawiktory/generated/geosearch.rb +0 -17
- data/lib/mediawiktory/generated/gettingstartedgetpages.rb +0 -9
- data/lib/mediawiktory/generated/globalallusers.rb +0 -14
- data/lib/mediawiktory/generated/globalblock.rb +0 -13
- data/lib/mediawiktory/generated/globalblocks.rb +0 -14
- data/lib/mediawiktory/generated/globalgroups.rb +0 -7
- data/lib/mediawiktory/generated/globalusage.rb +0 -10
- data/lib/mediawiktory/generated/globaluserinfo.rb +0 -8
- data/lib/mediawiktory/generated/globaluserrights.rb +0 -13
- data/lib/mediawiktory/generated/graph.rb +0 -8
- data/lib/mediawiktory/generated/help.rb +0 -10
- data/lib/mediawiktory/generated/imageinfo.rb +0 -20
- data/lib/mediawiktory/generated/imagerotate.rb +0 -5
- data/lib/mediawiktory/generated/images.rb +0 -10
- data/lib/mediawiktory/generated/imageusage.rb +0 -14
- data/lib/mediawiktory/generated/import.rb +0 -16
- data/lib/mediawiktory/generated/info.rb +0 -10
- data/lib/mediawiktory/generated/iwbacklinks.rb +0 -12
- data/lib/mediawiktory/generated/iwlinks.rb +0 -13
- data/lib/mediawiktory/generated/jsonconfig.rb +0 -9
- data/lib/mediawiktory/generated/jsondata.rb +0 -6
- data/lib/mediawiktory/generated/langbacklinks.rb +0 -12
- data/lib/mediawiktory/generated/langlinks.rb +0 -14
- data/lib/mediawiktory/generated/languagesearch.rb +0 -7
- data/lib/mediawiktory/generated/linkaccount.rb +0 -14
- data/lib/mediawiktory/generated/links.rb +0 -11
- data/lib/mediawiktory/generated/linkshere.rb +0 -11
- data/lib/mediawiktory/generated/liststudents.rb +0 -9
- data/lib/mediawiktory/generated/logevents.rb +0 -19
- data/lib/mediawiktory/generated/login.rb +0 -11
- data/lib/mediawiktory/generated/logout.rb +0 -5
- data/lib/mediawiktory/generated/managetags.rb +0 -12
- data/lib/mediawiktory/generated/mapdata.rb +0 -9
- data/lib/mediawiktory/generated/massmessage.rb +0 -10
- data/lib/mediawiktory/generated/mergehistory.rb +0 -13
- data/lib/mediawiktory/generated/mmsites.rb +0 -6
- data/lib/mediawiktory/generated/mobileview.rb +0 -22
- data/lib/mediawiktory/generated/mostviewed.rb +0 -9
- data/lib/mediawiktory/generated/move.rb +0 -19
- data/lib/mediawiktory/generated/mystashedfiles.rb +0 -9
- data/lib/mediawiktory/generated/notifications.rb +0 -22
- data/lib/mediawiktory/generated/oath.rb +0 -7
- data/lib/mediawiktory/generated/oathvalidate.rb +0 -9
- data/lib/mediawiktory/generated/oldreviewedpages.rb +0 -15
- data/lib/mediawiktory/generated/opensearch.rb +0 -12
- data/lib/mediawiktory/generated/options.rb +0 -12
- data/lib/mediawiktory/generated/ores.rb +0 -6
- data/lib/mediawiktory/generated/pageassessments.rb +0 -9
- data/lib/mediawiktory/generated/pageimages.rb +0 -11
- data/lib/mediawiktory/generated/pagepropnames.rb +0 -8
- data/lib/mediawiktory/generated/pageprops.rb +0 -8
- data/lib/mediawiktory/generated/pageswithprop.rb +0 -11
- data/lib/mediawiktory/generated/pageterms.rb +0 -8
- data/lib/mediawiktory/generated/pagetriageaction.rb +0 -11
- data/lib/mediawiktory/generated/pagetriagelist.rb +0 -21
- data/lib/mediawiktory/generated/pagetriagestats.rb +0 -10
- data/lib/mediawiktory/generated/pagetriagetagging.rb +0 -13
- data/lib/mediawiktory/generated/pagetriagetemplate.rb +0 -7
- data/lib/mediawiktory/generated/pageviews.rb +0 -9
- data/lib/mediawiktory/generated/paraminfo.rb +0 -11
- data/lib/mediawiktory/generated/parse.rb +0 -36
- data/lib/mediawiktory/generated/parsoid-batch.rb +0 -6
- data/lib/mediawiktory/generated/patrol.rb +0 -10
- data/lib/mediawiktory/generated/prefixsearch.rb +0 -10
- data/lib/mediawiktory/generated/projectpages.rb +0 -10
- data/lib/mediawiktory/generated/projects.rb +0 -7
- data/lib/mediawiktory/generated/protect.rb +0 -16
- data/lib/mediawiktory/generated/protectedtitles.rb +0 -14
- data/lib/mediawiktory/generated/purge.rb +0 -15
- data/lib/mediawiktory/generated/query.rb +0 -20
- data/lib/mediawiktory/generated/querypage.rb +0 -9
- data/lib/mediawiktory/generated/random.rb +0 -11
- data/lib/mediawiktory/generated/recentchanges.rb +0 -21
- data/lib/mediawiktory/generated/redirects.rb +0 -11
- data/lib/mediawiktory/generated/references.rb +0 -7
- data/lib/mediawiktory/generated/refresheducation.rb +0 -9
- data/lib/mediawiktory/generated/removeauthenticationdata.rb +0 -8
- data/lib/mediawiktory/generated/resetpassword.rb +0 -9
- data/lib/mediawiktory/generated/review.rb +0 -10
- data/lib/mediawiktory/generated/reviewactivity.rb +0 -10
- data/lib/mediawiktory/generated/revisiondelete.rb +0 -15
- data/lib/mediawiktory/generated/revisions.rb +0 -26
- data/lib/mediawiktory/generated/rollback.rb +0 -14
- data/lib/mediawiktory/generated/rsd.rb +0 -5
- data/lib/mediawiktory/generated/sanitize-mapdata.rb +0 -8
- data/lib/mediawiktory/generated/scribunto-console.rb +0 -10
- data/lib/mediawiktory/generated/search.rb +0 -16
- data/lib/mediawiktory/generated/setglobalaccountstatus.rb +0 -12
- data/lib/mediawiktory/generated/setnotificationtimestamp.rb +0 -18
- data/lib/mediawiktory/generated/setpagelanguage.rb +0 -12
- data/lib/mediawiktory/generated/shortenurl.rb +0 -7
- data/lib/mediawiktory/generated/siteinfo.rb +0 -11
- data/lib/mediawiktory/generated/sitematrix.rb +0 -12
- data/lib/mediawiktory/generated/siteviews.rb +0 -8
- data/lib/mediawiktory/generated/spamblacklist.rb +0 -6
- data/lib/mediawiktory/generated/stabilize.rb +0 -12
- data/lib/mediawiktory/generated/stashedit.rb +0 -16
- data/lib/mediawiktory/generated/stashimageinfo.rb +0 -12
- data/lib/mediawiktory/generated/strikevote.rb +0 -10
- data/lib/mediawiktory/generated/tag.rb +0 -14
- data/lib/mediawiktory/generated/tags.rb +0 -9
- data/lib/mediawiktory/generated/templatedata.rb +0 -12
- data/lib/mediawiktory/generated/templates.rb +0 -11
- data/lib/mediawiktory/generated/thank.rb +0 -9
- data/lib/mediawiktory/generated/titleblacklist.rb +0 -9
- data/lib/mediawiktory/generated/tokens.rb +0 -6
- data/lib/mediawiktory/generated/transcludedin.rb +0 -11
- data/lib/mediawiktory/generated/transcodereset.rb +0 -9
- data/lib/mediawiktory/generated/transcodestatus.rb +0 -5
- data/lib/mediawiktory/generated/ulslocalization.rb +0 -6
- data/lib/mediawiktory/generated/unblock.rb +0 -12
- data/lib/mediawiktory/generated/undelete.rb +0 -13
- data/lib/mediawiktory/generated/unlinkaccount.rb +0 -8
- data/lib/mediawiktory/generated/unreadnotificationpages.rb +0 -9
- data/lib/mediawiktory/generated/upload.rb +0 -24
- data/lib/mediawiktory/generated/usercontribs.rb +0 -19
- data/lib/mediawiktory/generated/userinfo.rb +0 -8
- data/lib/mediawiktory/generated/userrights.rb +0 -13
- data/lib/mediawiktory/generated/users.rb +0 -11
- data/lib/mediawiktory/generated/validatepassword.rb +0 -10
- data/lib/mediawiktory/generated/videoinfo.rb +0 -20
- data/lib/mediawiktory/generated/visualeditor.rb +0 -13
- data/lib/mediawiktory/generated/visualeditoredit.rb +0 -23
- data/lib/mediawiktory/generated/watch.rb +0 -16
- data/lib/mediawiktory/generated/watchlist.rb +0 -20
- data/lib/mediawiktory/generated/watchlistraw.rb +0 -16
- data/lib/mediawiktory/generated/wbentityusage.rb +0 -11
- data/lib/mediawiktory/generated/wblistentityusage.rb +0 -11
- data/lib/mediawiktory/generated/webapp-manifest.rb +0 -5
- data/lib/mediawiktory/generated/wikibase.rb +0 -7
- data/lib/mediawiktory/generated/wikilove.rb +0 -13
- data/lib/mediawiktory/generated/wikisets.rb +0 -10
- data/lib/mediawiktory/generated/zeroconfig.rb +0 -7
- data/lib/mediawiktory/mw_module.rb +0 -324
- data/lib/mediawiktory/page.rb +0 -50
- data/lib/mediawiktory/query.rb +0 -58
- data/script/data/api.yaml +0 -40414
- data/script/lib/api.rb +0 -14
- data/script/lib/module.rb +0 -132
- data/script/lib/parameter.rb +0 -133
- data/script/parse_api.rb +0 -21
- data/test/cache.rb +0 -15
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MediaWiktory::Wikipedia
|
4
|
+
module Actions
|
5
|
+
#
|
6
|
+
#
|
7
|
+
# Usage:
|
8
|
+
#
|
9
|
+
# ```ruby
|
10
|
+
# api.parsoid-batch.batch(value).perform # returns string with raw output
|
11
|
+
# # or
|
12
|
+
# api.parsoid-batch.batch(value).response # returns output parsed and wrapped into Response object
|
13
|
+
# ```
|
14
|
+
#
|
15
|
+
# See {Base} for generic explanation of working with MediaWiki actions and
|
16
|
+
# {MediaWiktory::Wikipedia::Response} for working with action responses.
|
17
|
+
#
|
18
|
+
# All action's parameters are documented as its public methods, see below.
|
19
|
+
#
|
20
|
+
class ParsoidBatch < MediaWiktory::Wikipedia::Actions::Get
|
21
|
+
|
22
|
+
#
|
23
|
+
#
|
24
|
+
# @param value [String]
|
25
|
+
# @return [self]
|
26
|
+
def batch(value)
|
27
|
+
merge(batch: value.to_s)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MediaWiktory::Wikipedia
|
4
|
+
module Actions
|
5
|
+
# Patrol a page or revision.
|
6
|
+
#
|
7
|
+
# Usage:
|
8
|
+
#
|
9
|
+
# ```ruby
|
10
|
+
# api.patrol.rcid(value).perform # returns string with raw output
|
11
|
+
# # or
|
12
|
+
# api.patrol.rcid(value).response # returns output parsed and wrapped into Response object
|
13
|
+
# ```
|
14
|
+
#
|
15
|
+
# See {Base} for generic explanation of working with MediaWiki actions and
|
16
|
+
# {MediaWiktory::Wikipedia::Response} for working with action responses.
|
17
|
+
#
|
18
|
+
# All action's parameters are documented as its public methods, see below.
|
19
|
+
#
|
20
|
+
class Patrol < MediaWiktory::Wikipedia::Actions::Post
|
21
|
+
|
22
|
+
# Recentchanges ID to patrol.
|
23
|
+
#
|
24
|
+
# @param value [Integer]
|
25
|
+
# @return [self]
|
26
|
+
def rcid(value)
|
27
|
+
merge(rcid: value.to_s)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Revision ID to patrol.
|
31
|
+
#
|
32
|
+
# @param value [Integer]
|
33
|
+
# @return [self]
|
34
|
+
def revid(value)
|
35
|
+
merge(revid: value.to_s)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Change tags to apply to the entry in the patrol log.
|
39
|
+
#
|
40
|
+
# @param values [Array<String>] Allowed values: "ProveIt edit", "WPCleaner", "huggle", "large plot addition".
|
41
|
+
# @return [self]
|
42
|
+
def tags(*values)
|
43
|
+
values.inject(self) { |res, val| res._tags(val) or fail ArgumentError, "Unknown value for tags: #{val}" }
|
44
|
+
end
|
45
|
+
|
46
|
+
# @private
|
47
|
+
def _tags(value)
|
48
|
+
defined?(super) && super || ["ProveIt edit", "WPCleaner", "huggle", "large plot addition"].include?(value.to_s) && merge(tags: value.to_s, replace: false)
|
49
|
+
end
|
50
|
+
|
51
|
+
# A "patrol" token retrieved from action=query&meta=tokens
|
52
|
+
#
|
53
|
+
# @param value [String]
|
54
|
+
# @return [self]
|
55
|
+
def token(value)
|
56
|
+
merge(token: value.to_s)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,121 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MediaWiktory::Wikipedia
|
4
|
+
module Actions
|
5
|
+
# Change the protection level of a page.
|
6
|
+
#
|
7
|
+
# Usage:
|
8
|
+
#
|
9
|
+
# ```ruby
|
10
|
+
# api.protect.title(value).perform # returns string with raw output
|
11
|
+
# # or
|
12
|
+
# api.protect.title(value).response # returns output parsed and wrapped into Response object
|
13
|
+
# ```
|
14
|
+
#
|
15
|
+
# See {Base} for generic explanation of working with MediaWiki actions and
|
16
|
+
# {MediaWiktory::Wikipedia::Response} for working with action responses.
|
17
|
+
#
|
18
|
+
# All action's parameters are documented as its public methods, see below.
|
19
|
+
#
|
20
|
+
class Protect < MediaWiktory::Wikipedia::Actions::Post
|
21
|
+
|
22
|
+
# Title of the page to (un)protect. Cannot be used together with pageid.
|
23
|
+
#
|
24
|
+
# @param value [String]
|
25
|
+
# @return [self]
|
26
|
+
def title(value)
|
27
|
+
merge(title: value.to_s)
|
28
|
+
end
|
29
|
+
|
30
|
+
# ID of the page to (un)protect. Cannot be used together with title.
|
31
|
+
#
|
32
|
+
# @param value [Integer]
|
33
|
+
# @return [self]
|
34
|
+
def pageid(value)
|
35
|
+
merge(pageid: value.to_s)
|
36
|
+
end
|
37
|
+
|
38
|
+
# List of protection levels, formatted action=level (e.g. edit=sysop). A level of all means everyone is allowed to take the action, i.e. no restriction.
|
39
|
+
#
|
40
|
+
# @param values [Array<String>]
|
41
|
+
# @return [self]
|
42
|
+
def protections(*values)
|
43
|
+
values.inject(self) { |res, val| res._protections(val) }
|
44
|
+
end
|
45
|
+
|
46
|
+
# @private
|
47
|
+
def _protections(value)
|
48
|
+
merge(protections: value.to_s, replace: false)
|
49
|
+
end
|
50
|
+
|
51
|
+
# Expiry timestamps. If only one timestamp is set, it'll be used for all protections. Use infinite, indefinite, infinity, or never, for a never-expiring protection.
|
52
|
+
#
|
53
|
+
# @param values [Array<String>]
|
54
|
+
# @return [self]
|
55
|
+
def expiry(*values)
|
56
|
+
values.inject(self) { |res, val| res._expiry(val) }
|
57
|
+
end
|
58
|
+
|
59
|
+
# @private
|
60
|
+
def _expiry(value)
|
61
|
+
merge(expiry: value.to_s, replace: false)
|
62
|
+
end
|
63
|
+
|
64
|
+
# Reason for (un)protecting.
|
65
|
+
#
|
66
|
+
# @param value [String]
|
67
|
+
# @return [self]
|
68
|
+
def reason(value)
|
69
|
+
merge(reason: value.to_s)
|
70
|
+
end
|
71
|
+
|
72
|
+
# Change tags to apply to the entry in the protection log.
|
73
|
+
#
|
74
|
+
# @param values [Array<String>] Allowed values: "ProveIt edit", "WPCleaner", "huggle", "large plot addition".
|
75
|
+
# @return [self]
|
76
|
+
def tags(*values)
|
77
|
+
values.inject(self) { |res, val| res._tags(val) or fail ArgumentError, "Unknown value for tags: #{val}" }
|
78
|
+
end
|
79
|
+
|
80
|
+
# @private
|
81
|
+
def _tags(value)
|
82
|
+
defined?(super) && super || ["ProveIt edit", "WPCleaner", "huggle", "large plot addition"].include?(value.to_s) && merge(tags: value.to_s, replace: false)
|
83
|
+
end
|
84
|
+
|
85
|
+
# Enable cascading protection (i.e. protect transcluded templates and images used in this page). Ignored if none of the given protection levels support cascading.
|
86
|
+
#
|
87
|
+
# @return [self]
|
88
|
+
def cascade()
|
89
|
+
merge(cascade: 'true')
|
90
|
+
end
|
91
|
+
|
92
|
+
# If set, add the page being (un)protected to the current user's watchlist.
|
93
|
+
#
|
94
|
+
# @return [self]
|
95
|
+
def watch()
|
96
|
+
merge(watch: 'true')
|
97
|
+
end
|
98
|
+
|
99
|
+
# Unconditionally add or remove the page from the current user's watchlist, use preferences or do not change watch.
|
100
|
+
#
|
101
|
+
# @param value [String] One of "watch", "unwatch", "preferences", "nochange".
|
102
|
+
# @return [self]
|
103
|
+
def watchlist(value)
|
104
|
+
_watchlist(value) or fail ArgumentError, "Unknown value for watchlist: #{value}"
|
105
|
+
end
|
106
|
+
|
107
|
+
# @private
|
108
|
+
def _watchlist(value)
|
109
|
+
defined?(super) && super || ["watch", "unwatch", "preferences", "nochange"].include?(value.to_s) && merge(watchlist: value.to_s)
|
110
|
+
end
|
111
|
+
|
112
|
+
# A "csrf" token retrieved from action=query&meta=tokens
|
113
|
+
#
|
114
|
+
# @param value [String]
|
115
|
+
# @return [self]
|
116
|
+
def token(value)
|
117
|
+
merge(token: value.to_s)
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
@@ -0,0 +1,155 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MediaWiktory::Wikipedia
|
4
|
+
module Actions
|
5
|
+
# Purge the cache for the given titles.
|
6
|
+
#
|
7
|
+
# Usage:
|
8
|
+
#
|
9
|
+
# ```ruby
|
10
|
+
# api.purge.forcelinkupdate(value).perform # returns string with raw output
|
11
|
+
# # or
|
12
|
+
# api.purge.forcelinkupdate(value).response # returns output parsed and wrapped into Response object
|
13
|
+
# ```
|
14
|
+
#
|
15
|
+
# See {Base} for generic explanation of working with MediaWiki actions and
|
16
|
+
# {MediaWiktory::Wikipedia::Response} for working with action responses.
|
17
|
+
#
|
18
|
+
# All action's parameters are documented as its public methods, see below.
|
19
|
+
#
|
20
|
+
class Purge < MediaWiktory::Wikipedia::Actions::Post
|
21
|
+
|
22
|
+
# Update the links tables.
|
23
|
+
#
|
24
|
+
# @return [self]
|
25
|
+
def forcelinkupdate()
|
26
|
+
merge(forcelinkupdate: 'true')
|
27
|
+
end
|
28
|
+
|
29
|
+
# Update the links table, and update the links tables for any page that uses this page as a template.
|
30
|
+
#
|
31
|
+
# @return [self]
|
32
|
+
def forcerecursivelinkupdate()
|
33
|
+
merge(forcerecursivelinkupdate: 'true')
|
34
|
+
end
|
35
|
+
|
36
|
+
# When more results are available, use this to continue.
|
37
|
+
#
|
38
|
+
# @param value [String]
|
39
|
+
# @return [self]
|
40
|
+
def continue(value)
|
41
|
+
merge(continue: value.to_s)
|
42
|
+
end
|
43
|
+
|
44
|
+
# A list of titles to work on.
|
45
|
+
#
|
46
|
+
# @param values [Array<String>]
|
47
|
+
# @return [self]
|
48
|
+
def titles(*values)
|
49
|
+
values.inject(self) { |res, val| res._titles(val) }
|
50
|
+
end
|
51
|
+
|
52
|
+
# @private
|
53
|
+
def _titles(value)
|
54
|
+
merge(titles: value.to_s, replace: false)
|
55
|
+
end
|
56
|
+
|
57
|
+
# A list of page IDs to work on.
|
58
|
+
#
|
59
|
+
# @param values [Array<Integer>]
|
60
|
+
# @return [self]
|
61
|
+
def pageids(*values)
|
62
|
+
values.inject(self) { |res, val| res._pageids(val) }
|
63
|
+
end
|
64
|
+
|
65
|
+
# @private
|
66
|
+
def _pageids(value)
|
67
|
+
merge(pageids: value.to_s, replace: false)
|
68
|
+
end
|
69
|
+
|
70
|
+
# A list of revision IDs to work on.
|
71
|
+
#
|
72
|
+
# @param values [Array<Integer>]
|
73
|
+
# @return [self]
|
74
|
+
def revids(*values)
|
75
|
+
values.inject(self) { |res, val| res._revids(val) }
|
76
|
+
end
|
77
|
+
|
78
|
+
# @private
|
79
|
+
def _revids(value)
|
80
|
+
merge(revids: value.to_s, replace: false)
|
81
|
+
end
|
82
|
+
|
83
|
+
# Get the list of pages to work on by executing the specified query module.
|
84
|
+
#
|
85
|
+
# @param value [Symbol] Selecting an option includes tweaking methods from corresponding module:
|
86
|
+
# * `:allcategories` - {MediaWiktory::Wikipedia::Modules::Allcategories} Enumerate all categories.
|
87
|
+
# * `:alldeletedrevisions` - {MediaWiktory::Wikipedia::Modules::Alldeletedrevisions} List all deleted revisions by a user or in a namespace.
|
88
|
+
# * `:allfileusages` - {MediaWiktory::Wikipedia::Modules::Allfileusages} List all file usages, including non-existing.
|
89
|
+
# * `:allimages` - {MediaWiktory::Wikipedia::Modules::Allimages} Enumerate all images sequentially.
|
90
|
+
# * `:alllinks` - {MediaWiktory::Wikipedia::Modules::Alllinks} Enumerate all links that point to a given namespace.
|
91
|
+
# * `:allpages` - {MediaWiktory::Wikipedia::Modules::Allpages} Enumerate all pages sequentially in a given namespace.
|
92
|
+
# * `:allredirects` - {MediaWiktory::Wikipedia::Modules::Allredirects} List all redirects to a namespace.
|
93
|
+
# * `:allrevisions` - {MediaWiktory::Wikipedia::Modules::Allrevisions} List all revisions.
|
94
|
+
# * `:alltransclusions` - {MediaWiktory::Wikipedia::Modules::Alltransclusions} List all transclusions (pages embedded using {{x}}), including non-existing.
|
95
|
+
# * `:backlinks` - {MediaWiktory::Wikipedia::Modules::Backlinks} Find all pages that link to the given page.
|
96
|
+
# * `:categories` - {MediaWiktory::Wikipedia::Modules::Categories} List all categories the pages belong to.
|
97
|
+
# * `:categorymembers` - {MediaWiktory::Wikipedia::Modules::Categorymembers} List all pages in a given category.
|
98
|
+
# * `:contenttranslation` - {MediaWiktory::Wikipedia::Modules::Contenttranslation} Query Content Translation database for translations.
|
99
|
+
# * `:contenttranslationsuggestions` - {MediaWiktory::Wikipedia::Modules::Contenttranslationsuggestions} Get suggestion lists for Content Translation.
|
100
|
+
# * `:deletedrevisions` - {MediaWiktory::Wikipedia::Modules::Deletedrevisions} Get deleted revision information.
|
101
|
+
# * `:duplicatefiles` - {MediaWiktory::Wikipedia::Modules::Duplicatefiles} List all files that are duplicates of the given files based on hash values.
|
102
|
+
# * `:embeddedin` - {MediaWiktory::Wikipedia::Modules::Embeddedin} Find all pages that embed (transclude) the given title.
|
103
|
+
# * `:exturlusage` - {MediaWiktory::Wikipedia::Modules::Exturlusage} Enumerate pages that contain a given URL.
|
104
|
+
# * `:fileusage` - {MediaWiktory::Wikipedia::Modules::Fileusage} Find all pages that use the given files.
|
105
|
+
# * `:geosearch` - {MediaWiktory::Wikipedia::Modules::Geosearch} Returns pages having coordinates that are located in a certain area.
|
106
|
+
# * `:gettingstartedgetpages` - {MediaWiktory::Wikipedia::Modules::Gettingstartedgetpages} This API is for getting a list of one or more pages related to a particular GettingStarted task.
|
107
|
+
# * `:images` - {MediaWiktory::Wikipedia::Modules::Images} Returns all files contained on the given pages.
|
108
|
+
# * `:imageusage` - {MediaWiktory::Wikipedia::Modules::Imageusage} Find all pages that use the given image title.
|
109
|
+
# * `:iwbacklinks` - {MediaWiktory::Wikipedia::Modules::Iwbacklinks} Find all pages that link to the given interwiki link.
|
110
|
+
# * `:langbacklinks` - {MediaWiktory::Wikipedia::Modules::Langbacklinks} Find all pages that link to the given language link.
|
111
|
+
# * `:links` - {MediaWiktory::Wikipedia::Modules::Links} Returns all links from the given pages.
|
112
|
+
# * `:linkshere` - {MediaWiktory::Wikipedia::Modules::Linkshere} Find all pages that link to the given pages.
|
113
|
+
# * `:mostviewed` - {MediaWiktory::Wikipedia::Modules::Mostviewed} Lists the most viewed pages (based on last day's pageview count).
|
114
|
+
# * `:oldreviewedpages` - {MediaWiktory::Wikipedia::Modules::Oldreviewedpages} Enumerates pages that have changes pending review.
|
115
|
+
# * `:pageswithprop` - {MediaWiktory::Wikipedia::Modules::Pageswithprop} List all pages using a given page property.
|
116
|
+
# * `:prefixsearch` - {MediaWiktory::Wikipedia::Modules::Prefixsearch} Perform a prefix search for page titles.
|
117
|
+
# * `:projectpages` - {MediaWiktory::Wikipedia::Modules::Projectpages} List all pages associated with one or more projects.
|
118
|
+
# * `:protectedtitles` - {MediaWiktory::Wikipedia::Modules::Protectedtitles} List all titles protected from creation.
|
119
|
+
# * `:querypage` - {MediaWiktory::Wikipedia::Modules::Querypage} Get a list provided by a QueryPage-based special page.
|
120
|
+
# * `:random` - {MediaWiktory::Wikipedia::Modules::Random} Get a set of random pages.
|
121
|
+
# * `:recentchanges` - {MediaWiktory::Wikipedia::Modules::Recentchanges} Enumerate recent changes.
|
122
|
+
# * `:redirects` - {MediaWiktory::Wikipedia::Modules::Redirects} Returns all redirects to the given pages.
|
123
|
+
# * `:revisions` - {MediaWiktory::Wikipedia::Modules::Revisions} Get revision information.
|
124
|
+
# * `:search` - {MediaWiktory::Wikipedia::Modules::Search} Perform a full text search.
|
125
|
+
# * `:templates` - {MediaWiktory::Wikipedia::Modules::Templates} Returns all pages transcluded on the given pages.
|
126
|
+
# * `:transcludedin` - {MediaWiktory::Wikipedia::Modules::Transcludedin} Find all pages that transclude the given pages.
|
127
|
+
# * `:watchlist` - {MediaWiktory::Wikipedia::Modules::Watchlist} Get recent changes to pages in the current user's watchlist.
|
128
|
+
# * `:watchlistraw` - {MediaWiktory::Wikipedia::Modules::Watchlistraw} Get all pages on the current user's watchlist.
|
129
|
+
# * `:wblistentityusage` - {MediaWiktory::Wikipedia::Modules::Wblistentityusage} Returns all pages that use the given entity IDs.
|
130
|
+
# @return [self]
|
131
|
+
def generator(value)
|
132
|
+
_generator(value) or fail ArgumentError, "Unknown value for generator: #{value}"
|
133
|
+
end
|
134
|
+
|
135
|
+
# @private
|
136
|
+
def _generator(value)
|
137
|
+
defined?(super) && super || [:allcategories, :alldeletedrevisions, :allfileusages, :allimages, :alllinks, :allpages, :allredirects, :allrevisions, :alltransclusions, :backlinks, :categories, :categorymembers, :contenttranslation, :contenttranslationsuggestions, :deletedrevisions, :duplicatefiles, :embeddedin, :exturlusage, :fileusage, :geosearch, :gettingstartedgetpages, :images, :imageusage, :iwbacklinks, :langbacklinks, :links, :linkshere, :mostviewed, :oldreviewedpages, :pageswithprop, :prefixsearch, :projectpages, :protectedtitles, :querypage, :random, :recentchanges, :redirects, :revisions, :search, :templates, :transcludedin, :watchlist, :watchlistraw, :wblistentityusage].include?(value.to_sym) && merge(generator: value.to_s).submodule({allcategories: Modules::Allcategories, alldeletedrevisions: Modules::Alldeletedrevisions, allfileusages: Modules::Allfileusages, allimages: Modules::Allimages, alllinks: Modules::Alllinks, allpages: Modules::Allpages, allredirects: Modules::Allredirects, allrevisions: Modules::Allrevisions, alltransclusions: Modules::Alltransclusions, backlinks: Modules::Backlinks, categories: Modules::Categories, categorymembers: Modules::Categorymembers, contenttranslation: Modules::Contenttranslation, contenttranslationsuggestions: Modules::Contenttranslationsuggestions, deletedrevisions: Modules::Deletedrevisions, duplicatefiles: Modules::Duplicatefiles, embeddedin: Modules::Embeddedin, exturlusage: Modules::Exturlusage, fileusage: Modules::Fileusage, geosearch: Modules::Geosearch, gettingstartedgetpages: Modules::Gettingstartedgetpages, images: Modules::Images, imageusage: Modules::Imageusage, iwbacklinks: Modules::Iwbacklinks, langbacklinks: Modules::Langbacklinks, links: Modules::Links, linkshere: Modules::Linkshere, mostviewed: Modules::Mostviewed, oldreviewedpages: Modules::Oldreviewedpages, pageswithprop: Modules::Pageswithprop, prefixsearch: Modules::Prefixsearch, projectpages: Modules::Projectpages, protectedtitles: Modules::Protectedtitles, querypage: Modules::Querypage, random: Modules::Random, recentchanges: Modules::Recentchanges, redirects: Modules::Redirects, revisions: Modules::Revisions, search: Modules::Search, templates: Modules::Templates, transcludedin: Modules::Transcludedin, watchlist: Modules::Watchlist, watchlistraw: Modules::Watchlistraw, wblistentityusage: Modules::Wblistentityusage}[value.to_sym])
|
138
|
+
end
|
139
|
+
|
140
|
+
# Automatically resolve redirects in titles, pageids, and revids, and in pages returned by generator.
|
141
|
+
#
|
142
|
+
# @return [self]
|
143
|
+
def redirects()
|
144
|
+
merge(redirects: 'true')
|
145
|
+
end
|
146
|
+
|
147
|
+
# Convert titles to other variants if necessary. Only works if the wiki's content language supports variant conversion. Languages that support variant conversion include gan, iu, kk, ku, shi, sr, tg, uz and zh.
|
148
|
+
#
|
149
|
+
# @return [self]
|
150
|
+
def converttitles()
|
151
|
+
merge(converttitles: 'true')
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
@@ -0,0 +1,325 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module MediaWiktory::Wikipedia
|
4
|
+
module Actions
|
5
|
+
# Fetch data from and about MediaWiki.
|
6
|
+
#
|
7
|
+
# Usage:
|
8
|
+
#
|
9
|
+
# ```ruby
|
10
|
+
# api.query.prop(value).perform # returns string with raw output
|
11
|
+
# # or
|
12
|
+
# api.query.prop(value).response # returns output parsed and wrapped into Response object
|
13
|
+
# ```
|
14
|
+
#
|
15
|
+
# See {Base} for generic explanation of working with MediaWiki actions and
|
16
|
+
# {MediaWiktory::Wikipedia::Response} for working with action responses.
|
17
|
+
#
|
18
|
+
# All action's parameters are documented as its public methods, see below.
|
19
|
+
#
|
20
|
+
class Query < MediaWiktory::Wikipedia::Actions::Get
|
21
|
+
|
22
|
+
# Which properties to get for the queried pages.
|
23
|
+
#
|
24
|
+
# @param values [Array<Symbol>] All selected options include tweaking methods from corresponding modules:
|
25
|
+
# * `:categories` - {MediaWiktory::Wikipedia::Modules::Categories} List all categories the pages belong to.
|
26
|
+
# * `:categoryinfo` - {MediaWiktory::Wikipedia::Modules::Categoryinfo} Returns information about the given categories.
|
27
|
+
# * `:contributors` - {MediaWiktory::Wikipedia::Modules::Contributors} Get the list of logged-in contributors and the count of anonymous contributors to a page.
|
28
|
+
# * `:coordinates` - {MediaWiktory::Wikipedia::Modules::Coordinates} Returns coordinates of the given pages.
|
29
|
+
# * `:deletedrevisions` - {MediaWiktory::Wikipedia::Modules::Deletedrevisions} Get deleted revision information.
|
30
|
+
# * `:duplicatefiles` - {MediaWiktory::Wikipedia::Modules::Duplicatefiles} List all files that are duplicates of the given files based on hash values.
|
31
|
+
# * `:extlinks` - {MediaWiktory::Wikipedia::Modules::Extlinks} Returns all external URLs (not interwikis) from the given pages.
|
32
|
+
# * `:extracts` - {MediaWiktory::Wikipedia::Modules::Extracts} Returns plain-text or limited HTML extracts of the given pages.
|
33
|
+
# * `:fileusage` - {MediaWiktory::Wikipedia::Modules::Fileusage} Find all pages that use the given files.
|
34
|
+
# * `:flagged` - {MediaWiktory::Wikipedia::Modules::Flagged} Get information about the flagging status of the given pages.
|
35
|
+
# * `:globalusage` - {MediaWiktory::Wikipedia::Modules::Globalusage} Returns global image usage for a certain image.
|
36
|
+
# * `:imageinfo` - {MediaWiktory::Wikipedia::Modules::Imageinfo} Returns file information and upload history.
|
37
|
+
# * `:images` - {MediaWiktory::Wikipedia::Modules::Images} Returns all files contained on the given pages.
|
38
|
+
# * `:info` - {MediaWiktory::Wikipedia::Modules::Info} Get basic page information.
|
39
|
+
# * `:iwlinks` - {MediaWiktory::Wikipedia::Modules::Iwlinks} Returns all interwiki links from the given pages.
|
40
|
+
# * `:langlinks` - {MediaWiktory::Wikipedia::Modules::Langlinks} Returns all interlanguage links from the given pages.
|
41
|
+
# * `:links` - {MediaWiktory::Wikipedia::Modules::Links} Returns all links from the given pages.
|
42
|
+
# * `:linkshere` - {MediaWiktory::Wikipedia::Modules::Linkshere} Find all pages that link to the given pages.
|
43
|
+
# * `:mapdata` - {MediaWiktory::Wikipedia::Modules::Mapdata} Request all map data from the page Metallica
|
44
|
+
# * `:pageassessments` - {MediaWiktory::Wikipedia::Modules::Pageassessments} Return associated projects and assessments for the given pages.
|
45
|
+
# * `:pageimages` - {MediaWiktory::Wikipedia::Modules::Pageimages} Returns information about images on the page, such as thumbnail and presence of photos.
|
46
|
+
# * `:pageprops` - {MediaWiktory::Wikipedia::Modules::Pageprops} Get various page properties defined in the page content.
|
47
|
+
# * `:pageterms` - {MediaWiktory::Wikipedia::Modules::Pageterms} Get terms associated with a page via an associated data item. On a wikibase entity page, the entity terms are used directly. Caveat: On a repo wiki, pageterms only works directly on entity pages, not on pages connected to an item. This may change in the future.
|
48
|
+
# * `:pageviews` - {MediaWiktory::Wikipedia::Modules::Pageviews} Shows per-page pageview data (the number of daily pageviews for each of the last pvipdays days). The result format is page title (with underscores) => date (Ymd) => count.
|
49
|
+
# * `:redirects` - {MediaWiktory::Wikipedia::Modules::Redirects} Returns all redirects to the given pages.
|
50
|
+
# * `:references` - {MediaWiktory::Wikipedia::Modules::References} Return a data representation of references associated with the given pages.
|
51
|
+
# * `:revisions` - {MediaWiktory::Wikipedia::Modules::Revisions} Get revision information.
|
52
|
+
# * `:stashimageinfo` - {MediaWiktory::Wikipedia::Modules::Stashimageinfo} Returns file information for stashed files.
|
53
|
+
# * `:templates` - {MediaWiktory::Wikipedia::Modules::Templates} Returns all pages transcluded on the given pages.
|
54
|
+
# * `:transcludedin` - {MediaWiktory::Wikipedia::Modules::Transcludedin} Find all pages that transclude the given pages.
|
55
|
+
# * `:transcodestatus` - {MediaWiktory::Wikipedia::Modules::Transcodestatus} Get transcode status for a given file page.
|
56
|
+
# * `:videoinfo` - {MediaWiktory::Wikipedia::Modules::Videoinfo} Extends imageinfo to include video source (derivatives) information
|
57
|
+
# * `:wbentityusage` - {MediaWiktory::Wikipedia::Modules::Wbentityusage} Returns all entity IDs used in the given pages.
|
58
|
+
# @return [self]
|
59
|
+
def prop(*values)
|
60
|
+
values.inject(self) { |res, val| res._prop(val) or fail ArgumentError, "Unknown value for prop: #{val}" }
|
61
|
+
end
|
62
|
+
|
63
|
+
# @private
|
64
|
+
def _prop(value)
|
65
|
+
defined?(super) && super || [:categories, :categoryinfo, :contributors, :coordinates, :deletedrevisions, :duplicatefiles, :extlinks, :extracts, :fileusage, :flagged, :globalusage, :imageinfo, :images, :info, :iwlinks, :langlinks, :links, :linkshere, :mapdata, :pageassessments, :pageimages, :pageprops, :pageterms, :pageviews, :redirects, :references, :revisions, :stashimageinfo, :templates, :transcludedin, :transcodestatus, :videoinfo, :wbentityusage].include?(value.to_sym) && merge(prop: value.to_s, replace: false).submodule({categories: Modules::Categories, categoryinfo: Modules::Categoryinfo, contributors: Modules::Contributors, coordinates: Modules::Coordinates, deletedrevisions: Modules::Deletedrevisions, duplicatefiles: Modules::Duplicatefiles, extlinks: Modules::Extlinks, extracts: Modules::Extracts, fileusage: Modules::Fileusage, flagged: Modules::Flagged, globalusage: Modules::Globalusage, imageinfo: Modules::Imageinfo, images: Modules::Images, info: Modules::Info, iwlinks: Modules::Iwlinks, langlinks: Modules::Langlinks, links: Modules::Links, linkshere: Modules::Linkshere, mapdata: Modules::Mapdata, pageassessments: Modules::Pageassessments, pageimages: Modules::Pageimages, pageprops: Modules::Pageprops, pageterms: Modules::Pageterms, pageviews: Modules::Pageviews, redirects: Modules::Redirects, references: Modules::References, revisions: Modules::Revisions, stashimageinfo: Modules::Stashimageinfo, templates: Modules::Templates, transcludedin: Modules::Transcludedin, transcodestatus: Modules::Transcodestatus, videoinfo: Modules::Videoinfo, wbentityusage: Modules::Wbentityusage}[value.to_sym])
|
66
|
+
end
|
67
|
+
|
68
|
+
# Which lists to get.
|
69
|
+
#
|
70
|
+
# @param values [Array<Symbol>] All selected options include tweaking methods from corresponding modules:
|
71
|
+
# * `:abusefilters` - {MediaWiktory::Wikipedia::Modules::Abusefilters} Show details of the abuse filters.
|
72
|
+
# * `:abuselog` - {MediaWiktory::Wikipedia::Modules::Abuselog} Show events that were caught by one of the abuse filters.
|
73
|
+
# * `:allcategories` - {MediaWiktory::Wikipedia::Modules::Allcategories} Enumerate all categories.
|
74
|
+
# * `:alldeletedrevisions` - {MediaWiktory::Wikipedia::Modules::Alldeletedrevisions} List all deleted revisions by a user or in a namespace.
|
75
|
+
# * `:allfileusages` - {MediaWiktory::Wikipedia::Modules::Allfileusages} List all file usages, including non-existing.
|
76
|
+
# * `:allimages` - {MediaWiktory::Wikipedia::Modules::Allimages} Enumerate all images sequentially.
|
77
|
+
# * `:alllinks` - {MediaWiktory::Wikipedia::Modules::Alllinks} Enumerate all links that point to a given namespace.
|
78
|
+
# * `:allpages` - {MediaWiktory::Wikipedia::Modules::Allpages} Enumerate all pages sequentially in a given namespace.
|
79
|
+
# * `:allredirects` - {MediaWiktory::Wikipedia::Modules::Allredirects} List all redirects to a namespace.
|
80
|
+
# * `:allrevisions` - {MediaWiktory::Wikipedia::Modules::Allrevisions} List all revisions.
|
81
|
+
# * `:alltransclusions` - {MediaWiktory::Wikipedia::Modules::Alltransclusions} List all transclusions (pages embedded using {{x}}), including non-existing.
|
82
|
+
# * `:allusers` - {MediaWiktory::Wikipedia::Modules::Allusers} Enumerate all registered users.
|
83
|
+
# * `:backlinks` - {MediaWiktory::Wikipedia::Modules::Backlinks} Find all pages that link to the given page.
|
84
|
+
# * `:betafeatures` - {MediaWiktory::Wikipedia::Modules::Betafeatures} List all BetaFeatures
|
85
|
+
# * `:blocks` - {MediaWiktory::Wikipedia::Modules::Blocks} List all blocked users and IP addresses.
|
86
|
+
# * `:categorymembers` - {MediaWiktory::Wikipedia::Modules::Categorymembers} List all pages in a given category.
|
87
|
+
# * `:centralnoticelogs` - {MediaWiktory::Wikipedia::Modules::Centralnoticelogs} Get a log of campaign configuration changes.
|
88
|
+
# * `:checkuser` - {MediaWiktory::Wikipedia::Modules::Checkuser} Check which IP addresses are used by a given username or which usernames are used by a given IP address.
|
89
|
+
# * `:checkuserlog` - {MediaWiktory::Wikipedia::Modules::Checkuserlog} Get entries from the CheckUser log.
|
90
|
+
# * `:contenttranslation` - {MediaWiktory::Wikipedia::Modules::Contenttranslation} Query Content Translation database for translations.
|
91
|
+
# * `:contenttranslationcorpora` - {MediaWiktory::Wikipedia::Modules::Contenttranslationcorpora} Get the section-aligned parallel text for a given translation. See also list=cxpublishedtranslations. Dumps are provided in different formats for high volume access.
|
92
|
+
# * `:contenttranslationlangtrend` - {MediaWiktory::Wikipedia::Modules::Contenttranslationlangtrend} Query Content Translation database for numbers of translations by period of time.
|
93
|
+
# * `:contenttranslationstats` - {MediaWiktory::Wikipedia::Modules::Contenttranslationstats} Get Content Translation statistics.
|
94
|
+
# * `:contenttranslationsuggestions` - {MediaWiktory::Wikipedia::Modules::Contenttranslationsuggestions} Get suggestion lists for Content Translation.
|
95
|
+
# * `:cxpublishedtranslations` - {MediaWiktory::Wikipedia::Modules::Cxpublishedtranslations} Fetch all published translations information.
|
96
|
+
# * `:cxtranslatorstats` - {MediaWiktory::Wikipedia::Modules::Cxtranslatorstats} Fetch the translation statistics for the given user.
|
97
|
+
# * `:deletedrevs` - {MediaWiktory::Wikipedia::Modules::Deletedrevs} List deleted revisions.
|
98
|
+
# * `:embeddedin` - {MediaWiktory::Wikipedia::Modules::Embeddedin} Find all pages that embed (transclude) the given title.
|
99
|
+
# * `:exturlusage` - {MediaWiktory::Wikipedia::Modules::Exturlusage} Enumerate pages that contain a given URL.
|
100
|
+
# * `:filearchive` - {MediaWiktory::Wikipedia::Modules::Filearchive} Enumerate all deleted files sequentially.
|
101
|
+
# * `:gadgetcategories` - {MediaWiktory::Wikipedia::Modules::Gadgetcategories} Returns a list of gadget categories.
|
102
|
+
# * `:gadgets` - {MediaWiktory::Wikipedia::Modules::Gadgets} Returns a list of gadgets used on this wiki.
|
103
|
+
# * `:geosearch` - {MediaWiktory::Wikipedia::Modules::Geosearch} Returns pages having coordinates that are located in a certain area.
|
104
|
+
# * `:gettingstartedgetpages` - {MediaWiktory::Wikipedia::Modules::Gettingstartedgetpages} This API is for getting a list of one or more pages related to a particular GettingStarted task.
|
105
|
+
# * `:globalallusers` - {MediaWiktory::Wikipedia::Modules::Globalallusers} Enumerate all global users.
|
106
|
+
# * `:globalblocks` - {MediaWiktory::Wikipedia::Modules::Globalblocks} List all globally blocked IP addresses.
|
107
|
+
# * `:globalgroups` - {MediaWiktory::Wikipedia::Modules::Globalgroups} Enumerate all global groups.
|
108
|
+
# * `:imageusage` - {MediaWiktory::Wikipedia::Modules::Imageusage} Find all pages that use the given image title.
|
109
|
+
# * `:iwbacklinks` - {MediaWiktory::Wikipedia::Modules::Iwbacklinks} Find all pages that link to the given interwiki link.
|
110
|
+
# * `:langbacklinks` - {MediaWiktory::Wikipedia::Modules::Langbacklinks} Find all pages that link to the given language link.
|
111
|
+
# * `:logevents` - {MediaWiktory::Wikipedia::Modules::Logevents} Get events from logs.
|
112
|
+
# * `:mmsites` - {MediaWiktory::Wikipedia::Modules::Mmsites} Serve autocomplete requests for the site field in MassMessage.
|
113
|
+
# * `:mostviewed` - {MediaWiktory::Wikipedia::Modules::Mostviewed} Lists the most viewed pages (based on last day's pageview count).
|
114
|
+
# * `:mystashedfiles` - {MediaWiktory::Wikipedia::Modules::Mystashedfiles} Get a list of files in the current user's upload stash.
|
115
|
+
# * `:oldreviewedpages` - {MediaWiktory::Wikipedia::Modules::Oldreviewedpages} Enumerates pages that have changes pending review.
|
116
|
+
# * `:pagepropnames` - {MediaWiktory::Wikipedia::Modules::Pagepropnames} List all page property names in use on the wiki.
|
117
|
+
# * `:pageswithprop` - {MediaWiktory::Wikipedia::Modules::Pageswithprop} List all pages using a given page property.
|
118
|
+
# * `:prefixsearch` - {MediaWiktory::Wikipedia::Modules::Prefixsearch} Perform a prefix search for page titles.
|
119
|
+
# * `:projectpages` - {MediaWiktory::Wikipedia::Modules::Projectpages} List all pages associated with one or more projects.
|
120
|
+
# * `:projects` - {MediaWiktory::Wikipedia::Modules::Projects} List all the projects.
|
121
|
+
# * `:protectedtitles` - {MediaWiktory::Wikipedia::Modules::Protectedtitles} List all titles protected from creation.
|
122
|
+
# * `:querypage` - {MediaWiktory::Wikipedia::Modules::Querypage} Get a list provided by a QueryPage-based special page.
|
123
|
+
# * `:random` - {MediaWiktory::Wikipedia::Modules::Random} Get a set of random pages.
|
124
|
+
# * `:recentchanges` - {MediaWiktory::Wikipedia::Modules::Recentchanges} Enumerate recent changes.
|
125
|
+
# * `:search` - {MediaWiktory::Wikipedia::Modules::Search} Perform a full text search.
|
126
|
+
# * `:tags` - {MediaWiktory::Wikipedia::Modules::Tags} List change tags.
|
127
|
+
# * `:usercontribs` - {MediaWiktory::Wikipedia::Modules::Usercontribs} Get all edits by a user.
|
128
|
+
# * `:users` - {MediaWiktory::Wikipedia::Modules::Users} Get information about a list of users.
|
129
|
+
# * `:watchlist` - {MediaWiktory::Wikipedia::Modules::Watchlist} Get recent changes to pages in the current user's watchlist.
|
130
|
+
# * `:watchlistraw` - {MediaWiktory::Wikipedia::Modules::Watchlistraw} Get all pages on the current user's watchlist.
|
131
|
+
# * `:wblistentityusage` - {MediaWiktory::Wikipedia::Modules::Wblistentityusage} Returns all pages that use the given entity IDs.
|
132
|
+
# * `:wikisets` - {MediaWiktory::Wikipedia::Modules::Wikisets} Enumerate all wiki sets.
|
133
|
+
# @return [self]
|
134
|
+
def list(*values)
|
135
|
+
values.inject(self) { |res, val| res._list(val) or fail ArgumentError, "Unknown value for list: #{val}" }
|
136
|
+
end
|
137
|
+
|
138
|
+
# @private
|
139
|
+
def _list(value)
|
140
|
+
defined?(super) && super || [:abusefilters, :abuselog, :allcategories, :alldeletedrevisions, :allfileusages, :allimages, :alllinks, :allpages, :allredirects, :allrevisions, :alltransclusions, :allusers, :backlinks, :betafeatures, :blocks, :categorymembers, :centralnoticelogs, :checkuser, :checkuserlog, :contenttranslation, :contenttranslationcorpora, :contenttranslationlangtrend, :contenttranslationstats, :contenttranslationsuggestions, :cxpublishedtranslations, :cxtranslatorstats, :deletedrevs, :embeddedin, :exturlusage, :filearchive, :gadgetcategories, :gadgets, :geosearch, :gettingstartedgetpages, :globalallusers, :globalblocks, :globalgroups, :imageusage, :iwbacklinks, :langbacklinks, :logevents, :mmsites, :mostviewed, :mystashedfiles, :oldreviewedpages, :pagepropnames, :pageswithprop, :prefixsearch, :projectpages, :projects, :protectedtitles, :querypage, :random, :recentchanges, :search, :tags, :usercontribs, :users, :watchlist, :watchlistraw, :wblistentityusage, :wikisets].include?(value.to_sym) && merge(list: value.to_s, replace: false).submodule({abusefilters: Modules::Abusefilters, abuselog: Modules::Abuselog, allcategories: Modules::Allcategories, alldeletedrevisions: Modules::Alldeletedrevisions, allfileusages: Modules::Allfileusages, allimages: Modules::Allimages, alllinks: Modules::Alllinks, allpages: Modules::Allpages, allredirects: Modules::Allredirects, allrevisions: Modules::Allrevisions, alltransclusions: Modules::Alltransclusions, allusers: Modules::Allusers, backlinks: Modules::Backlinks, betafeatures: Modules::Betafeatures, blocks: Modules::Blocks, categorymembers: Modules::Categorymembers, centralnoticelogs: Modules::Centralnoticelogs, checkuser: Modules::Checkuser, checkuserlog: Modules::Checkuserlog, contenttranslation: Modules::Contenttranslation, contenttranslationcorpora: Modules::Contenttranslationcorpora, contenttranslationlangtrend: Modules::Contenttranslationlangtrend, contenttranslationstats: Modules::Contenttranslationstats, contenttranslationsuggestions: Modules::Contenttranslationsuggestions, cxpublishedtranslations: Modules::Cxpublishedtranslations, cxtranslatorstats: Modules::Cxtranslatorstats, deletedrevs: Modules::Deletedrevs, embeddedin: Modules::Embeddedin, exturlusage: Modules::Exturlusage, filearchive: Modules::Filearchive, gadgetcategories: Modules::Gadgetcategories, gadgets: Modules::Gadgets, geosearch: Modules::Geosearch, gettingstartedgetpages: Modules::Gettingstartedgetpages, globalallusers: Modules::Globalallusers, globalblocks: Modules::Globalblocks, globalgroups: Modules::Globalgroups, imageusage: Modules::Imageusage, iwbacklinks: Modules::Iwbacklinks, langbacklinks: Modules::Langbacklinks, logevents: Modules::Logevents, mmsites: Modules::Mmsites, mostviewed: Modules::Mostviewed, mystashedfiles: Modules::Mystashedfiles, oldreviewedpages: Modules::Oldreviewedpages, pagepropnames: Modules::Pagepropnames, pageswithprop: Modules::Pageswithprop, prefixsearch: Modules::Prefixsearch, projectpages: Modules::Projectpages, projects: Modules::Projects, protectedtitles: Modules::Protectedtitles, querypage: Modules::Querypage, random: Modules::Random, recentchanges: Modules::Recentchanges, search: Modules::Search, tags: Modules::Tags, usercontribs: Modules::Usercontribs, users: Modules::Users, watchlist: Modules::Watchlist, watchlistraw: Modules::Watchlistraw, wblistentityusage: Modules::Wblistentityusage, wikisets: Modules::Wikisets}[value.to_sym])
|
141
|
+
end
|
142
|
+
|
143
|
+
# Which metadata to get.
|
144
|
+
#
|
145
|
+
# @param values [Array<Symbol>] All selected options include tweaking methods from corresponding modules:
|
146
|
+
# * `:allmessages` - {MediaWiktory::Wikipedia::Modules::Allmessages} Return messages from this site.
|
147
|
+
# * `:authmanagerinfo` - {MediaWiktory::Wikipedia::Modules::Authmanagerinfo} Retrieve information about the current authentication status.
|
148
|
+
# * `:babel` - {MediaWiktory::Wikipedia::Modules::Babel} Get information about what languages the user knows
|
149
|
+
# * `:featureusage` - {MediaWiktory::Wikipedia::Modules::Featureusage} Get a summary of logged API feature usages for a user agent.
|
150
|
+
# * `:filerepoinfo` - {MediaWiktory::Wikipedia::Modules::Filerepoinfo} Return meta information about image repositories configured on the wiki.
|
151
|
+
# * `:globaluserinfo` - {MediaWiktory::Wikipedia::Modules::Globaluserinfo} Show information about a global user.
|
152
|
+
# * `:notifications` - {MediaWiktory::Wikipedia::Modules::Notifications} Get notifications waiting for the current user.
|
153
|
+
# * `:oath` - {MediaWiktory::Wikipedia::Modules::Oath} Check to see if two-factor authentication (OATH) is enabled for a user.
|
154
|
+
# * `:ores` - {MediaWiktory::Wikipedia::Modules::Ores} Return ORES configuration and model data for this wiki.
|
155
|
+
# * `:siteinfo` - {MediaWiktory::Wikipedia::Modules::Siteinfo} Return general information about the site.
|
156
|
+
# * `:siteviews` - {MediaWiktory::Wikipedia::Modules::Siteviews} Shows sitewide pageview data (daily pageview totals for each of the last pvisdays days). The result format is date (Ymd) => count.
|
157
|
+
# * `:tokens` - {MediaWiktory::Wikipedia::Modules::Tokens} Gets tokens for data-modifying actions.
|
158
|
+
# * `:unreadnotificationpages` - {MediaWiktory::Wikipedia::Modules::Unreadnotificationpages} Get pages for which there are unread notifications for the current user.
|
159
|
+
# * `:userinfo` - {MediaWiktory::Wikipedia::Modules::Userinfo} Get information about the current user.
|
160
|
+
# * `:wikibase` - {MediaWiktory::Wikipedia::Modules::Wikibase} Get information about the Wikibase client and the associated Wikibase repository.
|
161
|
+
# @return [self]
|
162
|
+
def meta(*values)
|
163
|
+
values.inject(self) { |res, val| res._meta(val) or fail ArgumentError, "Unknown value for meta: #{val}" }
|
164
|
+
end
|
165
|
+
|
166
|
+
# @private
|
167
|
+
def _meta(value)
|
168
|
+
defined?(super) && super || [:allmessages, :authmanagerinfo, :babel, :featureusage, :filerepoinfo, :globaluserinfo, :notifications, :oath, :ores, :siteinfo, :siteviews, :tokens, :unreadnotificationpages, :userinfo, :wikibase].include?(value.to_sym) && merge(meta: value.to_s, replace: false).submodule({allmessages: Modules::Allmessages, authmanagerinfo: Modules::Authmanagerinfo, babel: Modules::Babel, featureusage: Modules::Featureusage, filerepoinfo: Modules::Filerepoinfo, globaluserinfo: Modules::Globaluserinfo, notifications: Modules::Notifications, oath: Modules::Oath, ores: Modules::Ores, siteinfo: Modules::Siteinfo, siteviews: Modules::Siteviews, tokens: Modules::Tokens, unreadnotificationpages: Modules::Unreadnotificationpages, userinfo: Modules::Userinfo, wikibase: Modules::Wikibase}[value.to_sym])
|
169
|
+
end
|
170
|
+
|
171
|
+
# Include an additional pageids section listing all returned page IDs.
|
172
|
+
#
|
173
|
+
# @return [self]
|
174
|
+
def indexpageids()
|
175
|
+
merge(indexpageids: 'true')
|
176
|
+
end
|
177
|
+
|
178
|
+
# Export the current revisions of all given or generated pages.
|
179
|
+
#
|
180
|
+
# @return [self]
|
181
|
+
def export()
|
182
|
+
merge(export: 'true')
|
183
|
+
end
|
184
|
+
|
185
|
+
# Return the export XML without wrapping it in an XML result (same format as Special:Export). Can only be used with export.
|
186
|
+
#
|
187
|
+
# @return [self]
|
188
|
+
def exportnowrap()
|
189
|
+
merge(exportnowrap: 'true')
|
190
|
+
end
|
191
|
+
|
192
|
+
# Whether to get the full URL if the title is an interwiki link.
|
193
|
+
#
|
194
|
+
# @return [self]
|
195
|
+
def iwurl()
|
196
|
+
merge(iwurl: 'true')
|
197
|
+
end
|
198
|
+
|
199
|
+
# When more results are available, use this to continue.
|
200
|
+
#
|
201
|
+
# @param value [String]
|
202
|
+
# @return [self]
|
203
|
+
def continue(value)
|
204
|
+
merge(continue: value.to_s)
|
205
|
+
end
|
206
|
+
|
207
|
+
# Return raw query-continue data for continuation.
|
208
|
+
#
|
209
|
+
# @return [self]
|
210
|
+
def rawcontinue()
|
211
|
+
merge(rawcontinue: 'true')
|
212
|
+
end
|
213
|
+
|
214
|
+
# A list of titles to work on.
|
215
|
+
#
|
216
|
+
# @param values [Array<String>]
|
217
|
+
# @return [self]
|
218
|
+
def titles(*values)
|
219
|
+
values.inject(self) { |res, val| res._titles(val) }
|
220
|
+
end
|
221
|
+
|
222
|
+
# @private
|
223
|
+
def _titles(value)
|
224
|
+
merge(titles: value.to_s, replace: false)
|
225
|
+
end
|
226
|
+
|
227
|
+
# A list of page IDs to work on.
|
228
|
+
#
|
229
|
+
# @param values [Array<Integer>]
|
230
|
+
# @return [self]
|
231
|
+
def pageids(*values)
|
232
|
+
values.inject(self) { |res, val| res._pageids(val) }
|
233
|
+
end
|
234
|
+
|
235
|
+
# @private
|
236
|
+
def _pageids(value)
|
237
|
+
merge(pageids: value.to_s, replace: false)
|
238
|
+
end
|
239
|
+
|
240
|
+
# A list of revision IDs to work on.
|
241
|
+
#
|
242
|
+
# @param values [Array<Integer>]
|
243
|
+
# @return [self]
|
244
|
+
def revids(*values)
|
245
|
+
values.inject(self) { |res, val| res._revids(val) }
|
246
|
+
end
|
247
|
+
|
248
|
+
# @private
|
249
|
+
def _revids(value)
|
250
|
+
merge(revids: value.to_s, replace: false)
|
251
|
+
end
|
252
|
+
|
253
|
+
# Get the list of pages to work on by executing the specified query module.
|
254
|
+
#
|
255
|
+
# @param value [Symbol] Selecting an option includes tweaking methods from corresponding module:
|
256
|
+
# * `:allcategories` - {MediaWiktory::Wikipedia::Modules::GAllcategories} Enumerate all categories. _Generator module: for fetching pages corresponding to request._
|
257
|
+
# * `:alldeletedrevisions` - {MediaWiktory::Wikipedia::Modules::GAlldeletedrevisions} List all deleted revisions by a user or in a namespace. _Generator module: for fetching pages corresponding to request._
|
258
|
+
# * `:allfileusages` - {MediaWiktory::Wikipedia::Modules::GAllfileusages} List all file usages, including non-existing. _Generator module: for fetching pages corresponding to request._
|
259
|
+
# * `:allimages` - {MediaWiktory::Wikipedia::Modules::GAllimages} Enumerate all images sequentially. _Generator module: for fetching pages corresponding to request._
|
260
|
+
# * `:alllinks` - {MediaWiktory::Wikipedia::Modules::GAlllinks} Enumerate all links that point to a given namespace. _Generator module: for fetching pages corresponding to request._
|
261
|
+
# * `:allpages` - {MediaWiktory::Wikipedia::Modules::GAllpages} Enumerate all pages sequentially in a given namespace. _Generator module: for fetching pages corresponding to request._
|
262
|
+
# * `:allredirects` - {MediaWiktory::Wikipedia::Modules::GAllredirects} List all redirects to a namespace. _Generator module: for fetching pages corresponding to request._
|
263
|
+
# * `:allrevisions` - {MediaWiktory::Wikipedia::Modules::GAllrevisions} List all revisions. _Generator module: for fetching pages corresponding to request._
|
264
|
+
# * `:alltransclusions` - {MediaWiktory::Wikipedia::Modules::GAlltransclusions} List all transclusions (pages embedded using {{x}}), including non-existing. _Generator module: for fetching pages corresponding to request._
|
265
|
+
# * `:backlinks` - {MediaWiktory::Wikipedia::Modules::GBacklinks} Find all pages that link to the given page. _Generator module: for fetching pages corresponding to request._
|
266
|
+
# * `:categories` - {MediaWiktory::Wikipedia::Modules::GCategories} List all categories the pages belong to. _Generator module: for fetching pages corresponding to request._
|
267
|
+
# * `:categorymembers` - {MediaWiktory::Wikipedia::Modules::GCategorymembers} List all pages in a given category. _Generator module: for fetching pages corresponding to request._
|
268
|
+
# * `:contenttranslation` - {MediaWiktory::Wikipedia::Modules::GContenttranslation} Query Content Translation database for translations. _Generator module: for fetching pages corresponding to request._
|
269
|
+
# * `:contenttranslationsuggestions` - {MediaWiktory::Wikipedia::Modules::GContenttranslationsuggestions} Get suggestion lists for Content Translation. _Generator module: for fetching pages corresponding to request._
|
270
|
+
# * `:deletedrevisions` - {MediaWiktory::Wikipedia::Modules::GDeletedrevisions} Get deleted revision information. _Generator module: for fetching pages corresponding to request._
|
271
|
+
# * `:duplicatefiles` - {MediaWiktory::Wikipedia::Modules::GDuplicatefiles} List all files that are duplicates of the given files based on hash values. _Generator module: for fetching pages corresponding to request._
|
272
|
+
# * `:embeddedin` - {MediaWiktory::Wikipedia::Modules::GEmbeddedin} Find all pages that embed (transclude) the given title. _Generator module: for fetching pages corresponding to request._
|
273
|
+
# * `:exturlusage` - {MediaWiktory::Wikipedia::Modules::GExturlusage} Enumerate pages that contain a given URL. _Generator module: for fetching pages corresponding to request._
|
274
|
+
# * `:fileusage` - {MediaWiktory::Wikipedia::Modules::GFileusage} Find all pages that use the given files. _Generator module: for fetching pages corresponding to request._
|
275
|
+
# * `:geosearch` - {MediaWiktory::Wikipedia::Modules::GGeosearch} Returns pages having coordinates that are located in a certain area. _Generator module: for fetching pages corresponding to request._
|
276
|
+
# * `:gettingstartedgetpages` - {MediaWiktory::Wikipedia::Modules::GGettingstartedgetpages} This API is for getting a list of one or more pages related to a particular GettingStarted task. _Generator module: for fetching pages corresponding to request._
|
277
|
+
# * `:images` - {MediaWiktory::Wikipedia::Modules::GImages} Returns all files contained on the given pages. _Generator module: for fetching pages corresponding to request._
|
278
|
+
# * `:imageusage` - {MediaWiktory::Wikipedia::Modules::GImageusage} Find all pages that use the given image title. _Generator module: for fetching pages corresponding to request._
|
279
|
+
# * `:iwbacklinks` - {MediaWiktory::Wikipedia::Modules::GIwbacklinks} Find all pages that link to the given interwiki link. _Generator module: for fetching pages corresponding to request._
|
280
|
+
# * `:langbacklinks` - {MediaWiktory::Wikipedia::Modules::GLangbacklinks} Find all pages that link to the given language link. _Generator module: for fetching pages corresponding to request._
|
281
|
+
# * `:links` - {MediaWiktory::Wikipedia::Modules::GLinks} Returns all links from the given pages. _Generator module: for fetching pages corresponding to request._
|
282
|
+
# * `:linkshere` - {MediaWiktory::Wikipedia::Modules::GLinkshere} Find all pages that link to the given pages. _Generator module: for fetching pages corresponding to request._
|
283
|
+
# * `:mostviewed` - {MediaWiktory::Wikipedia::Modules::GMostviewed} Lists the most viewed pages (based on last day's pageview count). _Generator module: for fetching pages corresponding to request._
|
284
|
+
# * `:oldreviewedpages` - {MediaWiktory::Wikipedia::Modules::GOldreviewedpages} Enumerates pages that have changes pending review. _Generator module: for fetching pages corresponding to request._
|
285
|
+
# * `:pageswithprop` - {MediaWiktory::Wikipedia::Modules::GPageswithprop} List all pages using a given page property. _Generator module: for fetching pages corresponding to request._
|
286
|
+
# * `:prefixsearch` - {MediaWiktory::Wikipedia::Modules::GPrefixsearch} Perform a prefix search for page titles. _Generator module: for fetching pages corresponding to request._
|
287
|
+
# * `:projectpages` - {MediaWiktory::Wikipedia::Modules::GProjectpages} List all pages associated with one or more projects. _Generator module: for fetching pages corresponding to request._
|
288
|
+
# * `:protectedtitles` - {MediaWiktory::Wikipedia::Modules::GProtectedtitles} List all titles protected from creation. _Generator module: for fetching pages corresponding to request._
|
289
|
+
# * `:querypage` - {MediaWiktory::Wikipedia::Modules::GQuerypage} Get a list provided by a QueryPage-based special page. _Generator module: for fetching pages corresponding to request._
|
290
|
+
# * `:random` - {MediaWiktory::Wikipedia::Modules::GRandom} Get a set of random pages. _Generator module: for fetching pages corresponding to request._
|
291
|
+
# * `:recentchanges` - {MediaWiktory::Wikipedia::Modules::GRecentchanges} Enumerate recent changes. _Generator module: for fetching pages corresponding to request._
|
292
|
+
# * `:redirects` - {MediaWiktory::Wikipedia::Modules::GRedirects} Returns all redirects to the given pages. _Generator module: for fetching pages corresponding to request._
|
293
|
+
# * `:revisions` - {MediaWiktory::Wikipedia::Modules::GRevisions} Get revision information. _Generator module: for fetching pages corresponding to request._
|
294
|
+
# * `:search` - {MediaWiktory::Wikipedia::Modules::GSearch} Perform a full text search. _Generator module: for fetching pages corresponding to request._
|
295
|
+
# * `:templates` - {MediaWiktory::Wikipedia::Modules::GTemplates} Returns all pages transcluded on the given pages. _Generator module: for fetching pages corresponding to request._
|
296
|
+
# * `:transcludedin` - {MediaWiktory::Wikipedia::Modules::GTranscludedin} Find all pages that transclude the given pages. _Generator module: for fetching pages corresponding to request._
|
297
|
+
# * `:watchlist` - {MediaWiktory::Wikipedia::Modules::GWatchlist} Get recent changes to pages in the current user's watchlist. _Generator module: for fetching pages corresponding to request._
|
298
|
+
# * `:watchlistraw` - {MediaWiktory::Wikipedia::Modules::GWatchlistraw} Get all pages on the current user's watchlist. _Generator module: for fetching pages corresponding to request._
|
299
|
+
# * `:wblistentityusage` - {MediaWiktory::Wikipedia::Modules::GWblistentityusage} Returns all pages that use the given entity IDs. _Generator module: for fetching pages corresponding to request._
|
300
|
+
# @return [self]
|
301
|
+
def generator(value)
|
302
|
+
_generator(value) or fail ArgumentError, "Unknown value for generator: #{value}"
|
303
|
+
end
|
304
|
+
|
305
|
+
# @private
|
306
|
+
def _generator(value)
|
307
|
+
defined?(super) && super || [:allcategories, :alldeletedrevisions, :allfileusages, :allimages, :alllinks, :allpages, :allredirects, :allrevisions, :alltransclusions, :backlinks, :categories, :categorymembers, :contenttranslation, :contenttranslationsuggestions, :deletedrevisions, :duplicatefiles, :embeddedin, :exturlusage, :fileusage, :geosearch, :gettingstartedgetpages, :images, :imageusage, :iwbacklinks, :langbacklinks, :links, :linkshere, :mostviewed, :oldreviewedpages, :pageswithprop, :prefixsearch, :projectpages, :protectedtitles, :querypage, :random, :recentchanges, :redirects, :revisions, :search, :templates, :transcludedin, :watchlist, :watchlistraw, :wblistentityusage].include?(value.to_sym) && merge(generator: value.to_s).submodule({allcategories: Modules::GAllcategories, alldeletedrevisions: Modules::GAlldeletedrevisions, allfileusages: Modules::GAllfileusages, allimages: Modules::GAllimages, alllinks: Modules::GAlllinks, allpages: Modules::GAllpages, allredirects: Modules::GAllredirects, allrevisions: Modules::GAllrevisions, alltransclusions: Modules::GAlltransclusions, backlinks: Modules::GBacklinks, categories: Modules::GCategories, categorymembers: Modules::GCategorymembers, contenttranslation: Modules::GContenttranslation, contenttranslationsuggestions: Modules::GContenttranslationsuggestions, deletedrevisions: Modules::GDeletedrevisions, duplicatefiles: Modules::GDuplicatefiles, embeddedin: Modules::GEmbeddedin, exturlusage: Modules::GExturlusage, fileusage: Modules::GFileusage, geosearch: Modules::GGeosearch, gettingstartedgetpages: Modules::GGettingstartedgetpages, images: Modules::GImages, imageusage: Modules::GImageusage, iwbacklinks: Modules::GIwbacklinks, langbacklinks: Modules::GLangbacklinks, links: Modules::GLinks, linkshere: Modules::GLinkshere, mostviewed: Modules::GMostviewed, oldreviewedpages: Modules::GOldreviewedpages, pageswithprop: Modules::GPageswithprop, prefixsearch: Modules::GPrefixsearch, projectpages: Modules::GProjectpages, protectedtitles: Modules::GProtectedtitles, querypage: Modules::GQuerypage, random: Modules::GRandom, recentchanges: Modules::GRecentchanges, redirects: Modules::GRedirects, revisions: Modules::GRevisions, search: Modules::GSearch, templates: Modules::GTemplates, transcludedin: Modules::GTranscludedin, watchlist: Modules::GWatchlist, watchlistraw: Modules::GWatchlistraw, wblistentityusage: Modules::GWblistentityusage}[value.to_sym])
|
308
|
+
end
|
309
|
+
|
310
|
+
# Automatically resolve redirects in titles, pageids, and revids, and in pages returned by generator.
|
311
|
+
#
|
312
|
+
# @return [self]
|
313
|
+
def redirects()
|
314
|
+
merge(redirects: 'true')
|
315
|
+
end
|
316
|
+
|
317
|
+
# Convert titles to other variants if necessary. Only works if the wiki's content language supports variant conversion. Languages that support variant conversion include gan, iu, kk, ku, shi, sr, tg, uz and zh.
|
318
|
+
#
|
319
|
+
# @return [self]
|
320
|
+
def converttitles()
|
321
|
+
merge(converttitles: 'true')
|
322
|
+
end
|
323
|
+
end
|
324
|
+
end
|
325
|
+
end
|