Recommend this page to a friend! |
Classes of Arash Soleimani | PHP Wikipedia API | README.md | Download |
|
DownloadLM Wikipedia botLM Wikipedia bot is a PHP class to create, edit and search articles on Wikipedia DocumentationInstallationInclude wikibot class:
You just need a username and password for edit action. if you want to use search or get recent changes just set your local URL:
For add/edit or patrol you should do this:
SearchPerform a full text search Simple:
Advanced:
Parameters: |Name|Description|Values|Default| |-----------|------------------------|-------------------------------------|-------| |namespace|Search only within these namespaces| Namespace numbers separate with \| |0| |limit|How many total pages to return|The value must be between 1 and 500|10| |offset|When more results are available, use this to continue|-|0 |sort|Set the sort order of returned results|create_timestamp_asc, create_timestamp_desc, incoming_links_asc, incoming_links_desc, just_match, last_edit_asc, last_edit_desc, none, random, relevance|relevance| |prefix|Perform a prefix search for page titles|true or false|false| Recent ChangesList all the recent changes to the wiki, in the same manner as Special:RecentChanges lists them Simple:
Advanced:
Parameters: |Name|Description|Values|Default| |-----------|------------------------|-------------------------------------|-------| |namespace|Search only within these namespaces| Namespace numbers separate with \| |0| |limit|How many total changes to return|The value must be between 1 and 500|10| |user|Only list changes by this user| user name, IP or user ID (e.g. #12345)|null| |order|In which direction to enumerate|newer, older|older| |type|Show only items that meet these criteria. For example: minor edits done by logged-in users|!anon, !autopatrolled, !bot, !minor, !patrolled, !redirect, anon, autopatrolled, bot, minor, patrolled, redirect, unpatrolled - separate with \| | null| ContentGet the original wikitext content of a page:
Get parsed HTML content of a page:
Add/EditCreate and edit pages Simple Edit/Create:
Advanced sample:
Parameters: |Name|Description|Values|Default| |-----------|------------------------|-------------------------------------|-------| |title|Title of the page to edit. Cannot be used together with pageid|-|-| |pageid|Page ID of the page to edit. Cannot be used together with title|-|-| |summary|Edit summary|-|section title when section=new and sectiontitle is not set| |section|Section number. 0 for the top section, new for a new section|-|-| |sectiontitle|The title for a new section|-|-| |text|Page content|-|-| |appendtext|Add this text to the end of the page. Overrides text|Use section=new to append a new section, rather than this parameter|-| |prependtext|Add this text to the beginning of the page. Overrides text|-|-| |createonly|Don't edit the page if it exists already|true or false|false| |recreate|Override any errors about the page having been deleted in the meantime|true or false|false| |undo|Undo this revision. Overrides text, prependtext and appendtext|The value must be no less than 0|-| |undoafter|Undo all revisions from undo to this one. If not set, just undo one revision|The value must be no less than 0|-| |redirect|Automatically resolve redirects|true or false|false| |