{"id":16820290,"url":"https://github.com/dvandersluis/wikibot","last_synced_at":"2025-04-11T03:08:35.830Z","repository":{"id":532076,"uuid":"161126","full_name":"dvandersluis/wikibot","owner":"dvandersluis","description":"Ruby framework for MediaWiki bots","archived":false,"fork":false,"pushed_at":"2016-10-19T14:27:42.000Z","size":37,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T03:08:31.247Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dvandersluis.png","metadata":{"files":{"readme":"README.textile","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-03-27T18:15:09.000Z","updated_at":"2019-08-13T14:12:55.000Z","dependencies_parsed_at":"2022-07-07T15:19:55.402Z","dependency_job_id":null,"html_url":"https://github.com/dvandersluis/wikibot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvandersluis%2Fwikibot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvandersluis%2Fwikibot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvandersluis%2Fwikibot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvandersluis%2Fwikibot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dvandersluis","download_url":"https://codeload.github.com/dvandersluis/wikibot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248333604,"owners_count":21086200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T10:56:10.417Z","updated_at":"2025-04-11T03:08:35.815Z","avatar_url":"https://github.com/dvandersluis.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"h1=(). WikiBot\n\nh2. About\n\nWikiBot was originally a PHP-based framework for bots I run on Wikipedia, however when it broke due to changes in mediawiki code, I decided to rewrite it in Ruby, using the MediaWiki API instead of screen-scraping. This is the result.\n\nBy default, the bot uses the English Wikipedia. A different instance of MediaWiki can be used by specifying the @:api@ key when instantiating the class.\n\nThe bot is not yet fully-featured, in that it doesn't abstract every possible MediaWiki API feature. However, unsupported queries can be constructed and will return a Hash based on the result XML (see Examples).\n\nh2. Installation\n\nWikiBot is now a gem on rubygems, so installation is as simple as\n\nbc. gem install wikibot\n\nIf you want to install manually, the following gem dependencies are required:\n\n* \"curb\":curb \u003e= 0.5.4.0 (the taf2-curb gem can be used as well)\n* \"xml-simple\":xml \u003e= 1.0.12\n* \"deep_merge\":dm \u003e= 0.1.0\n* \"andand\":aa \u003e= 1.3.1\n\nh2. Usage\n\nbc. wb = WikiBot::Bot.new( \"username\", \"password\", { options } )\n\nWhen initializing a new WikiBot, the following options are available:\n\n* @autologin@ (default: false) - specifies if the bot should log into the mediawiki automatically. @WikiBot::Bot#login@ can be used to login otherwise.\n* @api@ (default: @http://en.wikipedia.org/w/api.php@) - the URL of the API to use\n* @readonly@ (default: false) - if true, the bot will not perform any write operation\n* @debug@ (default: false) - outputs Curb debug messages\n\nLogging in is not required for queries that use @GET@, but is for queries that use @POST@.\n\nh2. Examples\n\nh3. Grabbing the text of a page \n\nbc. wb = WikiBot::Bot.new(\"username\", \"password\")\npage = wb.page(\"Main Page\")\ntext = page.text\n\nh3. Setting up some options\n\nbc. wb = WikiBot::Bot.new(\"username\", \"password\", :autologin =\u003e true, :api =\u003e \"http://fr.wikipedia.org/w/api.php\")\n\nh3. Performing an unsupported query\n\n@WikiBot::Bot#query_api@ can be used to send an arbitrary query to the API. For this example, we'll get image info from the Main Page.\n\nbc. wb = WikiBot::Bot.new(\"username\", \"password\", :autologin =\u003e true)\nquery_data = {\n  :action =\u003e :query,\n  :prop   =\u003e :images,\n  :titles =\u003e \"Main Page\"\n}\nxml_hash = wb.query_api(:get, query_data)\n\n[curb]http://rubygems.org/gems/curb\n[xml]http://rubygems.org/gems/xml-simple\n[dm]http://rubygems.org/gems/deep_merge\n[aa]http://rubygems.org/gems/andand\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvandersluis%2Fwikibot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdvandersluis%2Fwikibot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvandersluis%2Fwikibot/lists"}