#!/usr/bin/env python
# htmltotext

import sys
from subprocess import Popen, PIPE

def htmltotext(input, cmd, output=sys.stdout):
	proc = Popen(cmd, stdin=PIPE, stdout=PIPE, shell=True)
	proc.stdin.write(input)
	print >> output, proc.communicate()[0]
