diff options
author | Laurent Ghigonis <laurent@p1sec.com> | 2013-02-27 19:56:39 +0100 |
---|---|---|
committer | Laurent Ghigonis <laurent@p1sec.com> | 2013-02-27 19:56:39 +0100 |
commit | 2bb57c80760ddad7f88a82d21747881f9fe5e9a9 (patch) | |
tree | 5745651ca15b279381afa34d1855eb1a6ee42510 /skylog/skydbg.py | |
download | laurent-tools-2bb57c80760ddad7f88a82d21747881f9fe5e9a9.tar.xz laurent-tools-2bb57c80760ddad7f88a82d21747881f9fe5e9a9.zip |
add skylog, tool to log skype users status changes to stdout in CSV format
Diffstat (limited to 'skylog/skydbg.py')
-rw-r--r-- | skylog/skydbg.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/skylog/skydbg.py b/skylog/skydbg.py new file mode 100644 index 0000000..0a2d171 --- /dev/null +++ b/skylog/skydbg.py @@ -0,0 +1,31 @@ +# skydbg v0.1 +# Logs all skype notifications +# Usage: python skydbg.py >> dbg.log & +# 2013, Laurent Ghigonis <laurent@p1sec.com> + +import Skype4Py +import time +import sys +import atexit + +do_exit = False + +def cb_exit(): + print sys.stderr, "cb_exit()" + print "EXIT" + +def cb_notify(notification): + t = time.strftime("%Y%m%d-%H%M%S", time.localtime()) + print "%s %s" % (t, notification) + sys.stdout.flush() + +atexit.register(cb_exit) +skype = Skype4Py.Skype() +skype.RegisterEventHandler('Notify', cb_notify) +skype.Attach() +print >> sys.stderr, 'Started' + +while True: + time.sleep(0.1) + if do_exit is True: + break |