Skip to content

Instantly share code, notes, and snippets.

@mackuba
Created October 22, 2013 15:35
Show Gist options
  • Save mackuba/7102876 to your computer and use it in GitHub Desktop.
Save mackuba/7102876 to your computer and use it in GitHub Desktop.
Exports the history of conversations with a specific person from Skype (OSX) to an HTML file
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <your_username> <contact_username>"
exit 1
fi
echo "<!DOCTYPE html><html><head>"
echo "<style>"
echo "table { border-collapse: collapse; width: 800px; }"
echo "th, td { border: 1px solid #ccc; padding: 10px; color: #333; font-family: \"Lucida Grande\", Helvetica, sans-serif; font-size: 10pt; }"
echo "</style>"
echo "<script>"
echo "window.onload = function() {"
echo " var list = document.getElementsByTagName('tr');"
echo " var names = [];"
echo " var colors = ['white', '#f0f0f3', '#e0f3e0', '#f3e0e0'];"
echo " for (var i = 1; i < list.length; i++) {"
echo " var tr = list[i];"
echo " var name = tr.children[0].textContent;"
echo " if (names.indexOf(name) == -1) {"
echo " names.push(name);"
echo " }"
echo " tr.style.backgroundColor = colors[names.indexOf(name)];"
echo " tr.children[1].innerHTML = tr.children[1].textContent;"
echo " }"
echo "};"
echo "</script>"
echo "</head><body><table>"
SQL="SELECT author, body_xml FROM messages WHERE dialog_partner = '$2'"
sqlite3 -html "$HOME/Library/Application Support/Skype/$1/main.db" "$SQL"
echo "</table></body></html>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment