From 323da3f815a8a97c48e7f7c2cd6c49a3a7c60070 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 13 Aug 2011 15:40:17 +0200 Subject: cholerab knut cnot: add command line client --- cholerab/knut/clients/cnot/index | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 cholerab/knut/clients/cnot/index (limited to 'cholerab/knut/clients') diff --git a/cholerab/knut/clients/cnot/index b/cholerab/knut/clients/cnot/index new file mode 100755 index 00000000..a9e4972d --- /dev/null +++ b/cholerab/knut/clients/cnot/index @@ -0,0 +1,14 @@ +#! /bin/sh +# +# +# +set -euf + +host="$1"; shift +port=42101 + +params="$*" + +exec curl -vsS -X PUT --data-binary @- "http://$host:$port" < Date: Sat, 13 Aug 2011 15:42:28 +0200 Subject: cholerab cnot: add documentation --- cholerab/knut/clients/cnot/index | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cholerab/knut/clients') diff --git a/cholerab/knut/clients/cnot/index b/cholerab/knut/clients/cnot/index index a9e4972d..d17329f4 100755 --- a/cholerab/knut/clients/cnot/index +++ b/cholerab/knut/clients/cnot/index @@ -1,6 +1,8 @@ #! /bin/sh # +# cnot - cholerab live command line notification client, bitch! # +# usage: cnot hostname message... # set -euf -- cgit v1.2.3 From c36f72a019abcd22fca3dc550e1a239c1d161f1f Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 13 Aug 2011 15:49:43 +0200 Subject: cholerab cnot: be verbose on demand only --- cholerab/knut/clients/cnot/index | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'cholerab/knut/clients') diff --git a/cholerab/knut/clients/cnot/index b/cholerab/knut/clients/cnot/index index d17329f4..f276dd25 100755 --- a/cholerab/knut/clients/cnot/index +++ b/cholerab/knut/clients/cnot/index @@ -2,7 +2,7 @@ # # cnot - cholerab live command line notification client, bitch! # -# usage: cnot hostname message... +# usage: [verbose=yes] cnot hostname [message...] # set -euf @@ -11,6 +11,12 @@ port=42101 params="$*" -exec curl -vsS -X PUT --data-binary @- "http://$host:$port" < Date: Sun, 14 Aug 2011 22:03:11 +0200 Subject: pidgin_speak: initial commit --- cholerab/knut/clients/pidgin_speak/speak.py | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 cholerab/knut/clients/pidgin_speak/speak.py (limited to 'cholerab/knut/clients') diff --git a/cholerab/knut/clients/pidgin_speak/speak.py b/cholerab/knut/clients/pidgin_speak/speak.py new file mode 100755 index 00000000..aeaa417f --- /dev/null +++ b/cholerab/knut/clients/pidgin_speak/speak.py @@ -0,0 +1,31 @@ +#!/usr/bin/python +import string +CNOT="../cnot/index %s %s" +host="pornocauster" +def speakOwn(account, receiver,message): + speak(account,receiver,message,"",""); +def speak(account, sender, message, conversation, flags): + bus = dbus.SessionBus() + obj = bus.get_object("im.pidgin.purple.PurpleService", "/im/pidgin/purple/PurpleObject") + purple = dbus.Interface(obj, "im.pidgin.purple.PurpleInterface") + import subprocess + message = message.replace("'",'"') + print message + #cmd = "espeak -v de '%s'" % message + cmd = CNOT % (host,message) + subprocess.call(cmd,shell=True) +import dbus, gobject + +from dbus.mainloop.glib import DBusGMainLoop +dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) +bus = dbus.SessionBus() + +bus.add_signal_receiver(speak, + dbus_interface="im.pidgin.purple.PurpleInterface", + signal_name="ReceivedImMsg") + +bus.add_signal_receiver(speakOwn, + dbus_interface="im.pidgin.purple.PurpleInterface", + signal_name="SentImMsg") +loop = gobject.MainLoop() +loop.run() -- cgit v1.2.3