Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F32351846
T262970.rb
matmarex (Bartosz Dziewoński)
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
matmarex
Sep 15 2020, 7:40 PM
2020-09-15 19:40:59 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
T262970.rb
View Options
require
'rest-client'
require
'cgi'
require
'json'
require
'pp'
sites
=
%w[
de.wikipedia.org
]
len
=
sites
.
map
{
|
a
|
a
.
length
}
.
max
puts
'| Username | Promoted | Blocked'
sites
.
each
do
|
site
|
api
=
"https://
#{
site
}
/w/api.php?"
resp
=
JSON
.
parse
RestClient
.
get
"
#{
api
}
action=query&format=json&list=logevents&letype=rights&leaction=rights%2Fautopromote&lelimit=100"
events
=
resp
[
'query'
][
'logevents'
].
select
{
|
a
|
addedgroups
=
a
[
'params'
][
'newgroups'
]
-
a
[
'params'
][
'oldgroups'
]
(
%w[autoreview editor]
&
addedgroups
)
.
length
>
0
}
events
.
each
do
|
e
|
promote_date
=
e
[
'timestamp'
]
username
=
e
[
'title'
]
resp
=
JSON
.
parse
RestClient
.
get
"
#{
api
}
action=query&format=json&list=logevents&letype=block&leaction=block%2Fblock&letitle=
#{
CGI
.
escape
username
}
&lelimit=max"
events
=
resp
[
'query'
][
'logevents'
].
select
{
|
a
|
a
[
'timestamp'
]
<
promote_date
}
block_date
=
events
[
0
]
?
events
[
0
][
'timestamp'
]
:
'-'
puts
"|
#{
username
.
ljust
40
}
|
#{
promote_date
}
|
#{
block_date
}
"
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
8569795
Default Alt Text
T262970.rb (1 KB)
Attached To
Mode
T262970: FlaggedRevs doesn't check the 'neverBlocked' / APCOND_FR_NEVERBLOCKED option when autopromoting
Attached
Detach File
Event Timeline
Log In to Comment