Create list of recent contributors of a MediaWiki instance

For one of the wikis I am maintaining, we needed to contact the people who contributed less than “X” days ago. I quickly checked the MediaWiki REST-based API, but I didn’t seem easy or feasible, so I did it in SQL:

select
  u.user_email as email,
  max(r.rev_timestamp) as last_change
from revision r, user u
where
  r.rev_user = u.user_id
  and
  r.rev_timestamp
group by u.user_email;

Import the result in Excel, transform the MediaWiki timestamp to an Excel date, using the following formula:

=DATEVALUE(MID(B2,1,4)&"/"&MID(B2,5,2)&"/"&MID(B2,7,2))

From that point on, it’s trivial to compute the age in days, sort and export.

Advertisements
This entry was posted in Web. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s