Import from other clients

forsgren's Avatar

forsgren

10 Jun, 2012 07:08 PM

So, Meebo shuts down, and I really want to start using Trillian (I would go for a pro account). However, I really would like to be able to import the logs from the Meebo Export. Is there any way to solve this?

As a side note, I don't mind if it is a bit tricky, but I hope there is a relatively easy way of solving it

  1. 2 Posted by kiernan on 11 Jun, 2012 04:58 AM

    kiernan's Avatar

    I would also love to have this feature.

  2. 3 Posted by Elize on 11 Jun, 2012 07:45 AM

    Elize's Avatar

    Me too. I loved Meebo, and this is a brilliant alternative .

  3. Support Staff 4 Posted by Glenn on 11 Jun, 2012 05:01 PM

    Glenn's Avatar

    We currently don't support importing of history from other clients. It has been suggested and appreciate your adding to the list.

    Thanks!

  4. 5 Posted by James on 13 Jun, 2012 06:00 AM

    James's Avatar

    Glenn --

    I'm also looking for a successor to Meebo, and my years of chat history (just downloaded a 27mb zip file) is really important to me. I'd really like to see Trillian support this.

    I understand that trillian uses an XML format. Is there a spec somewhere? I haven't poked around my meebo export yet, but I might be willing to write (or help) with a converter.

    James

  5. 6 Posted by Justin on 19 Jun, 2012 03:06 AM

    Justin's Avatar

    I'm in the same boat as these guys, and I also would be willing to help out writing this utility...I'm going to get to work on one for myself pretty soon. I'll let you all know how it goes.

    Cheers,
    Justin

  6. 7 Posted by James on 19 Jun, 2012 03:20 AM

    James's Avatar

    Justin -- Have you found a copy of the trillian xml?

    I've poked through the meebo export and it's pretty bad (surprisingly so for a company now owned by google). It's clearly oriented for people who want to view their chat history through a browser. I emailed meebo's support and, after having to clarify myself, she said she'd pass it on to the developers but couldn't guarantee anything.

    However, it shouldn't be too hard to parse it in a way that's 98% correct. And I guess that's good enough for something like history which, honestly, I'll rarely be looking at.

    The open question is how to get it into trillian. There's an app that reads/writes the xml file (and some other formats), but, despite being free, I don't think it's open source (at least not officially). Otherwise, I guess that can be reverse-engineered, too. Glenn? Can you provide something?

    James

  7. 8 Posted by Justin on 20 Jun, 2012 04:24 AM

    Justin's Avatar

    Hey James, I've been doing a bunch of digging into this, and I found a program that I think I'm going to reverse-engineer to work with meebo's downloaded files. It currently "supports" the old version of the meebo files, which is pretty useless to us, but it does have a "beta" trillian exporter which we may find useful. See the source at:

    Link

    How's your C++?

    Justin

  8. 9 Posted by james on 20 Jun, 2012 06:56 PM

    james's Avatar

    Not very good. What's your language of choice? I'm planning on doing this in PHP, which isn't ideal, but it's what I'm best at for this type of thing. If you're in the same boat, I can create a simple framework and put something up on github.

    I also found http://paste.lisp.org/display/8185 and http://paste.lisp.org/display/8186 . Basically, I don't think the C++ source or those two pasties are going to tell us anything more than 5 minutes with a recent (notice the pasties are from years ago) trillian xml file.

    I just created one and there's nothing too complex. (There's also a .index file, but it appears trillian will repopulate this if it gets deleted.) I think that between the current version output and the C++ (to, for example, demonstrate what the ms attribute is for), this should be pretty simple.

    If you want to collaborate you can reach me at james at james shannon dot com. Otherwise tell me what you plan on doing so we don't duplicate effort. 3 weeks left....

    James

  9. 10 Posted by Justin on 21 Jun, 2012 04:22 AM

    Justin's Avatar

    Hey James, I went ahead and bro'd down and crushed some code when I got home from work today, and it seems to be pretty much done. I worked on an extension for this:
    https://sourceforge.net/projects/log2log/
    and just re-wrote the file meebo.cpp to work with the meebo files that they're serving up now.

    So all you need to do is get the source code from that sourceforge site, put in my changes, and compile and run the source code and it'll behave as expected. Trillian chat .xml files are not as complicated as they may seem on first glance.

    Just replace the code that's currently in there for the load method with this:

    /**
     * Load a Chat Log
     * rewritten by Justin Raabe 6/21/2012 to work with new meebo format
     */
    void Meebo::load(QVariant $log_raw)
    {
        // If File Not Meebo Chat Log
        if ($log_raw.toString().indexOf("<!doctype html>") == -1)
        {
            return;
        }
    
        QString $log_refined; // whitespace fixed and trimmed version of $log_raw
        QStringList $log_entries; // contains all the chatlogs to be processed
    //    QList<QDateTime> $times;
        QDateTime $time_cur;
        QString $row_regex = "^\\[(([0-1][0-9]|[2][0-3]):([0-5][0-9]))\\] ([\\S ]+)</span>: ([\\S ]*)<br/>$";
        QString $chat_sep = "<span class='Im"; // chat instance separator
        QString $rece_sep = "<span class='ImReceive'>"; // from separator
        QString $send_sep = "<span class='ImSend'>"; // to separator
        QString $sender;
        QString $message;
        bool $receiving, $sending;
        bool $self_set, $with_set;
        qint8 $accuracy, $specificity;
        qint32 $count;
        qint8 numSameMinute=0;
    
        // Fix whitespace characters recognition
        $log_refined = $log_raw.toString()
                .replace("\\t", "\t")
                .replace("\\n", "\n")
                .replace("\\r", "\r")
                .replace("\\0", "\0")
                .replace("\\x0B", "\x0B");
    
        // Split chat instances
        $log_entries = $log_refined.split("\n"+$chat_sep);
       QString $header =  $log_entries.first();
       $log_entries.removeFirst();
       QString $dateString = $header.split("\">")[3];
       $dateString= $dateString.split(" at")[0].replace("  ", " ");
        QDateTime $fileDate = QDateTime::fromString($dateString, "dddd, MMMM d, yyyy");
       QDateTime lastDateSeen;
    
        // If there are no Meebo Chat Logs
        if($log_entries.size() == 0)
            return;
    
        $self_set = $with_set = false;
        $time_cur = $fileDate;
    
        final->newEntry();
        final->setProtocol($protocol);
        final->setSelf($account);
        final->setSelfAlias($account);
        final->setWith($with);
        final->setWithAlias($with);
        final->setTime($time_cur.toMSecsSinceEpoch());
    
    
        // Retrieve Meebo log entries' start times
        // $log_entry : contains a chat log entry to be processed
        foreach(QString $log_entry, $log_entries) {
            $log_entry.prepend( $chat_sep);
    
            // Check if an entry is from or to the user
            $receiving = $sending = false;
            if($log_entry.indexOf($rece_sep,0) == 0) {
                $receiving = true;
                $log_entry = $log_entry.mid($rece_sep.length());
            }
            else if($log_entry.indexOf($send_sep,0) == 0) {
                $sending = true;
                $log_entry = $log_entry.mid($send_sep.length());
            }
    
            QRegExp re($row_regex);
            if(re.indexIn($log_entry) < 0)
                return;
    
            // If entry contains valid Meebo chat log timestamp...
            if(re.captureCount() != 5) // consult the documentation at the end of the file
                return;
    
            // Set the time of the current entry
            QString timeString = re.capturedTexts().takeAt(1);
            $time_cur.setTime(QTime::fromString(timeString,"HH:mm"));
            //if the time has reset, it's the next day
            if ($time_cur.toString("HH:mm") ==( lastDateSeen).toString("HH:mm")){
                //bump it up by a second
                numSameMinute++;
                $time_cur= $time_cur.addSecs(numSameMinute);
            }else if($time_cur.operator <(lastDateSeen)){
               $time_cur= $time_cur.addDays(1);
               $fileDate= $fileDate.addDays(1);
            }else if(numSameMinute>59){
                //if someone sends us more than 60 messages in a minute, we're going to have problems.  reset to 0
                numSameMinute=0;
             } else{
                numSameMinute=0;
            }
    
            // Set Log2Log Timestamp Specificity Index
            $specificity = 2;
            // Set Log2Log Message Content Accuracy Index
            $accuracy = 0;
    
            // The first Meebo chat log entry has a Log2Log Timestamp Specificity Index of 0.
            // It is the same value as the header time.
            if ($count == 0)
            {
                //$time_cur = $times.first();
                $specificity = 0;
            }
    
            $sender = re.capturedTexts().takeAt(4); // Sender alias
            $message = re.capturedTexts().takeAt(5); // Message content
    
            final->newRow();
            final->setCode(0);
            final->setTime($time_cur.toMSecsSinceEpoch());
    
            // Set row data
            if($receiving)
                final->setSender($with);
            else if($sending)
                final->setSender($account);
            else
                final->setSender("_unknown");
            final->setAlias($sender);
            final->setContent($message);
            final->setPrecision($specificity);
            final->setAccuracy($accuracy);
            final->setWithAlias("with_alias");
    
            $count++;
    
            lastDateSeen = $time_cur;
        }
    }
    

    Cheers,
    Justin

  10. 11 Posted by Justin on 21 Jun, 2012 06:50 AM

    Justin's Avatar

    Actually, hold off on that. I'm working with the creator of the log2log program to see if we can bundle everything up nice and neat for people who need it, so just sit tight until we're done making it squeaky clean. Shouldn't be long now.

    -Justin

  11. 12 Posted by Justin on 23 Jun, 2012 02:56 PM

    Justin's Avatar

    Woo! I'm pleased to announce that log2log v1.01 has just been released for Microsoft Windows, and can convert the logs downloaded from Meebo into trillian format. Download it from

    https://sourceforge.net/projects/log2log/

    Choose "Meebo (farewell)" as the input and "trillian" as the output, and then put the resultant files wherever you have trillian's history. If you need to merge several trillian logs, I recommend this program:

    http://zalbee.intricus.net/immerge/

    Cheers everyone, leave a comment if it helped!
    -Justin

  12. 13 Posted by James on 23 Jun, 2012 03:58 PM

    James's Avatar

    Thanks.

    But did you guys actually test that it worked within Trillian?

    Looking at the output directory structure and xml files, they look ok. However, I noticed that there is no CLOUD directory. In my testing of how-to-create-trillian-format, I found that having the CLOUD directory (with its slightly different directory structure) was necessary -- ie, I'd create some native history, then delete the _CLOUD directory but not the [SERVICE] directory, and my history would disappear.

    Additionally, I note that meebo logs everything as JABBER whereas trillian has a GOOGLE option (which might just be a sort of preconfigured shortcut). Since my history isn't working at all, I can't confirm, but I have a feeling that you'll need to add google accounts to trillian as jabber accounts.

    Dammit. Why can't glenn throw us a bone here.

    James

  13. 14 Posted by Justin on 23 Jun, 2012 11:11 PM

    Justin's Avatar

    Yessiree, I tested it, but of course I used my code and not Nick's.

    The cloud directory is created by Trillian if you have the "sync messages between devices" option checked, but is not necessary. Delete it and the individual .index files and move in the files that are generated by the converter. Both the CLOUD directory and the .index files will be regenerated when you open a contact's history.

    As for the jabber-vs-google thing, if you just use notepad++ to do a search and replace on that directory (logdir/JABBER) and replace all instances within the files of medium="JABBER" with medium="GOOGLE" it should be golden. Also rename the JABBER directory to GOOGLE to match.

    Hope this helps!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.