-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #265 from LokasWiki/statistics_v2.3.3
add list_of_wikipedians_by_number_of_files_uploaded.py
- Loading branch information
Showing
3 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
tasks/statistics/list_of_wikipedians_by_number_of_files_uploaded.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from tasks.statistics.module import UpdatePage, ArticleTables, index | ||
|
||
# Set the parameters for the update | ||
query = """select count(log_id) as "count_of_uploads", actor_name | ||
from logging_userindex | ||
inner join actor on actor_id = logging_userindex.log_actor | ||
where log_type like "upload" | ||
GROUP BY log_actor | ||
order by count(log_id) desc | ||
limit 500;""" | ||
file_path = 'stub/list_of_wikipedians_by_number_of_files_uploaded.txt' | ||
page_name = "ويكيبيديا:قائمة الويكيبيديين حسب عدد الملفات المرفوعة" | ||
|
||
|
||
def username(row, result, index): | ||
user_name = str(row['actor_name'], 'utf-8') | ||
name = user_name.replace("__", "[LOKA]").replace("_", " ").replace("[LOKA]", "_") | ||
return "[[مستخدم:" + user_name + "|" + name + "]]" | ||
|
||
|
||
columns = [ | ||
("الرقم", None, index), | ||
("المستخدم", None, username), | ||
("عدد الملفات المرفوعة", "count_of_uploads"), | ||
] | ||
|
||
|
||
def main(*args: str) -> int: | ||
# Create an instance of the ArticleTables class | ||
tables = ArticleTables() | ||
tables.add_table("main_table", columns) | ||
|
||
# Create an instance of the updater and update the page | ||
updater = UpdatePage(query, file_path, page_name, tables) | ||
updater.update() | ||
return 0 | ||
|
||
|
||
if __name__ == "__main__": | ||
raise SystemExit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
tasks/statistics/stub/list_of_wikipedians_by_number_of_files_uploaded.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div style="background: #E5E4E2; padding: 0.5em; font-family: Traditional Arabic; font-size: 130%; -moz-border-radius: 0.3em; border-radius: 0.3em;"> | ||
<center> | ||
تعرض هذه الصفحة قائمة الـ500 [[ويكيبيديا:ويكيبيديون|ويكيبيدي]] الأوائل حسب عدد الملفات المرفوعة محليًا (مع احتساب [[ويكيبيديا:بوت|البوتات]]). | ||
<br /> | ||
'''حَدَّث BOT_USER_NAME هذه القائمة في : BOT_TIME_NOW (ت ع م) ''' | ||
</center> | ||
</div> | ||
<center> | ||
<div style="background: #E5E4E2; padding: 0.5em; -moz-border-radius: 0.3em; border-radius: 0.3em;"> | ||
BOT_TABLE_BODY | ||
</div> | ||
</center> | ||
|
||
[[تصنيف:إحصاءات ويكيبيديا]] | ||
[[تصنيف:ويكيبيديا قائمة الويكيبيديين حسب عدد التعديلات]] | ||
[[تصنيف:إحصاءات يحدثها LokasBot]] |