Import all your facebook posts into a database

Written By Sanjir Habib On Dec-22nd, 2017

Go to facebook settings and find the “Download a copy of your facebook data” link.

Extract the zip and find a file called timeline.htm in html folder.

Process this data with a PHP script like this

$doc=new DOMDocument();
$xp=new DOMXpath($doc);
foreach($xp->query("//div[@class='meta' or @class='comment']") as $v){
    else $body=$val;
    // here you have the data in $date and $body fields.
    // insert these into your database
    // sql ... insert into table $date, $body