Skip to content

Instantly share code, notes, and snippets.

@jmandel
Last active August 29, 2015 13:59
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 jmandel/10556077 to your computer and use it in GitHub Desktop.
Save jmandel/10556077 to your computer and use it in GitHub Desktop.
export skype chat hsitory for FHIR Implementers
import sqlite3
import json
import sys
# e.g. python export_history.py /home/jmandel/.Skype/jcmandel/main.db > export.json
c = sqlite3.connect(sys.argv[1])
c.row_factory = sqlite3.Row
cur = c.cursor()
# Note: the "chatname" for the FHIR Implementers chat is:
# `#ewoutkramer/$f6a8a0ea0abcc75d`
cur.execute("""
SELECT
author,
body_xml,
chatname,
date(timestamp, 'unixepoch') as timestamp,
date(edited_timestamp, 'unixepoch') as edited_timestamp
FROM messages
WHERE
chatname="#ewoutkramer/$f6a8a0ea0abcc75d" and
body_xml not null
order by timestamp;
""")
posts = [dict(r) for r in cur.fetchall()]
print json.dumps(posts, indent=2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment