Skip to content

Instantly share code, notes, and snippets.

@ahsankhatri
Created March 28, 2016 22:05
Show Gist options
  • Save ahsankhatri/308c025b0e26bbd80d0b to your computer and use it in GitHub Desktop.
Save ahsankhatri/308c025b0e26bbd80d0b to your computer and use it in GitHub Desktop.
Read your Skype chats with the help of PHP PDO Driver
<?php
// replace ahsanyousuf with your users
$dbPath = '/Users/ahsan/Library/Application Support/Skype/ahsanyousuf/main.db';
$db = new PDO( 'sqlite:' . $dbPath );
$db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
$query = 'SELECT id, author, dialog_partner, body_xml, timestamp, datetime( timestamp, \'unixepoch\', \'localtime\') as actualTime
FROM Messages
ORDER BY timestamp DESC
LIMIT 100';
$history = $db->query( $query, PDO::FETCH_ASSOC );
foreach( $history as $row ) {
print_r( $row );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment