S
S
Stadinov Denis2014-08-27 16:35:54
Skype
Stadinov Denis, 2014-08-27 16:35:54

How to parse and parse messages from skype chat?

Hello kittens! Help me solve the problem: what is the best way to parse and split text from Skype?
There is a Skype group chat, I would like to feed the chat history to some program (website), and she has already beautifully neatly sorted out the correspondence on the shelves by date, time, nickname and message, if there are smileys in the message, then replace them with smileys, if there are pictures, then insert them and similar work with links.
I started to solve the issue using a regular expression, but problems arose:
1. If there are new lines in the message, the regular expression ignores them
2. Sometimes text is added to the link, it does not see 2 links
, etc.
Correspondence example

[11.01.2014 20:00:34] pr<stl3n>ya: Не завидуйте, подружки, 
Мой Ванюша - не орел! 
 День и ночь поет частушки.

[14.08.2013 21:49:14] yxa4yxa4: (bandit)
[14.08.2013 17:00:15] Kiri1l: http://giant.gfycat.com/SleepyThisGreendarnerdragonfly.gif
вот тебе слоник
[12:11:34] Сергей: какая долгая гифка, я ж устал смотреть
[15:23:45] Mike: [15:13] Сергей: 

<<< Сообщение которое написал Сергей

The regular expression is
(\[(([0-9]{1,2})\:([0-9]{2})\:([0-9]{2,4})|([0- 9]{1,2})\.([0-9]{2})\.([0-9]{2,4})\s([0-9]{1,2})\: ([0-9]{2})\:([
0-9
]{ 2,4 }))\]\s(.*):\s(.*)) then parse messages differently?
Thanks in advance to everyone for the advice!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2014-08-27
@DrunkenMaster

Skype stores history in SQLite database. It's best to take a data file and work with it.
Some code examples:
https://github.com/Bishop/SkypeHistory
https://github.com/mrjazz/SkypeHistory

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question