2 # Alex Russell <slightlyoff@chromium.org>
4 # Use of this source code is governed under the Apache License, Version 2.0
5 # http://www.apache.org/licenses/LICENSE-2.0
8 import httplib, urllib, fileinput
10 if __name__ == "__main__":
11 params = urllib.urlencode({
12 "js_code": ''.join([ line for line in fileinput.input() ])
15 "Content-type": "application/x-www-form-urlencoded",
16 "Accept": "text/plain"
18 conn = httplib.HTTPConnection("marijnhaverbeke.nl")
19 conn.request("POST", "/uglifyjs", params, headers)
20 response = conn.getresponse()
21 data = response.read()