Skip to content

Instantly share code, notes, and snippets.

# Terraria data ID lookup library
# Copyright 2013 Steven Smith (blha303). All Rights Reserved.
# New BSD license
# http://www.opensource.org/licenses/BSD-3-Clause
import difflib
items = {"Iron Pickaxe": "1", "Dirt Block": "2", "Stone Block": "3", "Iron Broadsword": "4", "Mushroom": "5", "Iron Shortsword": "6", "Iron Hammer": "7", "Torch": "8", "Wood": "9", "Iron Axe": "10", "Iron Ore": "11", "Copper Ore": "12", "Gold Ore": "13", "Silver Ore": "14", "Copper Watch": "15", "Silver Watch": "16", "Gold Watch": "17", "Depth Meter": "18", "Gold Bar": "19", "Copper Bar": "20", "Silver Bar": "21", "Iron Bar": "22", "Gel": "23", "Wooden Sword": "24", "Wooden Door": "25", "Stone Wall": "26", "Acorn": "27", "Lesser Healing Potion": "28", "Life Crystal": "29", "Dirt Wall": "30", "Bottle": "31", "Wooden Table": "32", "Furnace": "33", "Wooden Chair": "34", "Iron Anvil": "35", "Work Bench": "36", "Goggles": "37", "Lens": "38", "Wooden Bow": "39", "Wooden Arrow": "40", "Flaming Arrow": "41", "Shuriken": "42", "Suspicious L
@blha303
blha303 / mediacrush.py
Last active December 21, 2015 02:59
mediacru.sh API Python wrapper
# MIT license
# Created by Steven Smith (blha303) 2013
# r5: Return url if upload(blah, geturl=True)
# r4: Turns out I don't need cookielib.
# r3: Remove unneeded base64 import
# r2: Fixed file upload support, added __name__ == "__main__" section for easy testing or usage from other languages (?)
# r1: Initial. all functionality in place
import urllib2, urllib
@blha303
blha303 / rssfeedrewrite.py
Created August 5, 2013 19:51
RSS feed rewriter
# RSS feed rewriter
# For adding more content from the target page that isn't included normally
# For an example output, compare
# http://www.escapistmagazine.com/rss/videos/list/1.xml
# and
# http://irc.lazle.co/xml/zeropunctuation.xml
# I added Escapist's embed code loaded from their site in the item description.
# A maybe better example is
# http://www.escapistmagazine.com/rss/articles/columns/extra-punctuation.xml
# and
@blha303
blha303 / raptr.py
Last active December 20, 2015 14:29
Raptr last-played lookup
# Raptr last-played info retriever
# For use with CloudBot (http://git.io/cbgit), although it'll also work as a Python module
# (from raptr import raptr; print raptr("blha303");)
# (after removing the 'from util' and '@hook.command' lines, and switching lines 19 and 20)
#
# This file (raptr.py) created by Steven Smith (blha303) 2013
# GPLv3 license (because CloudBot is GPL)
# http://opensource.org/licenses/GPL-3.0
#
# For a working example of this, join irc.esper.net #xD and ask blha303 for a demonstration of raptr.py
@blha303
blha303 / multicraft.py
Last active December 20, 2015 08:49
Multicraft Python Cloudbot plugin
# For use with CloudBot (http://git.io/cbgit), although it'll also work as a Python module
# ('import multicraft; data = multicraft.multicraft("METHOD PARAM=VALUE")')
# Full API documentation coming soon (better than Multicraft's PHP-specific documentation, I'm hoping)
# This file (multicraft.py) created by Steven Smith (blha303) 2013
# GPLv3 license (because CloudBot is GPL)
# http://opensource.org/licenses/GPL-3.0
# Updated to use hashlib instead of calling an external website for md5 hashing
# For a working example of this, join irc.esper.net #xD and ask blha303 for a demonstration of multicraft.py
@blha303
blha303 / jtvrtmp.py
Last active December 19, 2015 22:58
#!/usr/bin/env python2
# rtmpdump parameter generator for justin.tv/twitch.tv streams v6
# * Usage: jtvrtmp.py channelname [quality]
# where channelname is the channel name ([twitch/justin].tv/channelname)
# and quality is an optional parameter with a valid quality setting
# (360p, 480p, 720p, etc) If quality isn't present, it selects 'live'.
# * if quality is 'live', it picks the quality setting with a +, which
# is a restream of the video being sent to jtv, no transcoding involved.
#
@blha303
blha303 / xmailv1.py
Created July 6, 2013 07:50
xMail Python implementation
# xMail implementation v1 by blha303
# MIT license
# irc.esper.net #drtshock for questions
import json, urllib2, urllib
url = "http://xmail.turt2live.com/mail/index.php"
from random import randrange
def get_password(password):
return urllib2.urlopen("http://blha303.com.au/sha1.php?q=%s" % password).read()
# An alternative for this, on machines with PHP installed, is:
@blha303
blha303 / westnetusage.py
Last active December 18, 2015 13:09
ISP usage checker / router disabler
#!/usr/bin/env python2.7
version = "r7"
# This script gets usage from my ISP's website, checks to see if the current average for the month
# is above their recommended amount per day, then disables the wifi on my router if it is.
# I made this for a household of people who don't understand the consequences of their actions
# (namely, that if you abuse our awesome internet, we all have to suffer with being shaped :( )
# Please, modify this for your own ISP/router and set it up in your own house to help with your daily usage.
# -blha303
# Usage: python westnetusage.py [debug]
# Options:
@blha303
blha303 / getcovers.sh
Created June 11, 2013 16:56
TV show cover downloader | Uses thetvdb.com's api | Run ./getcovers.sh in your TV show root folder
#!/bin/bash
apikey="APIKEY HERE"
folderlist=`ls -d -- */`
while read p
do
echo "$p"
url=`python /media/audvid/sorted/Videos/TV/getposterurl.py $apikey $p`
cd "$p"
@blha303
blha303 / agdq2012get.py
Last active December 18, 2015 00:29
Awesome Games Done Quick 2012-2013 file selector || Usage: agdq2013get.sh <1-129> / agdq2012get.sh <1-109>
import sys
files = {1: "http://archive.org/download/AwesomeGamesDoneQuick2012/AwesomeGamesDoneQuick2012_part001_Psychonauts_HQ.mp4",
2: "http://archive.org/download/AwesomeGamesDoneQuick2012/AwesomeGamesDoneQuick2012_part002_Portal2_HQ.mp4",
3: "http://archive.org/download/AwesomeGamesDoneQuick2012/AwesomeGamesDoneQuick2012_part003_YoshisIsland_HQ.mp4",
4: "http://archive.org/download/AwesomeGamesDoneQuick2012/AwesomeGamesDoneQuick2012_part004_YoshisStory_HQ.mp4",
5: "http://archive.org/download/AwesomeGamesDoneQuick2012/AwesomeGamesDoneQuick2012_part005_DeusExHumanRevolution_HQ.mp4",
6: "http://archive.org/download/AwesomeGamesDoneQuick2012/AwesomeGamesDoneQuick2012_part006_Vanquish_HQ.mp4",
7: "http://archive.org/download/AwesomeGamesDoneQuick2012/AwesomeGamesDoneQuick2012_part007_MetalGearSolidTheTwinSnakes_HQ.mp4",
8: "http://archive.org/download/AwesomeGamesDoneQuick2012/AwesomeGamesDoneQuick2012_part008_ResidentEvil4_HQ.mp4",