Skip to content

Instantly share code, notes, and snippets.

@maxchuquimia
Created July 1, 2020 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxchuquimia/098fac99723dd02dc6884000e71e04a5 to your computer and use it in GitHub Desktop.
Save maxchuquimia/098fac99723dd02dc6884000e71e04a5 to your computer and use it in GitHub Desktop.
Calculate total time in Skype calls with a person (parsing Skype export)
cat skype_export.json | jq -r '.conversations[] | select(.displayName != null) | select(.displayName | contains("PEER NAME HERE")) | .MessageList[] | select(.messagetype == "Event/Call") | .content' | grep 'ended' | sed -e 's/^.*callId="\([^"]*\)".*<duration>\(.*\)<\/d.*$/\1 \2/g' | uniq | sed 's/^.* \(.*\)$/\1/g' | awk '{ SUM += $1} END { printf "%.2f", SUM }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment