Arabic Wikimedia Technical Community/Projects

From mediawiki.org

Software developed by the community![edit]

  1. wikipediaapi - JavaScript
  2. WikiPH - Java
  3. Wikipedia appearance - JavaScript
  4. Repair Wikipedia - Python
  5. Wikipedia addition - Shell
  6. Tracking texts in Wikipedia - Python
  7. Development of search visibility Wikipedia - Java
  8. gitignore - Python
  9. Artificial intelligence operating data - Python
  10. Copyright check - Go
  11. Processing Wikidata elements through artificial intelligence - Python.
  12. Processing of Wikidata dictionaries - Python.
  13. Firewall-AI-technology - CSS.
  14. Convert a Wikipedia article into a short video - Python.

Tools to improve appearance and editing in Wikipedia![edit]

  • MouseHoverWikiMarker (Java): I developed a tool for Wikipedia that automatically encircles copied text when hovered over with the mouse. Its functionality extends to marking occurrences of programming errors or inaccuracies within references by placing a circle around them.

Develop and create a mechanism to protect users[edit]

Developing an automatic logout code from Wikipedia in case the account is opened twice at the same time and from different devices.

The system was tested on the Arabic language - by developing an experimental interface and applying the code to the system.

import wikipedia
import time
import datetime

# تعريف دالة تسجيل الخروج
def logout_wikipedia(username, password):
    # تسجيل الدخول
    try:
        wikipedia.login(username, password)
    except wikipedia.exceptions.WikipediaException as e:
        print(f"خطأ في تسجيل الدخول: {e}")
        return

    # الحصول على جلسات المستخدم
    sessions = wikipedia.user_info(username)["sessions"]

    # التحقق من وجود جلسات نشطة
    if len(sessions) > 1:
        # الحصول على معلومات الجهاز الحالي
        current_device_info = get_device_info()

        # تسجيل الخروج من جميع الجلسات باستثناء الجلسة الحالية
        for session in sessions:
            if session["device_info"] != current_device_info:
                wikipedia.logout(session["sessionid"])

    # تسجيل الخروج من الجلسة الحالية
    wikipedia.logout()

# تعريف دالة الحصول على معلومات الجهاز
def get_device_info():
    return {
        "ip_address": requests.get("https://api.ipify.org").text,
        "user_agent": requests.get("https://httpbin.org/user-agent").json()["user-agent"],
        "os": platform.system(),
        "browser": platform.browser(),
    }

# تعريف اسم المستخدم وكلمة المرور
username = "YOUR_USERNAME"
password = "YOUR_PASSWORD"

# بدء عملية تسجيل الخروج
logout_wikipedia(username, password)

# رسالة تأكيد
print("تم تسجيل الخروج بنجاح من جميع جلسات ويكيبيديا النشطة.")

verification code[edit]

import random
import time
import datetime

# تعريف دالة إرسال رمز التحقق
def send_verification_code(email, phone_number):
    # إنشاء رمز عشوائي
    verification_code = random.randint(100000, 999999)

    # إرسال الرمز عبر البريد الإلكتروني
    if email:
        send_email(email, verification_code)

    # إرسال الرمز عبر الرسائل النصية
    if phone_number:
        send_sms(phone_number, verification_code)

    # تخزين الرمز في قاعدة البيانات
    # ...

    return verification_code

# تعريف دالة التحقق من رمز التحقق
def verify_verification_code(verification_code):
    # استرجاع الرمز من قاعدة البيانات
    # ...

    # التحقق من صحة الرمز
    if verification_code == stored_verification_code:
        return True

    return False

# تعريف دالة تسجيل الدخول
def login(username, password, verification_code):
    # التحقق من صحة اسم المستخدم وكلمة المرور
    # ...

    # التحقق من صحة رمز التحقق
    if not verify_verification_code(verification_code):
        return False

    # تسجيل الدخول
    # ...

    return True

# تعريف دالة إرسال البريد الإلكتروني
def send_email(email, verification_code):
    # ...

# تعريف دالة إرسال الرسائل النصية
def send_sms(phone_number, verification_code):
    # ...

# تعريف مدة صلاحية الرمز (بالثواني)
VERIFICATION_CODE_EXPIRATION_TIME = 300

# بدء عملية تسجيل الدخول
email = "YOUR_EMAIL"
phone_number = "YOUR_PHONE_NUMBER"

# إرسال رمز التحقق
verification_code = send_verification_code(email, phone_number)

# طلب إدخال رمز التحقق من المستخدم
user_verification_code = input("أدخل رمز التحقق: ")

# التحقق من صحة رمز التحقق وتسجيل الدخول
if login(username, password, user_verification_code):
    print("تم تسجيل الدخول بنجاح!")
else:
    print("رمز التحقق غير صحيح.")