$mode = isset($_GET['mode']) ? $_GET['mode'] : 'all'; $amt = new \Darathor\Amt\App($core); // API tweets. if ($mode === 'all' || $mode === 'timeline') { $archiveOutput = 'Importing timeline...' . PHP_EOL; $archiveOutput .= $amt->archiveTimeline(); if ($isWeb) { echo '<pre>' . $archiveOutput . '</pre>'; } else { echo $archiveOutput; } } // API favorites. if ($mode === 'all' || $mode === 'favorites') { $archiveOutput = 'Importing favorites...' . PHP_EOL; $archiveOutput .= $amt->archiveFavorites(); if ($isWeb) { echo '<pre>' . $archiveOutput . '</pre>'; } else { echo $archiveOutput; } } // Import JSON from an official twitter archive monthly .js files should be in a folder called 'json'. if ($mode === 'all' || $mode === 'json') { $importOutput = $amt->importJSON(ROOT_DIR . '/json'); if ($isWeb) { echo '<pre>' . $importOutput . '</pre>'; } else { echo $importOutput; } }