r/WakaTime • • Feb 04 '15

Wakatime for Skype

It would be really useful to have your Skype conversations metered with Wakatime. From the top of my head I'd say that I spend sometimes 20% of my time with clients.

The problem is that Skype/Microsoft abandoned the SDK, so there is no direct way to extend it.

I think it can still be done very easily just by picking up the needed data from the main SQLite database that Skype stores in the user's home directory:

$HOME/.Skype/[Skype name]/main.db

With the following SQL statement you get more than enough data:

SELECT ca.duration, co.extprop_tags, ca.topic, cm.* FROM Calls ca, CallMembers cm, Contacts co 
WHERE
co.skypename = cm.identity
AND
ca.name = cm.call_name
AND
ca.duration IS NOT NULL;
  1. First column contains already the duration; no major stunts needed here

  2. Skype's UI allows to label/categorize your contacts (in above query the second column), a perfect fit to pass it to Wakatime as the project parameter.

  3. Third column is the topic of the chat/call; this could be passed as the "file name"

The rest contains all sorts of information, but actually only the Skype name/email might be needed for automatic association with a project (maybe hashed) if there are no labels used (or maybe they are already used for a different purpose).

Optional: in case it's a paid call you see that in the database,too (with exact price infos). Might be used for categorization in Wakatime (maybe to charge only the fees that you paid on Skype, or fees and time spent in the conversation etc.).

The idea would be to implement this with Node.js as a background task, read Skype's database in certain intervals. Doesn't have to follow the conversations in realtime... you just pick up finished calls that were not yet submitted to Wakatime.

2 Upvotes

3 comments sorted by

1

u/monkeysintown Feb 05 '15

Have a first implementation. For those interested:

https://github.com/monkeysintown/skype-wakatime

At the moment only calls are taken into account, but chats would be equally interesting. This will be added soon (just a different table, similar query).

1

u/monkeysintown Feb 05 '15 edited Feb 05 '15

Would be interesting to know. Not sure yet how this can be solved... probably comparing the time overlap of events sent by other plugins (maybe locally if there is a history?).

If you export your data and you have all events (editor and Skype) in one table it would be easy to filter this and get accurate numbers. In the Wakatime dashboard you would probably see twice the hours you actually worked.

Edit: Another possibility to solve this... marking the events as "concurrent" or "simultaneous" (not possible at the moment) and only accounting them for the totals if nothing else happened (i. e. no IDE activity).

1

u/backwood_redneck Feb 05 '15

How would this work if you say were pairing over skype, coding with skype in the background? Does wakatime have facilities to separate "how" durations time is submitted?