A Flask web application that helps manage and process PetScan lists for Wikipedia articles.
- Python 3.x
- pip (Python package installer)
- Wikipedia account with bot password
-
Clone this repository:
git clone https://github.com/MrIbrahem/petscan_list.git cd petscan_list
-
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Linux/Mac # or .\venv\Scripts\activate # On Windows
-
Install the required dependencies:
pip install -r requirements.txt
-
Create a bot password for your Wikipedia account:
- Go to Special:BotPasswords on Wikipedia (https://ar.wikipedia.org/wiki/Special:BotPasswords)
- Create a new bot password with necessary permissions
-
Set up your credentials:
- Create a file
confs/user.ini
with the following content:botusername = "YOUR_USERNAME" botpassword = "YOUR_BOT_PASSWORD"
Replace
YOUR_USERNAME
with your Wikipedia username andYOUR_BOT_PASSWORD
with your bot password. - Create a file
You can run this application in two different ways:
Start the Flask development server:
python app.py
Then open your web browser and navigate to:
http://localhost:5000
The web interface allows you to:
- Process individual Wikipedia articles
- View results directly in your browser
- Interactive usage with immediate feedback
Run the bot script to automatically process multiple pages:
python bot.py
The bot mode:
- Automatically searches for pages with "petscan list" template
- Processes all found pages in batch
- Works specifically with Arabic Wikipedia
- Runs continuously without manual intervention
app.py
- Main Flask web application filebot.py
- Automated bot script for batch processingPetScanList/
- Core functionality modulestemplates/
- HTML templatesstatic/
- Static files (JavaScript, CSS)confs/
- Configuration files including Wikipedia credentials
runall.sh
- Script to run all componentsupdate.sh
- Script for updates
- Navigate to the homepage at
http://localhost:5000
- Enter the Wikipedia article title
- The application will process the PetScan list and display the results
- Make sure your credentials are properly configured
- Run
python bot.py
- The bot will automatically:
- Find pages with "petscan list" template
- Process each page
- Show progress in the terminal
The application runs in debug mode by default when running locally, which provides detailed error messages and automatic reloading when code changes are made.
These parameters are optional:
|_result_=table
: to display the result in wikitable.|_line_format_=
: Table to modify the value format, example:|_line_format_ = # {{user:Mr. Ibrahem/link|$1}}
|output_limit = 3000
: Maximum number of results to display.