summaryrefslogtreecommitdiff
path: root/rotord/httplot
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2013-12-05 14:10:55 +0000
committerTim Redfern <tim@eclectronics.org>2013-12-05 14:10:55 +0000
commit7ed9d7c6bdf4cce9c4dcd300a5f212f08c3661df (patch)
treeba083c4c600784822459b4c8f654a6cc8e11bd2a /rotord/httplot
parent5d8802e44adf01a1d8dd70dcbd5357d8641f37f9 (diff)
making plotting system
Diffstat (limited to 'rotord/httplot')
-rwxr-xr-xrotord/httplot24
1 files changed, 24 insertions, 0 deletions
diff --git a/rotord/httplot b/rotord/httplot
new file mode 100755
index 0000000..6b235f9
--- /dev/null
+++ b/rotord/httplot
@@ -0,0 +1,24 @@
+#!/usr/bin/python
+import httplib
+import argparse
+parser = argparse.ArgumentParser()
+parser.add_argument("method",default="GET",nargs='?')
+parser.add_argument("path",default="/",nargs='?')
+parser.add_argument("body",default="body",nargs='?')
+parser.add_argument("ip",default="127.0.0.1:9000",nargs='?')
+args=parser.parse_args()
+connection = httplib.HTTPConnection(args.ip)
+connection.request(args.method, args.path, args.body)
+response= connection.getresponse().read()
+
+import xml.etree.ElementTree as ET
+root = ET.fromstring(response)
+signal= root.find("signal").text
+output =signal.replace(",", "\n")
+print output
+
+#print response
+#connection = httplib.HTTPConnection('54.228.219.55:80')
+#connection = httplib.HTTPConnection('127.0.0.1:9000')
+
+