aly / showprocess.py
0 likes
0 forks
1 files
Last active
Script to rename daily show episodes to "<show name> sXXeXX"
| 1 | import os |
| 2 | import requests |
| 3 | import XML2Dict # The PyPI installer doesn't work; get this from http://blha303.com.au/XML2Dict.zip |
| 4 | from sys import argv |
| 5 | |
| 6 | apikey = argv[1] # Get your API key from http://www.thetvdb.com/wiki/index.php?title=Programmers_API |
| 7 | ids = {"The.Daily.Show": "71256", "The.Colbert.Report": "79274", "Craig.Ferguson": "73387"} |
| 8 | eplookupurl = "http://thetvdb.com/api/GetEpisodeByAirDate.php?apikey=%s&seriesid=%s&airdate=%s" |
| 9 | srslookupurl = "http://thetvdb.com/data/series/%s/en.xml" |
| 10 | # I hate working with XML, so let's make them dicts. |
aly / torrentdirsum.py
0 likes
0 forks
1 files
Last active
Sum up the total size of the contents of a folder of torrents
| 1 | import libtorrent as lt |
| 2 | from os import listdir |
| 3 | import json |
| 4 | |
| 5 | def sizeof_fmt(num): |
| 6 | for x in ['bytes','KB','MB','GB']: |
| 7 | if num < 1024.0 and num > -1024.0: |
| 8 | return "%3.1f%s" % (num, x) |
| 9 | num /= 1024.0 |
| 10 | return "%3.1f%s" % (num, 'TB') |
aly / irccloud-colorize.js
0 likes
0 forks
1 files
Last active
IRCCloud replace & with formatting characters | &b is bold, &r is reset, &<number from 0 to 15> is a color | I'm going to regret this.
| 1 | var inputbox = $('#bufferInputView' + cb().bid()); |
| 2 | var msg = inputbox.val(); |
| 3 | inputbox.val(""); |
| 4 | var cc = "\u0003"; |
| 5 | var bold = "\u0002"; |
| 6 | var reset = "\u000f"; |
| 7 | var italic = "\u0016"; |
| 8 | var underline = "\u001f"; |
| 9 | cb().say(msg.replace(/&b/g,bold).replace(/&r/g,reset).replace(/&i/g,italic).replace(/&u/g,underline).replace(/&/g,cc)); |
aly / irccloud-globalawaytoggle.js
0 likes
0 forks
1 files
Last active
IRCCloud toggle global away with message. Put away message in current channel input box, click bookmarklet. Click bookmarklet again (in a connection marked as away) to use global /back.
| 1 | javascript:if (cbc().isAway()) { SESSION.connections.each(function (c) { c.setBack() }) } else { var inputbox = $('#bufferInputView' + cb().bid()); var msg = inputbox.val(); inputbox.val(""); SESSION.connections.each(function (c) { c.setAway(msg) }) } |
aly / irccloud-lotsafish.js
0 likes
0 forks
1 files
Last active
Like /trout, but with hundreds of other possibilities for fish
| 1 | (function () { |
| 2 | var text = ""; |
| 3 | if (window.getSelection) { |
| 4 | text = window.getSelection().toString(); |
| 5 | } else if (document.selection && document.selection.type != "Control") { |
| 6 | text = document.selection.createRange().text; |
| 7 | } else { |
| 8 | text = cb().getName(); |
| 9 | } |
| 10 | Array.prototype.randomElement = function () { |
aly / bukjdrefresh.py
0 likes
0 forks
1 files
Last active
bukjdm Refresh data for new Bukkit snapshot
| 1 | import requests |
| 2 | from bs4 import BeautifulSoup as Soup |
| 3 | print "Getting data from jd.bukkit.org..." |
| 4 | data = requests.get("http://jd.bukkit.org/dev/apidocs/index-all.html") |
| 5 | soup = Soup(data.text) |
| 6 | print "Retrieved data. Bukkit version: " + soup.find('title').text[7:-1] |
| 7 | methods = {} |
| 8 | classes = {} |
| 9 | for dt in soup.findAll('dt'): |
| 10 | # If more than one link in definition (i.e. a class or method definition)... |
aly / irccloud-readall.js
0 likes
0 forks
1 files
Last active
Set all buffers as read (from Techman)
| 1 | javascript:SESSION.buffers.each(function (b) { b.setLastSeen(b.messages.last()) }) |
aly / irccloud-trout.js
0 likes
0 forks
1 files
Last active
IRCCloud trout-slapping bookmarklet | Usage: Select the username or text you want to slap. If you can fix prompt(), please let me know.
| 1 | javascript: (function () { var text = ""; if (window.getSelection) { text = window.getSelection().toString(); } else if (document.selection && document.selection.type != "Control") { text = document.selection.createRange().text; } else { text = prompt("Enter username", "everyone"); } if (!text) { text = "everyone"; } cb().say("/me slaps " + text.replace(/[<>@+~&]/g, '').trim() + " around a bit with a large trout"); }()); |
aly / getsizefromurls.py
0 likes
0 forks
1 files
Last active
Get total size of files indicated by a list of URLs
| 1 | from urllib2 import urlopen |
| 2 | import sys |
| 3 | from os import sep |
| 4 | |
| 5 | filename = ".".join(sys.argv[0].split(sep)[-1].split(".")[:-1]) |
| 6 | |
| 7 | |
| 8 | def sizeof_fmt(num): |
| 9 | for x in ['bytes','KB','MB','GB','TB','PB','EB','ZB']: |
| 10 | if num < 1024.0 and num > -1024.0: |