Skip to content

Instantly share code, notes, and snippets.

View framawiki's full-sized avatar

framawiki framawiki

View GitHub Profile
@nemobis
nemobis / wiki-scraper.rb
Last active September 13, 2017 21:36 — forked from anonymous/wiki-scraper.rb
Google search scraper to list all results likely to be MediaWiki installations
#!/usr/bin/env ruby
# encoding: utf-8
##################################################################################
# Google search scraper to list all results likely to be MediaWiki installations #
# #
# CC-0, ArchiveTeam/WikiTeam, 2013 #
# #
##################################################################################
require 'rubygems'
@dlebech
dlebech / Gerrit comment formatting
Last active January 17, 2024 10:34
Comment formatting in Gerrit
The documentation for Gerrit when it comes to formatting comments is quite lacking. Here is short list created by trial and error and looking at the source code in:
./gerrit-gwtexpui/src/main/java/com/google/gwtexpui/safehtml/client/SafeHtml.java
Lists:
* List item 1
* List item 2
- List item 1
- List item 2
@zhuyifei1999
zhuyifei1999 / signbot.py
Last active April 15, 2022 14:53
Commons Signbot code
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# DUAL LICENSED: You are free to choose either or both of below licenses:
#
# 1.
#
# Published by zhuyifei1999 (https://wikitech.wikimedia.org/wiki/User:Zhuyifei1999)
# under the terms of Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
# https://creativecommons.org/licenses/by-sa/3.0/
@lokal-profil
lokal-profil / clean_logs.py
Last active August 22, 2018 22:43
Additional cleanup step for analysing WLM logs.
#!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import re
def clean_log(filename):
import codecs
f_in = codecs.open(filename, 'r', 'utf-8')
f_out = codecs.open('{}.clean'.format(filename), 'w', 'utf-8')
bad_warnings = (

This is script for dumping data from old Extension:EducationProgram to wiki, because only SQL dumps were provided (https://dumps.wikimedia.org/other/educationprogram/).

The requirement for running this script is to have: a) ToolForge access b) some templates (with syntax equivalent to the one Outreach Dashboard currently uses, so if you do have editing from the Dasbhaord enabled, you should have the templates); if you don't have such templates, adapt those from cs.wikipedia. If you want to, you can adapt the script to not require a) or b).

Before running, you must firstly adapt the script for your wiki. This means the following:

  1. Adapt line 7 and line 8 to create correct DB connection and site connection
  2. Adapt line 25, line 40, line 53 and line 54 to your template names.
  3. Adapt summary on line 55

After you have customized the script, you can do the following: