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/python | |
# http://nettech.wikia.com/wiki/Grooveshark_Internal_API | |
# http://github.com/magcius/groovespark/ | |
import cookielib, hashlib, json, os, urllib, urllib2, uuid, sys, pprint, random, shutil, re | |
from optparse import OptionParser | |
cookiejar = cookielib.LWPCookieJar() | |
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(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
IF OBJECT_ID('EpochToDateTime', 'FN') IS NOT NULL | |
DROP FUNCTION EpochToDateTime; | |
GO | |
CREATE FUNCTION EpochToDateTime(@epoch INT) | |
RETURNS DateTime | |
AS | |
BEGIN | |
RETURN (DATEADD(s, @epoch, '1970-01-01 00:00:00')) | |
END |
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
function Chat(args) { | |
this.data = []; | |
this.callbacks = []; | |
this.args = args || []; | |
} | |
Chat.prototype.length = function() { | |
var rv = 0; | |
for(var i=0; i<this.data.length; 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
function DataBuffer(data) { | |
this.data = data; | |
this.index = 0; | |
} | |
DataBuffer.prototype.check = function(n) { | |
return this.data.length >= this.index + n; | |
} | |
DataBuffer.prototype.readByte = function() { |
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
<%! from recaptcha.client import captcha %> | |
<%def name="captcha(public_key=None, use_ssl=True, error=None, theme=None)"> | |
%if theme: | |
<script type="text/javascript"> | |
var RecaptchaOptions = { theme : '${theme}'}; | |
</script> | |
%endif |
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
try: | |
from recaptcha.client import captcha | |
from pylons import request, config | |
class RecaptchaValidator(Schema): | |
''' | |
Validates ReCAPTCHA against their web service | |
''' |
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 name="yesno(value, text=None)"> | |
<span class="${'positive' if value else 'negative'}"> | |
${text or ('Yes' if value else 'No')} | |
</span> | |
</%def> |
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/python | |
import os | |
import sys | |
from itertools import chain | |
from random import shuffle | |
HEAD_XML = ''' | |
<background> | |
<starttime> |
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
from decimal import Decimal | |
from csv import DictReader, DictWriter | |
from datetime import datetime, timedelta | |
from urllib import urlopen, urlencode | |
import sys | |
from pprint import pprint | |
from itertools import chain | |
URL = 'http://ichart.yahoo.com/table.csv' |
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 python | |
from csv import DictReader, DictWriter | |
import sys | |
import re | |
from pprint import pprint | |
from datetime import datetime | |
parse_datetime = lambda x: datetime.strptime(x, '%Y-%m-%d %H:%M:%S') |