Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ويكيبيديا:تقارير قاعدة البيانات/القوالب غير الموجودة حسب عدد وصلات اللغات/en #390

Open
loka1 opened this issue Oct 5, 2024 · 0 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@loka1
Copy link
Member

loka1 commented Oct 5, 2024

Task Description:
The task is to update the list of missing templates on Wikipedia based on the database report. The main steps are as follows:

  1. Fetch a list containing more than 1000 templates from the database.
  2. Use Pywikibot to check the existence of each template on Arabic Wikipedia:
    • Each template in the list is checked to see if it already exists on Wikipedia.
    • Existing templates are excluded from the report.
  3. After checking, only 1000 non-existing templates will be displayed in the final report.

Example code for verification:

import pywikibot

# Set up the Wikipedia site
site = pywikibot.Site('ar', 'wikipedia')

def check_template_existence(template_name):
    """Check if a template exists on Wikipedia."""
    template_page = pywikibot.Page(site, f"Template:{template_name}")
    return template_page.exists()

# List of templates to check
template_list = ["Template1", "Template2", "Template3"]
non_existing_templates = []

for template in template_list:
    if not check_template_existence(template):
        non_existing_templates.append(template)

# Display non-existing templates
print("Non-existing templates:", non_existing_templates)

Additional Notes:

  • Data must first be fetched from the database and then checked using Pywikibot.
  • The final list is limited to displaying 1000 non-existing templates only.
@loka1 loka1 self-assigned this Oct 5, 2024
@loka1 loka1 converted this from a draft issue Oct 5, 2024
@loka1 loka1 added bug Something isn't working enhancement New feature or request labels Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
Status: In Progress
Development

No branches or pull requests

1 participant