QutIM history import script from Kopete

    I first read about the new ICQ client for Linux, qutIM , here . Almost immediately I switched to this client, because under the ubuntu (and under the linux markup in general) IMHO very much lacks a normal ICQ client. In Windows, I used R&Q for about 2 years , and under Linux I used Kopete for about 4 months (I do not really like Pidgin, I sat in it for a long time under Windows).

    It did not work right to switch to a new client - it did not work very stably, collecting the latest versions from the repository trunk. And since If you need ICQ almost always, you have to come back from time to time to Kopete. Now it seems that Kutim has more or less stabilized, it flies out rarely, so now it has completely switched to it. But some, quite important conversations remained torn between histori kutima and kopete. Plus, quite a lot of logs simply remained in the coffer. Therefore, he wrote a merge history utility from a kopet to kutim.

    At first I thought in what language to implement the import utility. My main language is PHP, but it is somehow not interesting. I also have a little command of C # /. NET and JAVA, but writing on the first under linux is somehow not a huh, but on the second - although it is interesting (for me), it would have been rather cumbersome. Although I could be wrong.

    As a result, my choice fell on the python, which I’m going to study for a long time, but somehow my hands did not reach. And here is a very real and not very difficult task - why is there no reason to begin to learn a new programming language, touted by many reputable comrades.

    No sooner said than done. It took about 8 hours to write the script, but I really liked the result, like the process itself =)

    The script provides for both copying the history for contacts for which history has not yet been carried out, as well as merging the existing history, in accordance with the chronology of the dialogs.

    When developing for working with XML, I used the DOM, not SAX, so the script is resource-intensive enough to parse very thick logs. But since the script will rarely run more than once, then this is not so critical.

    Of the known script bugs - dom parser to fall on incorrect characters. From 2.5 meters of logs, I got such symbols in 3 logs. So far, this has been treated only by manually editing the logs (the row and column numbers with the incorrect character are indicated in the error) and restarting the script. If someone offers a treatment option for incorrect characters - I will be very grateful.

    The script itself can be picked up here.ifolder.ru/7235826
    Not sure if this is the best place to upload scripts, but I couldn’t come up with another. Again, I would be grateful if you tell me services that specialize in simply laying out open source code.

    ZYZH the next step is to write a script to import history from R&Q, because since Windows I have about 25 meters of logs left there, most of which I do not want to lose.

    UPD : now you can just watch the script with highlighting here http://paste.org.ru/?vfzraa (thanks derZelle derZelle)

    Also popular now: