Search code examples
phpmysqlskype

Get Skype chat history from main.db synced to MySQL with PHP


Is there a way to get with PHP maybe from Skype main.db data copied to MySQL in every X minutes?

I have Windows 10 and WAMP server running.


Solution

  • If you have WAMPP running then just create a BAT file:

    copy /b/v/y C:\Users\YOURNAME\AppData\Local\Packages\Microsoft.SkypeApp_kzf8qxf38zg5c\LocalState\s4l-YOUR_SKYPE_NAME.db C:\wamp64\www\skype.db
    

    Then you have the DB file accessible with PHP

    $db = new SQLite3('skype.db');
    $results = $db->query('SELECT nsp_data FROM messagesv12');
    while ($row = $results->fetchArray()) {
    // And here's the data:
    // $messages['cuid']
    // $messages['conversationId']
    // $messages['creator']
    // $messages['createdTime']
    // $messages['content']
    }
    

    Just do whatever you want with the data. Add to MySQL or whatever you wish.