Permalink
Browse files

announce client, so I don't have to run a python interpreter for ever…

…y demo.
  • Loading branch information...
1 parent 0bd45bd commit e5b35eae202215ca31003f027ebbf15bedb52103 @eastein committed May 13, 2012
Showing with 24 additions and 0 deletions.
  1. +24 −0 announcec
View
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+
+import zmqsub
+import sys
+
+if __name__ == '__main__' :
+ try :
+ url = sys.argv[1]
+ text = sys.argv[2]
+
+ try :
+ pitch = sys.argv[3]
+ except IndexError :
+ pitch = 0
+
+ except (IndexError, ValueError) :
+ sys.stderr.write('usage: announcec <url> "<phrase>" [pitch]\n\nPitch is an integer. Negative numbers are deeper, postive higher.')
+ sys.exit(1)
+
+ c = zmqsub.JSONZMQConnectPub(url)
+ c.send({
+ 'text' : text,
+ 'pitch' : pitch
+ })

0 comments on commit e5b35ea

Please sign in to comment.