Page 1 of 1

Adium log format

Posted: Tue Jan 25, 2005 1:44 am
by Vlcice
I've been taking a look at the logs Adium writes in order to see how to convert my Gaim logs to Adium ones; however, I was wondering a couple of things.

First, do the first three bytes mean anything? I was taking a look at one log, and it starts with three bytes (EF BB BF) before beginning the log itself. If they do, what do they mean?

Secondly, does Adium read inside the logs? In other words, do I need to change the name formatting (with capitals, as Gaim writes) and time formatting (24-hour) to Adium's formatting, or can I safely leave it as it is? As well, I saw a thread a few weeks ago about Adium always writing in 12-hour time - has that been resolved and can Adium write 24-hour time?

Thank you for reading, and I appreciate any answers you may be able to give!
~ VlĨice

Posted: Tue Jan 25, 2005 3:24 am
by bgannin
We already have a gaim log importer in the SVN repository. Why reinvent the wheel? (does it not work?)

Posted: Tue Jan 25, 2005 3:26 am
by evands
And FYI, the initial bytes are to indicate that it's a UTF8 file.

Posted: Tue Jan 25, 2005 3:31 am
by Vlcice
Oh, oops. ^.^;; I wasn't aware that there was already a convertor; I hadn't seen anything about it on the Adium website, although I had looked. My apologies, I'll just use that. Thank you for your help!

Posted: Tue Jan 25, 2005 4:56 am
by jmelloy
The current converter does nothing but rename them to Adium's naming scheme. Our HTML parser opens them, but they still look different.

Posted: Tue Jan 25, 2005 5:24 am
by bgannin
Still a good starting point most likely :)

How to convert

Posted: Fri Jan 20, 2006 1:17 am
by neologism
I've worked out a couple of quickie grep find/replace strings for use in the free TextWrangler from bare bones. Open up the find/replace dialog box, choose multi-file search (make sure the recursive option is checked in the options button), drag in your gaim logs, make sure the "use grep" button is checked, and run the following 4 find/replace strings:

find 1:

Code: Select all

<html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>.*</title></head><body>
replace 1:

Code: Select all

<!-- gaim log export -->\r
find 2:

Code: Select all

\r</body></html>
replace 2:

Code: Select all

\r<!-- end gaim log export -->\r
find 3:

Code: Select all

<font color="#16569E"><font size="2">(.*)</font> <b>(.*)</b></font> <font sml="AIM/ICQ">(.*)</font><br/>\r
replace 3:

Code: Select all

<div class="send"><span class="timestamp">\1</span> <span class="sender">\2</span><pre class="message">\3</pre></div>\r
find 4:

Code: Select all

<font color="#A82F2F"><font size="2">(.*)</font> <b>(.*)</b></font> <font sml="AIM/ICQ"><html><span style='background: #ffffff;'>(.*)</span></span></html></font><br/>\r
replace 4:

Code: Select all

<div class="receive"><span class="timestamp">\1</span> <span class="sender">\2</span><pre class="message">\3</pre></div>\r
find 5:

Code: Select all

<font color="#A82F2F"><font size="2">(.*)</font> <b>(.*)</b></font> <html><span style='font-family: Arial><FONT; font-size: x-small; '><span style='font-size: x-small; '><body>(.*)</body></span></span></html><br/>\r
replace 5:

Code: Select all

<div class="receive"><span class="timestamp">\1</span> <span class="sender">\2</span><pre class="message">\3</pre></div>\r
find 6:

Code: Select all

<font color="#16569E"><font size="2">(.*)</font> <b>(.*)</b></font> <span style='font-size: small; '>(.*)</span><br/>\r
replace 6:

Code: Select all

<div class="send"><span class="timestamp">\1</span> <span class="sender">\2</span><pre class="message">\3</pre></div>\r
find 7:

Code: Select all

<font color="#A82F2F"><font size="2">(.*)</font> <b>(.*)</b></font> <html><span style='background: #ffffff;'>(.*)</span></span></html><br/>\r
replace 5:

Code: Select all

<div class="receive"><span class="timestamp">\1</span> <span class="sender">\2</span><pre class="message">\3</pre></div>\r
hope this helps! it worked great with me

http://trac.adiumx.com/browser/trunk/Ut ... m2adium.pl

EDIT: heh heh this thread was in January '05, not '06. I hope someone finds it useful eventually though...