Toggle navigation
Home
New Query
Recent Queries
Discuss
Database tables
Database names
MediaWiki
Wikibase
Replicas browser and optimizer
Login
History
Fork
This query is marked as a draft
This query has been published
by
MrJaroslavik
.
Toggle Highlighting
SQL
/* blockeduserrights.py SLOW_OK */ SELECT user_name, ug_group, ipb_by_text, ipb_expiry, ipb_reason FROM user JOIN ipblocks ON user_id = ipb_user JOIN user_groups ON user_id = ug_user; ''') i = 1 output = [] for row in cursor.fetchall(): user_name = u'[[User:%s|]]' % unicode(row[0], 'utf-8') user_groups = u'%s' % unicode(row[1], 'utf-8') ipb_by_text = u'[[User talk:%s|]]' % unicode(row[2], 'utf-8') ipb_expiry = u'%s' % unicode(row[3], 'utf-8') ipb_reason = u'%s' % unicode(row[4], 'utf-8') table_row = u'''| %d | %s | %s | %s | %s | %s |-''' % (i, user_name, user_groups, ipb_by_text, ipb_expiry, ipb_reason) output.append(table_row) i += 1 cursor.execute('SELECT UNIX_TIMESTAMP() - UNIX_TIMESTAMP(rc_timestamp) FROM recentchanges ORDER BY rc_timestamp DESC LIMIT 1;') rep_lag = cursor.fetchone()[0] current_of = (datetime.datetime.utcnow() - datetime.timedelta(seconds=rep_lag)).strftime('%H:%M, %d %B %Y (UTC)') report = wikitools.Page(wiki, report_title) report_text = report_template % (current_of, '\n'.join(output)) report_text = report_text.encode('utf-8') report.edit(report_text, summary=settings.editsumm, bot=1) cursor.close() conn.close()
By running queries you agree to the
Cloud Services Terms of Use
and you irrevocably agree to release your SQL under
CC0 License
.
Submit Query
Stop Query
All SQL code is licensed under
CC0 License
.
Checking query status...