Skip to content
Open
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
15 changes: 15 additions & 0 deletions Number_of_Automated_Edits.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
SELECT
DATE(r.rev_timestamp) AS Edit_Date, -- Extract the date for filtering on the dashboard
COUNT(DISTINCT r.rev_id) AS Automated_Edits -- Count distinct edits to avoid duplicates
FROM
revision AS r
JOIN
actor AS a ON r.rev_actor = a.actor_id -- Join to identify the editor (actor)
JOIN
user_groups AS ug ON a.actor_user = ug.ug_user -- Join to access user group information
WHERE
ug.ug_group = 'bot' -- Filter for edits made only by bots
GROUP BY
Edit_Date -- Group results by date
ORDER BY
Edit_Date; -- Sort the results chronologically
9 changes: 9 additions & 0 deletions Number_of_deleted_pages_and_edits.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
SELECT
DATE(ar_timestamp) AS Deletion_Date, -- Extracts the date for dashboard filtering
COUNT(ar_id) AS deleted_pages -- Counts the number of deleted pages per day
FROM
archive -- Table containing records of deleted pages
GROUP BY
Deletion_Date -- Groups the counts by day
ORDER BY
Deletion_Date; -- Sorts the results by date
15 changes: 15 additions & 0 deletions Number_of_edits_deleted,reverted_or_rollback.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
SELECT
DATE(r.rev_timestamp) AS Edit_Date, -- Extracts the date for dashboard filtering
COUNT(DISTINCT r.rev_id) AS reverted_edits -- Counts the number of unique reverted edits
FROM
revision AS r
JOIN
change_tag AS ct ON r.rev_id = ct.ct_rev_id -- Links revisions to their associated tags
JOIN
change_tag_def AS ctd ON ct.ct_tag_id = ctd.ctd_id -- Gets the name of the tag
WHERE
ctd.ctd_name IN ('mw-reverted', 'mw-rollback', 'mw-undo') -- Filters for specific revert, rollback, and undo tags
GROUP BY
Edit_Date -- Groups the daily counts
ORDER BY
Edit_Date; -- Sorts the results chronologically
503 changes: 503 additions & 0 deletions notebooks/notebook-yeswanth.ipynb

Large diffs are not rendered by default.