This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def piechart(data, labels=None, colors=None, size='600x400'): | |
'''Accepts a list to graph. Optionally accepts labels and colors. Both optional arguments | |
must have the same len as the data.''' | |
baseurl = 'https://chart.googleapis.com/chart?cht=p' | |
chs = 'chs={}'.format(size) | |
chd = 'chd=t:{}'.format(','.join([str(i) for i in data])) | |
chds = 'chds=0,{}'.format(sum(data)) | |
if labels: | |
chl = 'chl={}'.format('|'.join( | |
['{}: {}'.format(y, data[x]) for x,y in enumerate(labels)])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env python3 | |
import json, signal, sys, time | |
import urllib.request | |
from urllib.parse import urlencode | |
import http.cookiejar | |
def sigint_handler(signal, frame): | |
'''Handles ^c''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo "Determining OS..." | |
if [[ "$(uname -s)" == "Linux" ]]; then | |
mcdir="$HOME/.minecraft/" | |
downloader="wget --no-check-certificate -q -O" | |
os="linux" | |
natives="libjinput-linux libjinput-linux64 liblwjgl liblwjgl64 libopenal libopenal64" | |
elif [[ "$(uname -s)" == "Darwin" ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import json | |
import urllib.request | |
import time | |
import re | |
import sys | |
class Grabber: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ids (t, d): | |
for i in d.keys(): | |
if re.match(r'^{}$'.format(t), i, re.I): | |
return d[i] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def screenshotFilter(poi): | |
'''This looks for signs that have their first line in the 'Image:<id>' format, where <id> is an | |
id from an Imgur.com image.''' | |
if poi['id'] == 'Sign': | |
if poi['Text1'].startswith('Image:'): | |
poi['icon'] = "painting_icon.png" | |
image_html = "<style>.infoWindow img[src='{icon}'] {{display: none}}</style><a href='http://imgur.com/{id}'><img src='http://imgur.com/{id}s.jpg' /></a>".format(icon=poi['icon'], id=poi['Text1'][6:]) | |
return "\n".join([image_html, poi['Text2'], poi['Text3'], poi['Text4']]) | |
def playerFilter(poi): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin env python3 | |
import json | |
import urllib.request | |
import time | |
import sys | |
import signal | |
from urllib.parse import urlencode | |
import http.cookiejar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin env python3 | |
import re | |
import json | |
import os | |
import sys | |
import time | |
import signal | |
import urllib.request | |
opener = urllib.request.build_opener() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin env python3 | |
import json | |
import urllib.request | |
import time | |
import sys | |
import signal | |
from urllib.parse import urlencode | |
import http.cookiejar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# | |
# moderator-bot.py | |
# | |
# Copyright 2012 Zach McCullough <[email protected]> | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or |
OlderNewer