aboutsummaryrefslogtreecommitdiffstats
path: root/skylog/skydbg.py
blob: 0a2d1719fba39d2856aded3de4e61f192fd480e4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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