From aca3ecdb5ccceafa995e6bf2005d42d083c07ef1 Mon Sep 17 00:00:00 2001 From: Laurent Ghigonis Date: Thu, 24 Oct 2013 23:48:13 +0200 Subject: move skylog to github https://github.com/looran/skylog git clone https://github.com/looran/skylog --- skylog/Makefile | 9 ------- skylog/README.txt | 3 --- skylog/runskype_skylog.sh | 28 ---------------------- skylog/skydbg.py | 33 -------------------------- skylog/skylog.py | 60 ----------------------------------------------- 5 files changed, 133 deletions(-) delete mode 100644 skylog/Makefile delete mode 100644 skylog/README.txt delete mode 100644 skylog/runskype_skylog.sh delete mode 100644 skylog/skydbg.py delete mode 100644 skylog/skylog.py diff --git a/skylog/Makefile b/skylog/Makefile deleted file mode 100644 index 50ef680..0000000 --- a/skylog/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -PREFIX=/usr/local -BINDIR=$(PREFIX)/bin - -BINARIES=skylog.py skydbg.py runskype_skylog.sh - -all: - -install: - install -m 0755 $(BINARIES) $(BINDIR) diff --git a/skylog/README.txt b/skylog/README.txt deleted file mode 100644 index 8769335..0000000 --- a/skylog/README.txt +++ /dev/null @@ -1,3 +0,0 @@ -skylog - log online/offline skype status of contacts - -runskype_skylog.sh: Run skype and skylog, and shows you skylog output in tmux diff --git a/skylog/runskype_skylog.sh b/skylog/runskype_skylog.sh deleted file mode 100644 index 90abaa1..0000000 --- a/skylog/runskype_skylog.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -LOGDIR=$HOME/skylog/ - -echo "[-] running skype" -skype & - -echo "[-] waiting for skype to be up" -while :; do - echo "\n" |ncat -v -w1 127.0.0.1 5253 && break - sleep 1 -done - -echo "[-] running skylog" -skylog.py >> $LOGDIR/skylog.csv & -sleep 2 - -echo "[-] running skydbg" -skydbg.py >> $LOGDIR/skydbg.csv & - -echo "[-] create tmux skylog watcher" -tmux new-session -d -s skylog "tail -f $LOGDIR/skydbg.csv" -tmux new-window -t skylog "tail -f $LOGDIR/skylog.csv" - -echo "[-] attach to tmux skylog watcher" -tmux attach-session -t skylog - -echo "[*] running !" diff --git a/skylog/skydbg.py b/skylog/skydbg.py deleted file mode 100644 index ae55f4b..0000000 --- a/skylog/skydbg.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env python - -# skydbg v0.1 -# Logs all skype notifications -# Usage: python skydbg.py >> dbg.log & -# 2013, Laurent Ghigonis - -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 diff --git a/skylog/skylog.py b/skylog/skylog.py deleted file mode 100644 index 40f7020..0000000 --- a/skylog/skylog.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python - -# skylog.py v0.4 -# Logs skype users status changes to stdout in CSV format -# On startup all online users are added to CSV -# On startup, exit and local user status change, lines from simulated user -# "syslog-info" are added to CSV -# Format: 20130219-154801,Marimounette,OFFLINE -# Usage: python skylog.py >> skylog.csv & -# 2013, Laurent Ghigonis - -import Skype4Py -import time -import sys -import atexit - -do_exit = False - -def cb_exit(): - print sys.stderr, "cb_exit()" - print_csv("<<> sys.stderr, "cb_attachmentstatus: %s" % status - if status != Skype4Py.apiAttachSuccess: - print >> sys.stderr, "Disconnected from skype ! exiting" - do_exit = True - -def cb_userstatus(status): - print_csv("***skylog-info", status) - -def cb_onlinestatus(user, status): - print_csv(user.Handle, status) - -def print_csv(user, status): - t = time.strftime("%Y%m%d-%H%M%S", time.localtime()) - print "%s,%s,%s" % (t, user, status) - sys.stdout.flush() - -def print_online_users(skype): - for f in skype.Friends: - if f.OnlineStatus != Skype4Py.cusOffline: - print_csv(f.Handle, f.OnlineStatus) - -atexit.register(cb_exit) -skype = Skype4Py.Skype() -skype.RegisterEventHandler('AttachmentStatus', cb_attachmentstatus) -skype.RegisterEventHandler('UserStatus', cb_userstatus) -skype.RegisterEventHandler('OnlineStatus', cb_onlinestatus) -skype.Attach() -print >> sys.stderr, 'Started' -print_csv(">>>skylog-info", "STARTUP") - -print_online_users(skype) -while True: - time.sleep(0.1) - if do_exit is True: - break -- cgit v1.2.3-59-g8ed1b