Skip to content

Instantly share code, notes, and snippets.

View legoktm's full-sized avatar

Kunal Mehta legoktm

View GitHub Profile
@legoktm
legoktm / gist:3108699
Created July 14, 2012 01:27
Bug on team-tracker
km@km-mpb:~/team-tracker$ node index 604 604
km@km-mpb:~/team-tracker$ node index 604 605
604,2012,Sacramento Regional,Engineering Inspiration Award
604,2012,Silicon Valley Regional,FIRST Dean's List Finalist Award
604,2012,Silicon Valley Regional,Regional Chairman's Award
604,2012,Silicon Valley Regional,Woodie Flowers Finalist Award
604,2011,Sacramento Regional,Regional Chairman's Award
604,2011,Sacramento Regional,Woodie Flowers Finalist Award
604,2011,Silicon Valley Regional,Regional Finalists
604,2010,Sacramento Regional,Coopertition Award
@legoktm
legoktm / extract.py
Created September 16, 2012 04:13
extract.py
#!/usr/bin/env python
"""
(C) 2012, Legoktm under the MIT License
"""
import os
import subprocess
root = os.getcwd()
def run():
@legoktm
legoktm / upload_multiple.py
Last active October 12, 2015 14:28
A quick wrapper around upload.py to allow for mass-uploading.
#!/usr/bin/env python
"""
# (C) Rob W.W. Hooft, Andre Engels 2003-2004
# (C) Pywikipedia bot team, 2003-2011
Copyright (C) 2012 Legoktm
Portions of this script are copied from upload.py, which is also released
under the MIT License, which appears below.
Permission is hereby granted, free of charge, to any person obtaining
@legoktm
legoktm / typoscanner.py
Created November 28, 2012 04:59
A script which scans xml dumps for typos
#!/usr/bin/env python
from __future__ import print_function
"""
Copyright (C) 2012 Legoktm with help from SigmaWP and odie5533
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
@legoktm
legoktm / pageviews.py
Created November 29, 2012 05:47
Requested in #wikipedia-en-help, gives the amount of pageviews since January 11, 2010
#!/usr/bin/env python
"""
Copyright (C) 2012 Legoktm
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
@legoktm
legoktm / global_js.py
Created February 23, 2013 06:34
A quick script that automatically creates your /common.js files with your global.js from meta.
#!/usr/bin/env python
"""
Copyright (C) 2013 Legoktm
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
@legoktm
legoktm / revdel.py
Created March 5, 2013 09:54
A script using Pywikipedia's trunk version to screenscrape to mass-revdel edits.
#!/usr/bin/env python
"""
Copyright (C) 2013 Legoktm
Released under MIT License
"""
####CONFIG
filename = 'links.txt'
reason = 'Bad info'
@legoktm
legoktm / fix_hazardbot.py
Created June 2, 2013 06:44
An example mass-rollback script used to fix errors caused by Hazard-Bot
#!/usr/bin/env python
"""
Released into the public domain by Legoktm, 2013
"""
import pywikibot
from pywikibot import config
config.usernames['wikipedia']['en'] = 'Legoktm'
from pywikibot.data import api
@legoktm
legoktm / user-config.py
Created June 21, 2013 01:49
A sample user-config.py that can be used when running unittests and such.
lang = "en"
family = "wikipedia"
usernames['wikipedia']['en'] = u'Legobot'
@legoktm
legoktm / setup.py
Created June 21, 2013 01:53
A fake setup.py for pywikibot
from setuptools import setup, find_packages
setup(name='Pywikipediabot',
version='2.0alpha',
description='Python Wikipedia Bot Framework',
license='MIT',
packages=find_packages(),
install_requires=['httplib2>=0.6.0'],
test_suite="tests",
)