Before running the scripts, you must install the following dependencies:
apt install python3-dev python3-pip python3-wheel pipx -y
pipx install pywikibot
pipx inject pywikibot sqlalchemy
pipx inject pywikibot pymysql
pipx inject pywikibot requests
pipx inject pywikibot mwparserfromhell
pipx ensurepath
Then, create a user-password.py file in the current directory containing
the following, replacing <username>, <botname>, and <botpassword>
as appropriate:
('<username>', BotPassword('<botname>', '<botpassword>'))
Set the following environment variables:
WIKIAPIARY_DB_USERNAME
WIKIAPIARY_DB_PASSWORD
WIKIAPIARY_DB_HOST
WIKIAPIARY_DB_PORT
WIKIAPIARY_DB_SCHEMA
WIKIAPIARY_USERNAME
WIKIAPIARY_URL
The scripts are run using pwb. You must first pwb login.
create_pages_from_filereads the file urls.txt in the current directory; the file has one URL per line; it creates corresponding pages in the wikisync_pages_to_dbcreates Wiki records in the database corresponding to the pages that were created in the wikiscrapescrapes the data for every row in Wikis and stores the data in the databasetruncate_logtruncates the log to the last 1000 entries