Created
January 21, 2012 16:52
-
-
Save mlooney/1653268 to your computer and use it in GitHub Desktop.
Extract chat history from skype logs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
corpus = Hash.new {|h,k| h[k]=[]} | |
SQLite3::Database.new( "/Users/username/Library/Application Support/Skype/skypename/main.db", :readonly=>true ) do |db| | |
db.execute("select timestamp,author, body_xml from messages") do |row| | |
ts, author, body = row | |
corpus[author]<<(body) if body | |
end | |
end | |
corpus.each do |k,v| | |
File.open("corpus_#{k}.txt", 'w') do |f| | |
v.each{|k|f.puts(k)} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment