Class: Api
- Inherits:
-
Object
- Object
- Api
- Defined in:
- lib/rbmediawiki/api.rb
Overview
This class provides an interface for the MediaWiki API. Methods match specific queries to the API, and so the meaning of the parameters are described in www.mediawiki.org/wiki/API
It is intended to be used as a base layer to build specific methods on top of it
Only four methods are special and deserve comments here: #new, #login, #query and #add_post
Instance Method Summary collapse
- #add_post(key, value, post_me = nil) ⇒ Object
- #api_url ⇒ Object
- #base_url ⇒ Object
- #block(user = nil, token = nil, gettoken = nil, expiry = nil, reason = nil, anononly = nil, nocreate = nil, autoblock = nil, noemail = nil, hidename = nil, allowusertalk = nil, reblock = nil, post_me = nil) ⇒ Object
- #delete(title = nil, pageid = nil, token = nil, reason = nil, watch = nil, unwatch = nil, oldimage = nil, post_me = nil) ⇒ Object
- #edit(title = nil, section = nil, text = nil, token = nil, summary = nil, minor = nil, notminor = nil, bot = nil, basetimestamp = nil, starttimestamp = nil, recreate = nil, createonly = nil, nocreate = nil, captchaword = nil, captchaid = nil, watch = nil, unwatch = nil, md5 = nil, prependtext = nil, appendtext = nil, undo = nil, undoafter = nil, post_me = nil) ⇒ Object
- #emailuser(target = nil, subject = nil, text = nil, token = nil, ccme = nil, post_me = nil) ⇒ Object
- #expandtemplates(title = nil, text = nil, generatexml = nil, post_me = nil) ⇒ Object
- #feedwatchlist(feedformat = nil, hours = nil, allrev = nil, post_me = nil) ⇒ Object
-
#format(post_me, format = nil) ⇒ Object
method for defining the format.
- #import(token = nil, summary = nil, xml = nil, interwikisource = nil, interwikipage = nil, fullhistory = nil, templates = nil, namespace = nil, post_me = nil) ⇒ Object
-
#initialize(lang = nil, family = nil, user = nil, server = nil, api_url = nil) ⇒ Api
constructor
-
lang: language of the wiki at wikimedia.
-
-
#login(password = nil) ⇒ Object
Asks for a password and tries to log in.
-
#make_request(post_this) ⇒ Object
based on rwikibot by Eddie Roger, this method makes a post request to the api using the values specified at post_this and the cookies obtained during the login (if available).
- #move(from = nil, fromid = nil, to = nil, token = nil, reason = nil, movetalk = nil, movesubpages = nil, noredirect = nil, watch = nil, unwatch = nil, post_me = nil) ⇒ Object
- #paraminfo(modules = nil, querymodules = nil, mainmodule = nil, pagesetmodule = nil, post_me = nil) ⇒ Object
- #parse(title = nil, text = nil, page = nil, redirects = nil, oldid = nil, prop = nil, pst = nil, onlypst = nil, post_me = nil) ⇒ Object
- #patrol(token = nil, rcid = nil, post_me = nil) ⇒ Object
- #protect(title = nil, token = nil, protections = nil, expiry = nil, reason = nil, cascade = nil, watch = nil, post_me = nil) ⇒ Object
- #purge(titles = nil, post_me = nil) ⇒ Object
-
#query(post_me = nil, titles = nil, pageid = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil) ⇒ Object
method for adding common parameters for all the methods of the type query.
- #query_list_allcategories(titles = nil, acfrom = nil, acprefix = nil, acdir = nil, aclimit = nil, acprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_allimages(titles = nil, aifrom = nil, aiprefix = nil, aiminsize = nil, aimaxsize = nil, ailimit = nil, aidir = nil, aisha1 = nil, aisha1base36 = nil, aiprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_alllinks(titles = nil, alcontinue = nil, alfrom = nil, alprefix = nil, alunique = nil, alprop = nil, alnamespace = nil, allimit = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_allpages(titles = nil, apfrom = nil, apprefix = nil, apnamespace = nil, apfilterredir = nil, apminsize = nil, apmaxsize = nil, apprtype = nil, apprlevel = nil, apprfiltercascade = nil, aplimit = nil, apdir = nil, apfilterlanglinks = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_allusers(titles = nil, aufrom = nil, auprefix = nil, augroup = nil, auprop = nil, aulimit = nil, auwitheditsonly = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_backlinks(titles = nil, bltitle = nil, blcontinue = nil, blnamespace = nil, blfilterredir = nil, bllimit = nil, blredirect = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_blocks(titles = nil, bkstart = nil, bkend = nil, bkdir = nil, bkids = nil, bkusers = nil, bkip = nil, bklimit = nil, bkprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_categorymembers(titles = nil, cmtitle = nil, cmprop = nil, cmnamespace = nil, cmcontinue = nil, cmlimit = nil, cmsort = nil, cmdir = nil, cmstart = nil, cmend = nil, cmstartsortkey = nil, cmendsortkey = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_deletedrevs(titles = nil, drstart = nil, drend = nil, drdir = nil, drfrom = nil, drcontinue = nil, drunique = nil, druser = nil, drexcludeuser = nil, drnamespace = nil, drlimit = nil, drprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_embeddedin(titles = nil, eititle = nil, eicontinue = nil, einamespace = nil, eifilterredir = nil, eilimit = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_exturlusage(titles = nil, euprop = nil, euoffset = nil, euprotocol = nil, euquery = nil, eunamespace = nil, eulimit = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_globalblocks(titles = nil, bgstart = nil, bgend = nil, bgdir = nil, bgids = nil, bgaddresses = nil, bgip = nil, bglimit = nil, bgprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_imageusage(titles = nil, iutitle = nil, iucontinue = nil, iunamespace = nil, iufilterredir = nil, iulimit = nil, iuredirect = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_logevents(titles = nil, leprop = nil, letype = nil, lestart = nil, leend = nil, ledir = nil, leuser = nil, letitle = nil, lelimit = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_protectedtitles(titles = nil, ptnamespace = nil, ptlevel = nil, ptlimit = nil, ptdir = nil, ptstart = nil, ptend = nil, ptprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_random(titles = nil, rnnamespace = nil, rnlimit = nil, rnredirect = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_recentchanges(titles = nil, rcstart = nil, rcend = nil, rcdir = nil, rcnamespace = nil, rcprop = nil, rctoken = nil, rcshow = nil, rclimit = nil, rctype = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_search(titles = nil, srsearch = nil, srnamespace = nil, srwhat = nil, srredirects = nil, sroffset = nil, srlimit = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_usercontribs(titles = nil, uclimit = nil, ucstart = nil, ucend = nil, uccontinue = nil, ucuser = nil, ucuserprefix = nil, ucdir = nil, ucnamespace = nil, ucprop = nil, ucshow = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_users(titles = nil, usprop = nil, ususers = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_watchlist(titles = nil, wlallrev = nil, wlstart = nil, wlend = nil, wlnamespace = nil, wldir = nil, wllimit = nil, wlprop = nil, wlshow = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_list_watchlistraw(titles = nil, wrcontinue = nil, wrnamespace = nil, wrlimit = nil, wrprop = nil, wrshow = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_meta_allmessages(titles = nil, ammessages = nil, amfilter = nil, amlang = nil, amfrom = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_meta_siteinfo(titles = nil, siprop = nil, sifilteriw = nil, sishowalldb = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_meta_userinfo(titles = nil, uiprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_prop_categories(titles = nil, clprop = nil, clshow = nil, cllimit = nil, clcontinue = nil, clcategories = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_prop_categoryinfo(titles = nil, cicontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_prop_duplicatefiles(titles = nil, dflimit = nil, dfcontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_prop_extlinks(titles = nil, ellimit = nil, eloffset = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_prop_imageinfo(titles = nil, iiprop = nil, iilimit = nil, iistart = nil, iiend = nil, iiurlwidth = nil, iiurlheight = nil, iicontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_prop_images(titles = nil, imlimit = nil, imcontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_prop_info(titles = nil, inprop = nil, intoken = nil, incontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_prop_langlinks(titles = nil, lllimit = nil, llcontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_prop_links(titles = nil, plnamespace = nil, pllimit = nil, plcontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_prop_revisions(titles = nil, rvprop = nil, rvlimit = nil, rvstartid = nil, rvendid = nil, rvstart = nil, rvend = nil, rvdir = nil, rvuser = nil, rvexcludeuser = nil, rvexpandtemplates = nil, rvgeneratexml = nil, rvsection = nil, rvtoken = nil, rvcontinue = nil, rvdiffto = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #query_prop_templates(titles = nil, tlnamespace = nil, tllimit = nil, tlcontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
- #rollback(title = nil, user = nil, token = nil, summary = nil, markbot = nil, post_me = nil) ⇒ Object
- #unblock(id = nil, user = nil, token = nil, gettoken = nil, reason = nil, post_me = nil) ⇒ Object
- #undelete(title = nil, token = nil, reason = nil, timestamps = nil, post_me = nil) ⇒ Object
- #watch(title = nil, unwatch = nil, post_me = nil) ⇒ Object
Constructor Details
#initialize(lang = nil, family = nil, user = nil, server = nil, api_url = nil) ⇒ Api
-
lang: language of the wiki at wikimedia.
-
family: family of the wiki at wikimedia. If the wiki is not language dependant, as commons.wikimedia.org , lang value is ignored.
-
user: user to make the edits
-
server: the url of the server, as in en.wikipedia.org this parameter overrides lang and family values
-
api_url: the url of the api, as in en.wikipedia.org if not specified, it will be guessed from the lang+family values or the server
20 21 22 23 24 25 26 |
# File 'lib/rbmediawiki/api.rb', line 20 def initialize(lang = nil, family = nil, user = nil, server = nil, api_url = nil) @config = Hash.new @config['base_url'] = server @config['api_url'] = api_url @config['logged'] = false @config['user'] = user ? user : Ourconfig['default_user'] end |
Instance Method Details
#add_post(key, value, post_me = nil) ⇒ Object
896 897 898 899 900 901 902 903 904 |
# File 'lib/rbmediawiki/api.rb', line 896 def add_post(key, value, post_me = nil) if !post_me post_me = Hash.new() end if value post_me[key]=value end return post_me end |
#api_url ⇒ Object
28 29 30 |
# File 'lib/rbmediawiki/api.rb', line 28 def api_url return @config['api_url'] end |
#base_url ⇒ Object
32 33 34 |
# File 'lib/rbmediawiki/api.rb', line 32 def base_url return @config['base_url'] end |
#block(user = nil, token = nil, gettoken = nil, expiry = nil, reason = nil, anononly = nil, nocreate = nil, autoblock = nil, noemail = nil, hidename = nil, allowusertalk = nil, reblock = nil, post_me = nil) ⇒ Object
770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 |
# File 'lib/rbmediawiki/api.rb', line 770 def block(user = nil, token = nil, gettoken = nil, expiry = nil, reason = nil, anononly = nil, nocreate = nil, autoblock = nil, noemail = nil, hidename = nil, allowusertalk = nil, reblock = nil, post_me = nil) post_me = add_post('user', user, post_me) post_me = add_post('token', token, post_me) post_me = add_post('gettoken', gettoken, post_me) post_me = add_post('expiry', expiry, post_me) post_me = add_post('reason', reason, post_me) post_me = add_post('anononly', anononly, post_me) post_me = add_post('nocreate', nocreate, post_me) post_me = add_post('autoblock', autoblock, post_me) post_me = add_post('noemail', noemail, post_me) post_me = add_post('hidename', hidename, post_me) post_me = add_post('allowusertalk', allowusertalk, post_me) post_me = add_post('reblock', reblock, post_me) post_me = add_post('action', 'block', post_me) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#delete(title = nil, pageid = nil, token = nil, reason = nil, watch = nil, unwatch = nil, oldimage = nil, post_me = nil) ⇒ Object
600 601 602 603 604 605 606 607 608 609 610 611 612 613 |
# File 'lib/rbmediawiki/api.rb', line 600 def delete(title = nil, pageid = nil, token = nil, reason = nil, watch = nil, unwatch = nil, oldimage = nil, post_me = nil) post_me = add_post('title', title, post_me) post_me = add_post('pageid', pageid, post_me) post_me = add_post('token', token, post_me) post_me = add_post('reason', reason, post_me) post_me = add_post('watch', watch, post_me) post_me = add_post('unwatch', unwatch, post_me) post_me = add_post('oldimage', oldimage, post_me) post_me = add_post('action', 'delete', post_me) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#edit(title = nil, section = nil, text = nil, token = nil, summary = nil, minor = nil, notminor = nil, bot = nil, basetimestamp = nil, starttimestamp = nil, recreate = nil, createonly = nil, nocreate = nil, captchaword = nil, captchaid = nil, watch = nil, unwatch = nil, md5 = nil, prependtext = nil, appendtext = nil, undo = nil, undoafter = nil, post_me = nil) ⇒ Object
651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 |
# File 'lib/rbmediawiki/api.rb', line 651 def edit(title = nil, section = nil, text = nil, token = nil, summary = nil, minor = nil, notminor = nil, bot = nil, = nil, = nil, recreate = nil, createonly = nil, nocreate = nil, captchaword = nil, captchaid = nil, watch = nil, unwatch = nil, md5 = nil, prependtext = nil, appendtext = nil, undo = nil, undoafter = nil, post_me = nil) post_me = add_post('title', title, post_me) post_me = add_post('section', section, post_me) post_me = add_post('text', text, post_me) post_me = add_post('token', token, post_me) post_me = add_post('summary', summary, post_me) post_me = add_post('minor', minor, post_me) post_me = add_post('notminor', notminor, post_me) post_me = add_post('bot', bot, post_me) post_me = add_post('basetimestamp', , post_me) post_me = add_post('starttimestamp', , post_me) post_me = add_post('recreate', recreate, post_me) post_me = add_post('createonly', createonly, post_me) post_me = add_post('nocreate', nocreate, post_me) post_me = add_post('captchaword', captchaword, post_me) post_me = add_post('captchaid', captchaid, post_me) post_me = add_post('watch', watch, post_me) post_me = add_post('unwatch', unwatch, post_me) post_me = add_post('md5', md5, post_me) post_me = add_post('prependtext', prependtext, post_me) post_me = add_post('appendtext', appendtext, post_me) post_me = add_post('undo', undo, post_me) post_me = add_post('undoafter', undoafter, post_me) post_me = add_post('action', 'edit', post_me) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#emailuser(target = nil, subject = nil, text = nil, token = nil, ccme = nil, post_me = nil) ⇒ Object
790 791 792 793 794 795 796 797 798 799 800 801 |
# File 'lib/rbmediawiki/api.rb', line 790 def emailuser(target = nil, subject = nil, text = nil, token = nil, ccme = nil, post_me = nil) post_me = add_post('target', target, post_me) post_me = add_post('subject', subject, post_me) post_me = add_post('text', text, post_me) post_me = add_post('token', token, post_me) post_me = add_post('ccme', ccme, post_me) post_me = add_post('action', 'emailuser', post_me) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#expandtemplates(title = nil, text = nil, generatexml = nil, post_me = nil) ⇒ Object
640 641 642 643 644 645 646 647 648 649 |
# File 'lib/rbmediawiki/api.rb', line 640 def (title = nil, text = nil, generatexml = nil, post_me = nil) post_me = add_post('title', title, post_me) post_me = add_post('text', text, post_me) post_me = add_post('generatexml', generatexml, post_me) post_me = add_post('action', 'expandtemplates', post_me) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#feedwatchlist(feedformat = nil, hours = nil, allrev = nil, post_me = nil) ⇒ Object
719 720 721 722 723 724 725 726 727 728 |
# File 'lib/rbmediawiki/api.rb', line 719 def feedwatchlist(feedformat = nil, hours = nil, allrev = nil, post_me = nil) post_me = add_post('feedformat', feedformat, post_me) post_me = add_post('hours', hours, post_me) post_me = add_post('allrev', allrev, post_me) post_me = add_post('action', 'feedwatchlist', post_me) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#format(post_me, format = nil) ⇒ Object
method for defining the format. Currently overriden at make_request
859 860 861 862 |
# File 'lib/rbmediawiki/api.rb', line 859 def format(post_me, format = nil) post_me = add_post('format', format, post_me) return post_me end |
#import(token = nil, summary = nil, xml = nil, interwikisource = nil, interwikipage = nil, fullhistory = nil, templates = nil, namespace = nil, post_me = nil) ⇒ Object
815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 |
# File 'lib/rbmediawiki/api.rb', line 815 def import(token = nil, summary = nil, xml = nil, interwikisource = nil, interwikipage = nil, fullhistory = nil, templates = nil, namespace = nil, post_me = nil) post_me = add_post('token', token, post_me) post_me = add_post('summary', summary, post_me) post_me = add_post('xml', xml, post_me) post_me = add_post('interwikisource', interwikisource, post_me) post_me = add_post('interwikipage', interwikipage, post_me) post_me = add_post('fullhistory', fullhistory, post_me) post_me = add_post('templates', templates, post_me) post_me = add_post('namespace', namespace, post_me) post_me = add_post('action', 'import', post_me) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#login(password = nil) ⇒ Object
Asks for a password and tries to log in. Stores the resulting cookies for using then when making requests. If the user is already logged iy does nothing
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/rbmediawiki/api.rb', line 40 def login(password = nil) if @config['logged'] return true end if (!password) puts "Introduce password for #{@config['user']} at #{@config['base_url']}" password = gets.chomp end post_me = add_post('lgname',@config['user']) post_me = add_post('lgpassword',password, post_me) post_me = add_post('action', 'login', post_me) login_result = make_request(post_me) @config['lgusername'] = login_result['login']['lgusername'] @config['lguserid'] = login_result['login']['lguserid'] @config['lgtoken'] = login_result['login']['lgtoken'] @config['_session'] = login_result['login']['sessionid'] @config['cookieprefix']= login_result['login']['cookieprefix'] @config['logged'] = true return @cookie end |
#make_request(post_this) ⇒ Object
based on rwikibot by Eddie Roger, this method makes a post request to the api using the values specified at post_this and the cookies obtained during the login (if available)
Returns a xml with the result of the query
869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 |
# File 'lib/rbmediawiki/api.rb', line 869 def make_request(post_this) if !post_this.key?('format') or !post_this['format'] post_this['format'] = 'xml' end if @config['logged'] = "#{@config['cookieprefix']}UserName=#{@config['lgusername']}; #{@config['cookieprefix']}UserID=#{@config['lguserid']}; #{@config['cookieprefix']}Token=#{@config['lgtoken']}; #{@config['cookieprefix']}_session=#{@config['_session']}" else = "" end headers = { 'User-agent'=>Ourconfig['user-agent'], 'Cookie' => } uri = URI.parse(@config['api_url']) request = Net::HTTP::Post.new(uri.path, headers) request.set_form_data(post_this) response = Net::HTTP.new(uri.host, uri.port).start { |http| http.request(request) } resputf8 = '<?xml version="1.0" encoding="UTF-8" ?>'+response.body[21..-1] return_result = XmlSimple.xml_in(resputf8, { 'ForceArray' => false }) return return_result end |
#move(from = nil, fromid = nil, to = nil, token = nil, reason = nil, movetalk = nil, movesubpages = nil, noredirect = nil, watch = nil, unwatch = nil, post_me = nil) ⇒ Object
752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 |
# File 'lib/rbmediawiki/api.rb', line 752 def move(from = nil, fromid = nil, to = nil, token = nil, reason = nil, movetalk = nil, movesubpages = nil, noredirect = nil, watch = nil, unwatch = nil, post_me = nil) post_me = add_post('from', from, post_me) post_me = add_post('fromid', fromid, post_me) post_me = add_post('to', to, post_me) post_me = add_post('token', token, post_me) post_me = add_post('reason', reason, post_me) post_me = add_post('movetalk', movetalk, post_me) post_me = add_post('movesubpages', movesubpages, post_me) post_me = add_post('noredirect', noredirect, post_me) post_me = add_post('watch', watch, post_me) post_me = add_post('unwatch', unwatch, post_me) post_me = add_post('action', 'move', post_me) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#paraminfo(modules = nil, querymodules = nil, mainmodule = nil, pagesetmodule = nil, post_me = nil) ⇒ Object
740 741 742 743 744 745 746 747 748 749 750 |
# File 'lib/rbmediawiki/api.rb', line 740 def paraminfo(modules = nil, querymodules = nil, mainmodule = nil, pagesetmodule = nil, post_me = nil) post_me = add_post('modules', modules, post_me) post_me = add_post('querymodules', querymodules, post_me) post_me = add_post('mainmodule', mainmodule, post_me) post_me = add_post('pagesetmodule', pagesetmodule, post_me) post_me = add_post('action', 'paraminfo', post_me) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#parse(title = nil, text = nil, page = nil, redirects = nil, oldid = nil, prop = nil, pst = nil, onlypst = nil, post_me = nil) ⇒ Object
624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 |
# File 'lib/rbmediawiki/api.rb', line 624 def parse(title = nil, text = nil, page = nil, redirects = nil, oldid = nil, prop = nil, pst = nil, onlypst = nil, post_me = nil) post_me = add_post('title', title, post_me) post_me = add_post('text', text, post_me) post_me = add_post('page', page, post_me) post_me = add_post('redirects', redirects, post_me) post_me = add_post('oldid', oldid, post_me) post_me = add_post('prop', prop, post_me) post_me = add_post('pst', pst, post_me) post_me = add_post('onlypst', onlypst, post_me) post_me = add_post('action', 'parse', post_me) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#patrol(token = nil, rcid = nil, post_me = nil) ⇒ Object
730 731 732 733 734 735 736 737 738 |
# File 'lib/rbmediawiki/api.rb', line 730 def patrol(token = nil, rcid = nil, post_me = nil) post_me = add_post('token', token, post_me) post_me = add_post('rcid', rcid, post_me) post_me = add_post('action', 'patrol', post_me) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#protect(title = nil, token = nil, protections = nil, expiry = nil, reason = nil, cascade = nil, watch = nil, post_me = nil) ⇒ Object
691 692 693 694 695 696 697 698 699 700 701 702 703 704 |
# File 'lib/rbmediawiki/api.rb', line 691 def protect(title = nil, token = nil, protections = nil, expiry = nil, reason = nil, cascade = nil, watch = nil, post_me = nil) post_me = add_post('title', title, post_me) post_me = add_post('token', token, post_me) post_me = add_post('protections', protections, post_me) post_me = add_post('expiry', expiry, post_me) post_me = add_post('reason', reason, post_me) post_me = add_post('cascade', cascade, post_me) post_me = add_post('watch', watch, post_me) post_me = add_post('action', 'protect', post_me) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#purge(titles = nil, post_me = nil) ⇒ Object
615 616 617 618 619 620 621 622 |
# File 'lib/rbmediawiki/api.rb', line 615 def purge(titles = nil, post_me = nil) post_me = add_post('titles', titles, post_me) post_me = add_post('action', 'purge', post_me) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query(post_me = nil, titles = nil, pageid = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil) ⇒ Object
method for adding common parameters for all the methods of the type query
846 847 848 849 850 851 852 853 854 855 856 |
# File 'lib/rbmediawiki/api.rb', line 846 def query(post_me = nil, titles = nil, pageid = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil) post_me = add_post('titles', titles, post_me) post_me = add_post('pageid', pageid, post_me) post_me = add_post('revids', revids, post_me) post_me = add_post('redirects', redirects, post_me ) post_me = add_post('indexpageids', indexpageids, post_me) post_me = add_post('export', export, post_me) post_me = add_post('exportnowrap', exportnowrap, post_me) post_me = add_post('action', 'query', post_me) return post_me end |
#query_list_allcategories(titles = nil, acfrom = nil, acprefix = nil, acdir = nil, aclimit = nil, acprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
468 469 470 471 472 473 474 475 476 477 478 479 480 |
# File 'lib/rbmediawiki/api.rb', line 468 def query_list_allcategories(titles = nil, acfrom = nil, acprefix = nil, acdir = nil, aclimit = nil, acprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('acfrom', acfrom, post_me) post_me = add_post('acprefix', acprefix, post_me) post_me = add_post('acdir', acdir, post_me) post_me = add_post('aclimit', aclimit, post_me) post_me = add_post('acprop', acprop, post_me) post_me = add_post('list', 'allcategories', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_allimages(titles = nil, aifrom = nil, aiprefix = nil, aiminsize = nil, aimaxsize = nil, ailimit = nil, aidir = nil, aisha1 = nil, aisha1base36 = nil, aiprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 |
# File 'lib/rbmediawiki/api.rb', line 482 def query_list_allimages(titles = nil, aifrom = nil, aiprefix = nil, aiminsize = nil, aimaxsize = nil, ailimit = nil, aidir = nil, aisha1 = nil, aisha1base36 = nil, aiprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('aifrom', aifrom, post_me) post_me = add_post('aiprefix', aiprefix, post_me) post_me = add_post('aiminsize', aiminsize, post_me) post_me = add_post('aimaxsize', aimaxsize, post_me) post_me = add_post('ailimit', ailimit, post_me) post_me = add_post('aidir', aidir, post_me) post_me = add_post('aisha1', aisha1, post_me) post_me = add_post('aisha1base36', aisha1base36, post_me) post_me = add_post('aiprop', aiprop, post_me) post_me = add_post('list', 'allimages', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_alllinks(titles = nil, alcontinue = nil, alfrom = nil, alprefix = nil, alunique = nil, alprop = nil, alnamespace = nil, allimit = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
# File 'lib/rbmediawiki/api.rb', line 245 def query_list_alllinks(titles = nil, alcontinue = nil, alfrom = nil, alprefix = nil, alunique = nil, alprop = nil, alnamespace = nil, allimit = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('alcontinue', alcontinue, post_me) post_me = add_post('alfrom', alfrom, post_me) post_me = add_post('alprefix', alprefix, post_me) post_me = add_post('alunique', alunique, post_me) post_me = add_post('alprop', alprop, post_me) post_me = add_post('alnamespace', alnamespace, post_me) post_me = add_post('allimit', allimit, post_me) post_me = add_post('list', 'alllinks', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_allpages(titles = nil, apfrom = nil, apprefix = nil, apnamespace = nil, apfilterredir = nil, apminsize = nil, apmaxsize = nil, apprtype = nil, apprlevel = nil, apprfiltercascade = nil, aplimit = nil, apdir = nil, apfilterlanglinks = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/rbmediawiki/api.rb', line 142 def query_list_allpages(titles = nil, apfrom = nil, apprefix = nil, apnamespace = nil, apfilterredir = nil, apminsize = nil, apmaxsize = nil, apprtype = nil, apprlevel = nil, apprfiltercascade = nil, aplimit = nil, apdir = nil, apfilterlanglinks = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('apfrom', apfrom, post_me) post_me = add_post('apprefix', apprefix, post_me) post_me = add_post('apnamespace', apnamespace, post_me) post_me = add_post('apfilterredir', apfilterredir, post_me) post_me = add_post('apminsize', apminsize, post_me) post_me = add_post('apmaxsize', apmaxsize, post_me) post_me = add_post('apprtype', apprtype, post_me) post_me = add_post('apprlevel', apprlevel, post_me) post_me = add_post('apprfiltercascade', apprfiltercascade, post_me) post_me = add_post('aplimit', aplimit, post_me) post_me = add_post('apdir', apdir, post_me) post_me = add_post('apfilterlanglinks', apfilterlanglinks, post_me) post_me = add_post('list', 'allpages', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_allusers(titles = nil, aufrom = nil, auprefix = nil, augroup = nil, auprop = nil, aulimit = nil, auwitheditsonly = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'lib/rbmediawiki/api.rb', line 303 def query_list_allusers(titles = nil, aufrom = nil, auprefix = nil, augroup = nil, auprop = nil, aulimit = nil, auwitheditsonly = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('aufrom', aufrom, post_me) post_me = add_post('auprefix', auprefix, post_me) post_me = add_post('augroup', augroup, post_me) post_me = add_post('auprop', auprop, post_me) post_me = add_post('aulimit', aulimit, post_me) post_me = add_post('auwitheditsonly', auwitheditsonly, post_me) post_me = add_post('list', 'allusers', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_backlinks(titles = nil, bltitle = nil, blcontinue = nil, blnamespace = nil, blfilterredir = nil, bllimit = nil, blredirect = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
453 454 455 456 457 458 459 460 461 462 463 464 465 466 |
# File 'lib/rbmediawiki/api.rb', line 453 def query_list_backlinks(titles = nil, bltitle = nil, blcontinue = nil, blnamespace = nil, blfilterredir = nil, bllimit = nil, blredirect = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('bltitle', bltitle, post_me) post_me = add_post('blcontinue', blcontinue, post_me) post_me = add_post('blnamespace', blnamespace, post_me) post_me = add_post('blfilterredir', blfilterredir, post_me) post_me = add_post('bllimit', bllimit, post_me) post_me = add_post('blredirect', blredirect, post_me) post_me = add_post('list', 'backlinks', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_blocks(titles = nil, bkstart = nil, bkend = nil, bkdir = nil, bkids = nil, bkusers = nil, bkip = nil, bklimit = nil, bkprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/rbmediawiki/api.rb', line 228 def query_list_blocks(titles = nil, bkstart = nil, bkend = nil, bkdir = nil, bkids = nil, bkusers = nil, bkip = nil, bklimit = nil, bkprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('bkstart', bkstart, post_me) post_me = add_post('bkend', bkend, post_me) post_me = add_post('bkdir', bkdir, post_me) post_me = add_post('bkids', bkids, post_me) post_me = add_post('bkusers', bkusers, post_me) post_me = add_post('bkip', bkip, post_me) post_me = add_post('bklimit', bklimit, post_me) post_me = add_post('bkprop', bkprop, post_me) post_me = add_post('list', 'blocks', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_categorymembers(titles = nil, cmtitle = nil, cmprop = nil, cmnamespace = nil, cmcontinue = nil, cmlimit = nil, cmsort = nil, cmdir = nil, cmstart = nil, cmend = nil, cmstartsortkey = nil, cmendsortkey = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/rbmediawiki/api.rb', line 283 def query_list_categorymembers(titles = nil, cmtitle = nil, cmprop = nil, cmnamespace = nil, cmcontinue = nil, cmlimit = nil, cmsort = nil, cmdir = nil, cmstart = nil, cmend = nil, cmstartsortkey = nil, cmendsortkey = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('cmtitle', cmtitle, post_me) post_me = add_post('cmprop', cmprop, post_me) post_me = add_post('cmnamespace', cmnamespace, post_me) post_me = add_post('cmcontinue', cmcontinue, post_me) post_me = add_post('cmlimit', cmlimit, post_me) post_me = add_post('cmsort', cmsort, post_me) post_me = add_post('cmdir', cmdir, post_me) post_me = add_post('cmstart', cmstart, post_me) post_me = add_post('cmend', cmend, post_me) post_me = add_post('cmstartsortkey', cmstartsortkey, post_me) post_me = add_post('cmendsortkey', cmendsortkey, post_me) post_me = add_post('list', 'categorymembers', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_deletedrevs(titles = nil, drstart = nil, drend = nil, drdir = nil, drfrom = nil, drcontinue = nil, drunique = nil, druser = nil, drexcludeuser = nil, drnamespace = nil, drlimit = nil, drprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
# File 'lib/rbmediawiki/api.rb', line 192 def query_list_deletedrevs(titles = nil, drstart = nil, drend = nil, drdir = nil, drfrom = nil, drcontinue = nil, drunique = nil, druser = nil, drexcludeuser = nil, drnamespace = nil, drlimit = nil, drprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('drstart', drstart, post_me) post_me = add_post('drend', drend, post_me) post_me = add_post('drdir', drdir, post_me) post_me = add_post('drfrom', drfrom, post_me) post_me = add_post('drcontinue', drcontinue, post_me) post_me = add_post('drunique', drunique, post_me) post_me = add_post('druser', druser, post_me) post_me = add_post('drexcludeuser', drexcludeuser, post_me) post_me = add_post('drnamespace', drnamespace, post_me) post_me = add_post('drlimit', drlimit, post_me) post_me = add_post('drprop', drprop, post_me) post_me = add_post('list', 'deletedrevs', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_embeddedin(titles = nil, eititle = nil, eicontinue = nil, einamespace = nil, eifilterredir = nil, eilimit = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
361 362 363 364 365 366 367 368 369 370 371 372 373 |
# File 'lib/rbmediawiki/api.rb', line 361 def (titles = nil, eititle = nil, eicontinue = nil, einamespace = nil, eifilterredir = nil, eilimit = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('eititle', eititle, post_me) post_me = add_post('eicontinue', eicontinue, post_me) post_me = add_post('einamespace', einamespace, post_me) post_me = add_post('eifilterredir', eifilterredir, post_me) post_me = add_post('eilimit', eilimit, post_me) post_me = add_post('list', 'embeddedin', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_exturlusage(titles = nil, euprop = nil, euoffset = nil, euprotocol = nil, euquery = nil, eunamespace = nil, eulimit = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/rbmediawiki/api.rb', line 127 def query_list_exturlusage(titles = nil, euprop = nil, euoffset = nil, euprotocol = nil, euquery = nil, eunamespace = nil, eulimit = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('euprop', euprop, post_me) post_me = add_post('euoffset', euoffset, post_me) post_me = add_post('euprotocol', euprotocol, post_me) post_me = add_post('euquery', euquery, post_me) post_me = add_post('eunamespace', eunamespace, post_me) post_me = add_post('eulimit', eulimit, post_me) post_me = add_post('list', 'exturlusage', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_globalblocks(titles = nil, bgstart = nil, bgend = nil, bgdir = nil, bgids = nil, bgaddresses = nil, bgip = nil, bglimit = nil, bgprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 |
# File 'lib/rbmediawiki/api.rb', line 386 def query_list_globalblocks(titles = nil, bgstart = nil, bgend = nil, bgdir = nil, bgids = nil, bgaddresses = nil, bgip = nil, bglimit = nil, bgprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('bgstart', bgstart, post_me) post_me = add_post('bgend', bgend, post_me) post_me = add_post('bgdir', bgdir, post_me) post_me = add_post('bgids', bgids, post_me) post_me = add_post('bgaddresses', bgaddresses, post_me) post_me = add_post('bgip', bgip, post_me) post_me = add_post('bglimit', bglimit, post_me) post_me = add_post('bgprop', bgprop, post_me) post_me = add_post('list', 'globalblocks', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_imageusage(titles = nil, iutitle = nil, iucontinue = nil, iunamespace = nil, iufilterredir = nil, iulimit = nil, iuredirect = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
541 542 543 544 545 546 547 548 549 550 551 552 553 554 |
# File 'lib/rbmediawiki/api.rb', line 541 def query_list_imageusage(titles = nil, iutitle = nil, iucontinue = nil, iunamespace = nil, iufilterredir = nil, iulimit = nil, iuredirect = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('iutitle', iutitle, post_me) post_me = add_post('iucontinue', iucontinue, post_me) post_me = add_post('iunamespace', iunamespace, post_me) post_me = add_post('iufilterredir', iufilterredir, post_me) post_me = add_post('iulimit', iulimit, post_me) post_me = add_post('iuredirect', iuredirect, post_me) post_me = add_post('list', 'imageusage', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_logevents(titles = nil, leprop = nil, letype = nil, lestart = nil, leend = nil, ledir = nil, leuser = nil, letitle = nil, lelimit = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 |
# File 'lib/rbmediawiki/api.rb', line 436 def query_list_logevents(titles = nil, leprop = nil, letype = nil, lestart = nil, leend = nil, ledir = nil, leuser = nil, letitle = nil, lelimit = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('leprop', leprop, post_me) post_me = add_post('letype', letype, post_me) post_me = add_post('lestart', lestart, post_me) post_me = add_post('leend', leend, post_me) post_me = add_post('ledir', ledir, post_me) post_me = add_post('leuser', leuser, post_me) post_me = add_post('letitle', letitle, post_me) post_me = add_post('lelimit', lelimit, post_me) post_me = add_post('list', 'logevents', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_protectedtitles(titles = nil, ptnamespace = nil, ptlevel = nil, ptlimit = nil, ptdir = nil, ptstart = nil, ptend = nil, ptprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/rbmediawiki/api.rb', line 176 def query_list_protectedtitles(titles = nil, ptnamespace = nil, ptlevel = nil, ptlimit = nil, ptdir = nil, ptstart = nil, ptend = nil, ptprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('ptnamespace', ptnamespace, post_me) post_me = add_post('ptlevel', ptlevel, post_me) post_me = add_post('ptlimit', ptlimit, post_me) post_me = add_post('ptdir', ptdir, post_me) post_me = add_post('ptstart', ptstart, post_me) post_me = add_post('ptend', ptend, post_me) post_me = add_post('ptprop', ptprop, post_me) post_me = add_post('list', 'protectedtitles', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_random(titles = nil, rnnamespace = nil, rnlimit = nil, rnredirect = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
271 272 273 274 275 276 277 278 279 280 281 |
# File 'lib/rbmediawiki/api.rb', line 271 def query_list_random(titles = nil, rnnamespace = nil, rnlimit = nil, rnredirect = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('rnnamespace', rnnamespace, post_me) post_me = add_post('rnlimit', rnlimit, post_me) post_me = add_post('rnredirect', rnredirect, post_me) post_me = add_post('list', 'random', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_recentchanges(titles = nil, rcstart = nil, rcend = nil, rcdir = nil, rcnamespace = nil, rcprop = nil, rctoken = nil, rcshow = nil, rclimit = nil, rctype = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 |
# File 'lib/rbmediawiki/api.rb', line 523 def query_list_recentchanges(titles = nil, rcstart = nil, rcend = nil, rcdir = nil, rcnamespace = nil, rcprop = nil, rctoken = nil, rcshow = nil, rclimit = nil, rctype = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('rcstart', rcstart, post_me) post_me = add_post('rcend', rcend, post_me) post_me = add_post('rcdir', rcdir, post_me) post_me = add_post('rcnamespace', rcnamespace, post_me) post_me = add_post('rcprop', rcprop, post_me) post_me = add_post('rctoken', rctoken, post_me) post_me = add_post('rcshow', rcshow, post_me) post_me = add_post('rclimit', rclimit, post_me) post_me = add_post('rctype', rctype, post_me) post_me = add_post('list', 'recentchanges', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_search(titles = nil, srsearch = nil, srnamespace = nil, srwhat = nil, srredirects = nil, sroffset = nil, srlimit = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
346 347 348 349 350 351 352 353 354 355 356 357 358 359 |
# File 'lib/rbmediawiki/api.rb', line 346 def query_list_search(titles = nil, srsearch = nil, srnamespace = nil, srwhat = nil, srredirects = nil, sroffset = nil, srlimit = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('srsearch', srsearch, post_me) post_me = add_post('srnamespace', srnamespace, post_me) post_me = add_post('srwhat', srwhat, post_me) post_me = add_post('srredirects', srredirects, post_me) post_me = add_post('sroffset', sroffset, post_me) post_me = add_post('srlimit', srlimit, post_me) post_me = add_post('list', 'search', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_usercontribs(titles = nil, uclimit = nil, ucstart = nil, ucend = nil, uccontinue = nil, ucuser = nil, ucuserprefix = nil, ucdir = nil, ucnamespace = nil, ucprop = nil, ucshow = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 |
# File 'lib/rbmediawiki/api.rb', line 417 def query_list_usercontribs(titles = nil, uclimit = nil, ucstart = nil, ucend = nil, uccontinue = nil, ucuser = nil, ucuserprefix = nil, ucdir = nil, ucnamespace = nil, ucprop = nil, ucshow = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('uclimit', uclimit, post_me) post_me = add_post('ucstart', ucstart, post_me) post_me = add_post('ucend', ucend, post_me) post_me = add_post('uccontinue', uccontinue, post_me) post_me = add_post('ucuser', ucuser, post_me) post_me = add_post('ucuserprefix', ucuserprefix, post_me) post_me = add_post('ucdir', ucdir, post_me) post_me = add_post('ucnamespace', ucnamespace, post_me) post_me = add_post('ucprop', ucprop, post_me) post_me = add_post('ucshow', ucshow, post_me) post_me = add_post('list', 'usercontribs', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_users(titles = nil, usprop = nil, ususers = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
512 513 514 515 516 517 518 519 520 521 |
# File 'lib/rbmediawiki/api.rb', line 512 def query_list_users(titles = nil, usprop = nil, ususers = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('usprop', usprop, post_me) post_me = add_post('ususers', ususers, post_me) post_me = add_post('list', 'users', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_watchlist(titles = nil, wlallrev = nil, wlstart = nil, wlend = nil, wlnamespace = nil, wldir = nil, wllimit = nil, wlprop = nil, wlshow = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 |
# File 'lib/rbmediawiki/api.rb', line 329 def query_list_watchlist(titles = nil, wlallrev = nil, wlstart = nil, wlend = nil, wlnamespace = nil, wldir = nil, wllimit = nil, wlprop = nil, wlshow = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('wlallrev', wlallrev, post_me) post_me = add_post('wlstart', wlstart, post_me) post_me = add_post('wlend', wlend, post_me) post_me = add_post('wlnamespace', wlnamespace, post_me) post_me = add_post('wldir', wldir, post_me) post_me = add_post('wllimit', wllimit, post_me) post_me = add_post('wlprop', wlprop, post_me) post_me = add_post('wlshow', wlshow, post_me) post_me = add_post('list', 'watchlist', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_list_watchlistraw(titles = nil, wrcontinue = nil, wrnamespace = nil, wrlimit = nil, wrprop = nil, wrshow = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
403 404 405 406 407 408 409 410 411 412 413 414 415 |
# File 'lib/rbmediawiki/api.rb', line 403 def query_list_watchlistraw(titles = nil, wrcontinue = nil, wrnamespace = nil, wrlimit = nil, wrprop = nil, wrshow = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('wrcontinue', wrcontinue, post_me) post_me = add_post('wrnamespace', wrnamespace, post_me) post_me = add_post('wrlimit', wrlimit, post_me) post_me = add_post('wrprop', wrprop, post_me) post_me = add_post('wrshow', wrshow, post_me) post_me = add_post('list', 'watchlistraw', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_meta_allmessages(titles = nil, ammessages = nil, amfilter = nil, amlang = nil, amfrom = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/rbmediawiki/api.rb', line 163 def (titles = nil, = nil, amfilter = nil, amlang = nil, amfrom = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('ammessages', , post_me) post_me = add_post('amfilter', amfilter, post_me) post_me = add_post('amlang', amlang, post_me) post_me = add_post('amfrom', amfrom, post_me) post_me = add_post('meta', 'allmessages', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_meta_siteinfo(titles = nil, siprop = nil, sifilteriw = nil, sishowalldb = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/rbmediawiki/api.rb', line 115 def (titles = nil, siprop = nil, sifilteriw = nil, sishowalldb = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('siprop', siprop, post_me) post_me = add_post('sifilteriw', sifilteriw, post_me) post_me = add_post('sishowalldb', sishowalldb, post_me) post_me = add_post('meta', 'siteinfo', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_meta_userinfo(titles = nil, uiprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
261 262 263 264 265 266 267 268 269 |
# File 'lib/rbmediawiki/api.rb', line 261 def (titles = nil, uiprop = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('uiprop', uiprop, post_me) post_me = add_post('meta', 'userinfo', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_prop_categories(titles = nil, clprop = nil, clshow = nil, cllimit = nil, clcontinue = nil, clcategories = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/rbmediawiki/api.rb', line 66 def query_prop_categories(titles = nil, clprop = nil, clshow = nil, cllimit = nil, clcontinue = nil, clcategories = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('clprop', clprop, post_me) post_me = add_post('clshow', clshow, post_me) post_me = add_post('cllimit', cllimit, post_me) post_me = add_post('clcontinue', clcontinue, post_me) post_me = add_post('clcategories', clcategories, post_me) post_me = add_post('prop', 'categories', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_prop_categoryinfo(titles = nil, cicontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
580 581 582 583 584 585 586 587 588 |
# File 'lib/rbmediawiki/api.rb', line 580 def (titles = nil, cicontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('cicontinue', cicontinue, post_me) post_me = add_post('prop', 'categoryinfo', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_prop_duplicatefiles(titles = nil, dflimit = nil, dfcontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
318 319 320 321 322 323 324 325 326 327 |
# File 'lib/rbmediawiki/api.rb', line 318 def query_prop_duplicatefiles(titles = nil, dflimit = nil, dfcontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('dflimit', dflimit, post_me) post_me = add_post('dfcontinue', dfcontinue, post_me) post_me = add_post('prop', 'duplicatefiles', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_prop_extlinks(titles = nil, ellimit = nil, eloffset = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
375 376 377 378 379 380 381 382 383 384 |
# File 'lib/rbmediawiki/api.rb', line 375 def query_prop_extlinks(titles = nil, ellimit = nil, eloffset = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('ellimit', ellimit, post_me) post_me = add_post('eloffset', eloffset, post_me) post_me = add_post('prop', 'extlinks', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_prop_imageinfo(titles = nil, iiprop = nil, iilimit = nil, iistart = nil, iiend = nil, iiurlwidth = nil, iiurlheight = nil, iicontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/rbmediawiki/api.rb', line 212 def query_prop_imageinfo(titles = nil, iiprop = nil, iilimit = nil, iistart = nil, iiend = nil, iiurlwidth = nil, iiurlheight = nil, iicontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('iiprop', iiprop, post_me) post_me = add_post('iilimit', iilimit, post_me) post_me = add_post('iistart', iistart, post_me) post_me = add_post('iiend', iiend, post_me) post_me = add_post('iiurlwidth', iiurlwidth, post_me) post_me = add_post('iiurlheight', iiurlheight, post_me) post_me = add_post('iicontinue', iicontinue, post_me) post_me = add_post('prop', 'imageinfo', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_prop_images(titles = nil, imlimit = nil, imcontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
80 81 82 83 84 85 86 87 88 89 |
# File 'lib/rbmediawiki/api.rb', line 80 def query_prop_images(titles = nil, imlimit = nil, imcontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('imlimit', imlimit, post_me) post_me = add_post('imcontinue', imcontinue, post_me) post_me = add_post('prop', 'images', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_prop_info(titles = nil, inprop = nil, intoken = nil, incontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
500 501 502 503 504 505 506 507 508 509 510 |
# File 'lib/rbmediawiki/api.rb', line 500 def query_prop_info(titles = nil, inprop = nil, intoken = nil, incontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('inprop', inprop, post_me) post_me = add_post('intoken', intoken, post_me) post_me = add_post('incontinue', incontinue, post_me) post_me = add_post('prop', 'info', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_prop_langlinks(titles = nil, lllimit = nil, llcontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
590 591 592 593 594 595 596 597 598 599 |
# File 'lib/rbmediawiki/api.rb', line 590 def query_prop_langlinks(titles = nil, lllimit = nil, llcontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('lllimit', lllimit, post_me) post_me = add_post('llcontinue', llcontinue, post_me) post_me = add_post('prop', 'langlinks', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_prop_links(titles = nil, plnamespace = nil, pllimit = nil, plcontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
568 569 570 571 572 573 574 575 576 577 578 |
# File 'lib/rbmediawiki/api.rb', line 568 def query_prop_links(titles = nil, plnamespace = nil, pllimit = nil, plcontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('plnamespace', plnamespace, post_me) post_me = add_post('pllimit', pllimit, post_me) post_me = add_post('plcontinue', plcontinue, post_me) post_me = add_post('prop', 'links', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_prop_revisions(titles = nil, rvprop = nil, rvlimit = nil, rvstartid = nil, rvendid = nil, rvstart = nil, rvend = nil, rvdir = nil, rvuser = nil, rvexcludeuser = nil, rvexpandtemplates = nil, rvgeneratexml = nil, rvsection = nil, rvtoken = nil, rvcontinue = nil, rvdiffto = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/rbmediawiki/api.rb', line 91 def query_prop_revisions(titles = nil, rvprop = nil, rvlimit = nil, rvstartid = nil, rvendid = nil, rvstart = nil, rvend = nil, rvdir = nil, rvuser = nil, rvexcludeuser = nil, = nil, rvgeneratexml = nil, rvsection = nil, rvtoken = nil, rvcontinue = nil, rvdiffto = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('rvprop', rvprop, post_me) post_me = add_post('rvlimit', rvlimit, post_me) post_me = add_post('rvstartid', rvstartid, post_me) post_me = add_post('rvendid', rvendid, post_me) post_me = add_post('rvstart', rvstart, post_me) post_me = add_post('rvend', rvend, post_me) post_me = add_post('rvdir', rvdir, post_me) post_me = add_post('rvuser', rvuser, post_me) post_me = add_post('rvexcludeuser', rvexcludeuser, post_me) post_me = add_post('rvexpandtemplates', , post_me) post_me = add_post('rvgeneratexml', rvgeneratexml, post_me) post_me = add_post('rvsection', rvsection, post_me) post_me = add_post('rvtoken', rvtoken, post_me) post_me = add_post('rvcontinue', rvcontinue, post_me) post_me = add_post('rvdiffto', rvdiffto, post_me) post_me = add_post('prop', 'revisions', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#query_prop_templates(titles = nil, tlnamespace = nil, tllimit = nil, tlcontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) ⇒ Object
556 557 558 559 560 561 562 563 564 565 566 |
# File 'lib/rbmediawiki/api.rb', line 556 def query_prop_templates(titles = nil, tlnamespace = nil, tllimit = nil, tlcontinue = nil, pageids = nil, revids = nil, redirects = nil, indexpageids = nil, export = nil, exportnowrap = nil, post_me = nil) post_me = add_post('tlnamespace', tlnamespace, post_me) post_me = add_post('tllimit', tllimit, post_me) post_me = add_post('tlcontinue', tlcontinue, post_me) post_me = add_post('prop', 'templates', post_me) post_me = query(post_me, titles, pageids, revids, redirects, indexpageids, export, exportnowrap) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#rollback(title = nil, user = nil, token = nil, summary = nil, markbot = nil, post_me = nil) ⇒ Object
706 707 708 709 710 711 712 713 714 715 716 717 |
# File 'lib/rbmediawiki/api.rb', line 706 def rollback(title = nil, user = nil, token = nil, summary = nil, markbot = nil, post_me = nil) post_me = add_post('title', title, post_me) post_me = add_post('user', user, post_me) post_me = add_post('token', token, post_me) post_me = add_post('summary', summary, post_me) post_me = add_post('markbot', markbot, post_me) post_me = add_post('action', 'rollback', post_me) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#unblock(id = nil, user = nil, token = nil, gettoken = nil, reason = nil, post_me = nil) ⇒ Object
831 832 833 834 835 836 837 838 839 840 841 842 |
# File 'lib/rbmediawiki/api.rb', line 831 def unblock(id = nil, user = nil, token = nil, gettoken = nil, reason = nil, post_me = nil) post_me = add_post('id', id, post_me) post_me = add_post('user', user, post_me) post_me = add_post('token', token, post_me) post_me = add_post('gettoken', gettoken, post_me) post_me = add_post('reason', reason, post_me) post_me = add_post('action', 'unblock', post_me) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#undelete(title = nil, token = nil, reason = nil, timestamps = nil, post_me = nil) ⇒ Object
803 804 805 806 807 808 809 810 811 812 813 |
# File 'lib/rbmediawiki/api.rb', line 803 def undelete(title = nil, token = nil, reason = nil, = nil, post_me = nil) post_me = add_post('title', title, post_me) post_me = add_post('token', token, post_me) post_me = add_post('reason', reason, post_me) post_me = add_post('timestamps', , post_me) post_me = add_post('action', 'undelete', post_me) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |
#watch(title = nil, unwatch = nil, post_me = nil) ⇒ Object
681 682 683 684 685 686 687 688 689 |
# File 'lib/rbmediawiki/api.rb', line 681 def watch(title = nil, unwatch = nil, post_me = nil) post_me = add_post('title', title, post_me) post_me = add_post('unwatch', unwatch, post_me) post_me = add_post('action', 'watch', post_me) post_me = format(post_me, 'xml') result = make_request(post_me) return result end |