In [1]:
library(data.table)
library(ggplot2)
dt = data.table(read.table("../../datasets/reverted_bot2bot/enwiki_20170420.tsv.bz2", sep="\t", header=T, quote="",
comment.char=""))
dt$rev_ts = as.POSIXct(format(dt$rev_timestamp, scientific=F), format="%Y%m%d%H%M%S")
dt$rev_month = as.Date(paste(format(dt$rev_ts, "%Y-%m-"), "01", sep=""))
dt$rev_day = as.Date(dt$rev_ts)
dt$reverting_ts = as.POSIXct(format(dt$reverting_timestamp, scientific=F), format="%Y%m%d%H%M%S")
dt$reverting_month = as.Date(paste(format(dt$reverting_ts, "%Y-%m-"), "01", sep=""))
dt$reverting_day = as.Date(dt$reverting_ts)
This is a list of page_id
values for all redirects to Japan–United_States_relations
, retreived with this query from Quarry: https://quarry.wmflabs.org/query/18187
In [2]:
# From https://quarry.wmflabs.org/query/18187
redirect_pages = c(2991127,
2991195,
2991200,
2991205,
2991208,
2991211,
2994450,
3080753,
13148847,
15333324,
18313488,
18322006,
27530926,
28734823,
28734827,
28734832,
28734842,
28734845,
32089263,
32157222,
33089039,
33445966,
33681103,
36233196,
36233198,
36233202,
36233203,
36233205,
36233208,
36233209,
36233210,
36233212,
36233213,
36233215,
36233216,
36233221,
36233222,
36233223,
36233225,
36233226,
49828376,
50552336,
50754668,
51337448,
51998441,
51999533,
52320520)
Fill out the metadata for each revert on these pages between DarknessBot and Xqbot, get the reverting comment
In [3]:
fight_reverts = dt[
rev_page %in% redirect_pages &
rev_user_text %in% c("DarknessBot", "Xqbot") &
reverting_user_text %in% c("DarknessBot", "Xqbot"),]
fight_reverts[
order(fight_reverts$reverting_day),
list(rev_page, rev_user_text, reverting_user_text, reverting_day, reverting_comment),]
Summarize:
In [4]:
fight_reverts[
order(fight_reverts$reverting_day),
list(reverts=length(rev_page)),
list(reverting_day, reverting_user_text, rev_user_text, reverting_comment)]
In [ ]: