Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tasks/statistics/WikiProject/list_of_contributors.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
query = """select actor_name as "username", count(rev_actor) as "edit_count",
IF(actor_name in (

select replace(pl_title,"_"," ") from pagelinks
select replace(lt_title,"_"," ") from pagelinks
join page on page.page_id = pagelinks.pl_from
inner join linktarget ON lt_id = pl_target_id
where page.page_namespace in (4)
and page_title like "مشروع_ويكي_العراق/المساهمون"
and pl_namespace in (2)
and lt_namespace in (2)
and pl_from_namespace in (4)

), "YES", "NO") as "in_WikiProject"
Expand Down
39 changes: 27 additions & 12 deletions tasks/statistics/articles_in_which_there_is_a_link_to_user_pages.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
from tasks.statistics.module import UpdatePage, ArticleTables, index

# Set the parameters for the update
query = """select page.page_title as ll_page_title,pagelinks.pl_title as ll_page_to_title,pagelinks.pl_namespace as ll_pl_namespace
from page
inner join pagelinks
on pagelinks.pl_from = page.page_id
where pagelinks.pl_from_namespace = 0
and (pagelinks.pl_namespace = 2 or pagelinks.pl_namespace = 3)
and page.page_namespace = 0
and page.page_is_redirect = 0
and page.page_id not in (select templatelinks.tl_from from templatelinks
join linktarget on linktarget.lt_id = templatelinks.tl_target_id
where linktarget.lt_title in (select pl_title from pagelinks where pl_from = 9043549) and templatelinks.tl_from_namespace = 0 )
and page.page_title not in (select pl_title from pagelinks where pl_from = 9043549);"""
query = """SELECT page.page_title AS ll_page_title,
linktarget.lt_title AS ll_page_to_title,
linktarget.lt_namespace AS ll_pl_namespace
FROM page
INNER JOIN pagelinks ON pagelinks.pl_from = page.page_id
inner join linktarget ON lt_id = pl_target_id
WHERE pagelinks.pl_from_namespace = 0
AND (linktarget.lt_namespace = 2
OR linktarget.lt_namespace = 3)
AND page.page_namespace = 0
AND page.page_is_redirect = 0
AND page.page_id not in
(SELECT templatelinks.tl_from
FROM templatelinks
JOIN linktarget ON linktarget.lt_id = templatelinks.tl_target_id
WHERE linktarget.lt_title in
(SELECT lt_title
FROM pagelinks
inner join linktarget ON lt_id = pl_target_id
WHERE pl_from = 9043549)
AND templatelinks.tl_from_namespace = 0 )
AND page.page_title not in
(SELECT lt_title
FROM pagelinks
inner join linktarget ON lt_id = pl_target_id
WHERE pl_from = 9043549
);"""
file_path = 'stub/articles_in_which_there_is_a_link_to_user_pages.txt'
page_name = "ويكيبيديا:تقارير قاعدة البيانات/مقالات يوجد فيها وصلة إلى صفحات المستخدمين"

Expand Down
6 changes: 5 additions & 1 deletion tasks/statistics/list_of_portals_by_number_of_articles.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

# Set the parameters for the update
query = """SELECT main.page_title as portal_name, COUNT(*) - 1 as sub_page_count,
(SELECT COUNT(*) FROM pagelinks WHERE pl_title = main.page_title and pl_from_namespace = 0 and pl_namespace = 100) as links_count
(
SELECT COUNT(*) FROM pagelinks
inner join linktarget ON lt_id = pl_target_id
WHERE lt_title = main.page_title and pl_from_namespace = 0 and lt_namespace = 100
) as links_count
FROM page AS p
INNER JOIN (
SELECT page_title
Expand Down