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 contextlib import closing, contextmanager | |
from urllib2 import urlopen | |
import hashlib | |
import os | |
import time | |
@contextmanager | |
def cached(url, expires=0, root='/tmp'): | |
''' | |
Returns the contents of the URL through a file-based cache. If "expires" is |
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
#!/bin/env python | |
# | |
# Demo tool to generate the rtmpdump(1) command for streaming a song from Rdio. | |
import httplib | |
from optparse import OptionParser | |
from os.path import basename | |
from pprint import pprint | |
from pyamf.remoting.client import RemotingService | |
from rdioapi import Rdio |