Garten Eden

#linux #programming #android #online #stuff

qutIM2Pidgin History Converter

Ending up dissatisfied with the instant messenger qutIM, I decided to switch back to the good old Pidgin. In order not to lose my qutIM message history, I dropped some Python lines, which turned into a full-grown script enabling you to convert your logs from one format into the other one.

$HOME/.config/qutim/qutim.Myself/history/ICQ.987654321/123456789.201004.json:

[ 
 { 
  "datetime": "2010-04-30T13:45:08", 
  "type": 1, 
  "in": false, 
  "text": "Hello!" 
 }, 
 { 
  "datetime": "2010-04-30T13:45:14", 
  "type": 1, 
  "in": true, 
  "text": "Hi!" 
 }, 
 { 
  "datetime": "2010-04-30T13:45:30", 
  "type": 1, 
  "in": false, 
  "text": "How are you?" 
 } 
]

Format qutIM 0.2.0

$HOME/.purple/logs/icq/987654321/123456789/2010-04-30.134508+0200CEST.txt:

Conversation with 123456789 at Fri 30 Apr 2010 13:45:08 CEST on 987654321 (icq) 

(13:45:08) Myself: Hello! 
(13:45:14) Bob: Hi! 
(13:45:30) Myself: How are you?

Format Pidgin (cleartext)

What it does

Firstly, the script tries to find qutIM in its default path ($HOME/.config/qutIM) and lists all present protocols giving you the chance to pick the protocol whose history you want to convert. If there is more than one profile (identity) available, chose one first. Afterwards the contactlist.ini gets indexed so that the names can be inserted at the proper place in the Pidgin files. Having checked the determined timezone, you can finally start the actual transformation.

What it really does (Behind the Scenes)

The magic takes place while iterating over all old history files (.json). Each block between the braces { } represents a message.

Notes, downer

Use at ones own risk. Backup recommended, albeit the script does not replace files. Published 2010 under the MIT License.

Run by typing

$ python ./qutim2pidgin.py

Download

Current version: 0.1 / May, 1st 2010
qutim2pidgin.py.txt (9.5KB text/plain) or
qutim2pidgin.py.gz (3.5KB application/x-gzip)

Comments

Your comment:






So far...

 
15 Apr, 2013 07:45 pm Eduard Dopler says:
Sorry, for approving your comment so late! I havent tested your script changes, but it looks nice and hasnt any malfunction in the version I tested (04/15/2013) ;)
 
26 Dec, 2012 10:50 am kernel says:
converter for qutim 0.3:
http://krasview.ru/files/qutim2pidgin.py
 
03 Jun, 2012 11:17 am Loli says:
It works!
Just do not understand how to run first.
 
02 Jun, 2012 03:10 pm Eduard Dopler says:
You just have to install Python for Windows and run the script in Windows Prompt Shell.
 
28 May, 2012 01:26 am Loli says:
Hello.
Maybe, youre create this script for Windows, please?
 
15 Nov, 2011 08:42 pm Eduard Dopler says:
The scripts reads the contact from the contactlist.ini. Can you find the listed names there?Your second point I cannot understand. All the script does, is converting the history from qutIM format to Pidgins. It does not create any contacts.
 
15 Nov, 2011 02:58 pm Chuckcha says:
Sorry, but no contacts were deleted, in contrary, they exist, and cutIM works with them iin reality up to now. The question is, why your script doesnot find the existing contacts.
And you also forgot to describe whether it is necessary firstly to create contacts in Pidgin manually, or your script will create them automatically.
 
15 Nov, 2011 10:55 am Eduard Dopler says:
It means that the script cannot lookup the name for the ID. For example: If you have deleted the contact but the history still is in your path, the script tries to find the name for that contact but it is not able to do that as you deleted him/her. So it gives you the opportunity to look up the name yourself, enter it and then it will appear in your new Pidgin history file with the name you have entered.
 
14 Nov, 2011 08:39 pm Chuckcha says:
Bad result:$ python ./q2p.pyHistory-Converter qutIM->Pidgin v0.1Setting Paths:qutIM path: /home/chuckha/.config/qutimokay? [Y/n]> yHere are your protocol identities in qutIM. Choose one:[1] ICQ.40886385[2] ICQ.41548698[3] ICQ.521688761Enter your nickname that will appear in your histories: chukchaFetching Nicknames out of contactlist.ini [/home/chuckcha/.config/qutim/qutim.chuckha/ICQ.40886385/contactlist.ini]... OKYour OS reported this as the current timezone setting:-Your timezone has a DaylightSavingTime-Your local timezone without DST is: +0200CET-Your local timezone with DST is: +0300CESTDo you want to change these settings? [y/N]---START---Working in /home/chukcha/.config/qutim/qutim.chuckha/history/ICQ.40886385File 1/24 1004.201011.json...Cannot find a related nickname for this ID: 1004Look it up yourself and enter it:File 2/24 179342402.201008.json...Cannot find a related nickname for this ID: 179342402Look it up yourself and enter it:File 3/24 290862045.201008.json...Cannot find a related nickname for this ID: 290862045Look it up yourself and enter it: etc.What??
 
09 Feb, 2011 08:40 am Andrey says:
Thank you very much!

en

Wait a sec, loading...

Email (not published)

Homepage (optional)

Comment... (code tag allowed)