| 123456789101112131415161718192021222324252627 |
- #!/usr/bin/env python3
- import json
- import websocket
- import sys
- #example: '{"type":"command","commandtype":"diapo","slide":1,"PDF":"EBA"}'
- val=""
- if not sys.stdin.isatty():
- val=sys.stdin.read().rstrip('\n')
- else:
- if len(sys.argv) != 2:
- print("1 arg, string to send")
- sys.exit(1)
- else:
- val=sys.argv[1]
- try:
- jsonval=json.loads(val)
- except:
- print("Value not parsable to json")
- sys.exit(1)
- ws = websocket.WebSocket()
- #ws.connect("wss://wscasa.especificosba.com.ar")
- ws.connect("ws://192.168.2.208:9001")
- ws.send(val)
- ws.close()
|