Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F32111762
T260393.rb
matmarex (Bartosz Dziewoński)
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Authored By
matmarex
Aug 13 2020, 8:46 PM
2020-08-13 20:46:00 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
T260393.rb
View Options
require
'rest-client'
require
'json'
require
'pp'
sites
=
%w[
en.wikipedia.org
www.mediawiki.org
ar.wikipedia.org
ca.wikipedia.org
ckb.wikipedia.org
cs.wikipedia.org
fr.wikipedia.org
hu.wikipedia.org
ka.wikipedia.org
ko.wikipedia.org
nl.wikipedia.org
sr.wikipedia.org
sv.wikipedia.org
zh.wikipedia.org
]
sites
.
each
do
|
site
|
puts
"Checking
#{
site
}
..."
api
=
"https://
#{
site
}
/w/api.php?"
total
=
0
suspicious
=
0
recentchanges
=
JSON
.
parse
RestClient
.
get
"
#{
api
}
action=query&format=json&list=recentchanges&rctag=discussiontools-reply&rclimit=max"
recentchanges
[
'query'
][
'recentchanges'
].
each
do
|
rc
|
rev
=
rc
[
'revid'
]
compare
=
JSON
.
parse
RestClient
.
get
"
#{
api
}
action=compare&format=json&fromrev=
#{
rev
}
&torelative=prev"
diff
=
compare
[
'compare'
][
'*'
]
rescue
next
if
diff
=~
/diff-deletedline/
suspicious
+=
1
puts
"*
#{
rc
[
'timestamp'
]
}
#{
api
.
sub
'api.php'
,
'index.php'
}
oldid=
#{
rev
}
&diff=prev"
end
total
+=
1
end
puts
"*
#{
site
}
:
#{
suspicious
}
/
#{
total
}
look suspicious"
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8502656
Default Alt Text
T260393.rb (1 KB)
Attached To
Mode
T260393: Review page corruption (dirty diffs) caused by DiscussionTools
Attached
Detach File
Event Timeline
Log In to Comment