#!/usr/bin/env python

import webbrowser
import sys
import os
import time
from tempfile import NamedTemporaryFile

f = NamedTemporaryFile(suffix='.html', delete=False)
f.write(sys.stdin.read())
f.close()
url = 'file://' + f.name
print "opening url %s" % url
webbrowser.open(url)
time.sleep(3)
os.unlink(f.name)
