{"id":17595267,"url":"https://github.com/ketho/wowpediadoc","last_synced_at":"2025-04-30T06:44:46.866Z","repository":{"id":46617592,"uuid":"254909670","full_name":"Ketho/WowpediaDoc","owner":"Ketho","description":"API documenter for Warcraft Wiki","archived":false,"fork":false,"pushed_at":"2025-04-21T19:42:19.000Z","size":3869,"stargazers_count":11,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-30T06:44:41.020Z","etag":null,"topics":["lua","world-of-warcraft"],"latest_commit_sha":null,"homepage":"https://warcraft.wiki.gg/wiki/World_of_Warcraft_API","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ketho.png","metadata":{"files":{"readme":"README-pywikibot.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"Ketho"}},"created_at":"2020-04-11T16:33:34.000Z","updated_at":"2025-04-21T19:42:23.000Z","dependencies_parsed_at":"2023-11-19T01:26:18.607Z","dependency_job_id":"b2f3bc11-036f-46c2-8667-6d5dc129bf66","html_url":"https://github.com/Ketho/WowpediaDoc","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ketho%2FWowpediaDoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ketho%2FWowpediaDoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ketho%2FWowpediaDoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ketho%2FWowpediaDoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ketho","download_url":"https://codeload.github.com/Ketho/WowpediaDoc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251658196,"owners_count":21622819,"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":["lua","world-of-warcraft"],"created_at":"2024-10-22T07:44:08.905Z","updated_at":"2025-04-30T06:44:46.860Z","avatar_url":"https://github.com/Ketho.png","language":"Lua","funding_links":["https://github.com/sponsors/Ketho"],"categories":[],"sub_categories":[],"readme":"## Pywikibot\n[Pywikibot](https://github.com/wikimedia/pywikibot) is useful for automating tasks on wikis like editing pages.\n\n## Resources\n- https://warcraft.wiki.gg/wiki/Warcraft_Wiki:Wiki_bots\n- https://help.fandom.com/wiki/Bots\n- https://en.wikipedia.org/wiki/Help:Creating_a_bot\n\n## Creating a bot account\nCreate a new user account (e.g. [KethoBot](https://warcraft.wiki.gg/wiki/Special:Contributions/KethoBot)) and request the admins to give it the [bot role](https://warcraft.wiki.gg/wiki/Special:ListUsers?group=bot). Note that you need a certain amount of trust to request a bot account. You can still set up pywikibot but will not be able to edit and create pages without logging in.\n\n### Bot passwords\nPywikibot requires a bot password which can be set in `user-password.py`\n- https://warcraft.wiki.gg/wiki/Special:BotPassword\n- https://www.mediawiki.org/wiki/Manual:Pywikibot/BotPasswords\n\nThere you will also be able to set grants (user rights) for it, like editing and creating pages.\n\n## Setup\nCreate a virtual environment and install pywikibot.\n```sh\nsudo apt install python3-venv\npython3 -m venv .venv\nsource .venv/bin/activate\npip install requests wikitextparser\npip install pywikibot\n```\n\n## Configuration\nI put `user-config.py` and `user-password.py` in the root of the repository and gitignored them but there probably is a more proper way to do this.\n\n### `user-config.py`\n```py\nfamily = 'warcraftwiki'\nmylang = 'en'\nusernames['warcraftwiki']['en'] = 'KethoBot'\npassword_file = \"user-password.py\"\n```\n\n### `user-password.py`\n```py\n('KethoBot', BotPassword('Hatsune', '\u003csnip\u003e'))\n```\n\n### `warcraftwiki_family.py`\nI copied this file to `.venv/lib/python3.12/site-packages/pywikibot/families`\n```py\nfrom pywikibot import family\n\nclass Family(family.FandomFamily):\n    name = 'warcraftwiki'\n    domain = 'warcraft.wiki.gg'\n    codes = {'en'}\n```\n\n## Usage\nTest if it works by printing a page, for example [API_UnitLevel](https://warcraft.wiki.gg/wiki/API_UnitLevel)\n```sh\npython 'Pywikibot/hello-read.py'\n```\n```py\nimport pywikibot\n\nsite = pywikibot.Site(\"en\", \"warcraftwiki\")\npage = pywikibot.Page(site, \"API_UnitName\")\n\nprint(page.text)\n```\n```\n{{wowapi|t=a|system=Unit}}\nReturns the level of the unit.\n level = UnitLevel(unit)\n\n==Arguments==\n:;unit:{{apitype|string}} : [[UnitId]] - For example \u003ccode\u003e\"player\"\u003c/code\u003e or \u003ccode\u003e\"target\"\u003c/code\u003e\n\n==Returns==\n:;level:{{apitype|number}} - The unit level. Returns \u003ccode\u003e-1\u003c/code\u003e for boss units or hostile units 10 levels above the player (Level ??).\n```\n\nLogin and try editing a page, for example https://warcraft.wiki.gg/wiki/Warcraft_Wiki:Sandbox/6\n```sh\npwb login\npython 'Pywikibot/hello-save.py'\n```\n```py\nimport pywikibot\n\nsite = pywikibot.Site(\"en\", \"warcraftwiki\")\npage = pywikibot.Page(site, \"Warcraft_Wiki:Sandbox/6\")\n\npage.text = \"hello pywikibot\"\npage.save(summary = \"Some test\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fketho%2Fwowpediadoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fketho%2Fwowpediadoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fketho%2Fwowpediadoc/lists"}