X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=import.php;h=45fe83347ef9fa9b66031c978c7be99d2f14a4c3;hb=2ee436eaa19fd5819a0e6c705b5fcc93f11fb338;hp=135443c9a4746517b339b07b6df37d9547b75769;hpb=b693a19e1c3d4ffcf2f3aaef1d67df4b986e4903;p=github%2Fwallabag%2Fwallabag.git diff --git a/import.php b/import.php index 135443c9..45fe8334 100644 --- a/import.php +++ b/import.php @@ -14,37 +14,60 @@ include dirname(__FILE__).'/inc/config.php'; include dirname(__FILE__).'/inc/simple_html_dom.php'; if (!isset($_GET['start'])) { - echo 'Please execute the import script locally, it can take a very long time.
Bye bye Pocket, let\'s go !'; + echo _('Please execute the import script locally, it can take a very long time.') . '

' . _('Please choose between Pocket & Readabilty :') . '
' . _('Bye bye Pocket, let\'s go !') . '
' . _('Bye bye Readability, let\'s go !') . ''; } else { - $html = new simple_html_dom(); - $html->load_file('ril_export.html'); - - $read = 0; - $errors = array(); - foreach($html->find('ul') as $ul) - { - foreach($ul->find('li') as $li) - { - $a = $li->find('a'); - $url = $a[0]->href; + if ($_GET['start'] == 'pocket') { + $html = new simple_html_dom(); + $html->load_file('ril_export.html'); + $read = 0; + $errors = array(); + foreach($html->find('ul') as $ul) + { + foreach($ul->find('li') as $li) + { + $a = $li->find('a'); + $url = $a[0]->href; - action_to_do('add', $url, $token); - if ($read == '1') { - $last_id = $db->getHandle()->lastInsertId(); - $sql_update = "UPDATE entries SET is_read=~is_read WHERE id=?"; - $params_update = array($last_id); - $query_update = $db->getHandle()->prepare($sql_update); - $query_update->execute($params_update); + action_to_do('add', $url); + if ($read == '1') { + $last_id = $db->getHandle()->lastInsertId(); + $sql_update = "UPDATE entries SET is_read=~is_read WHERE id=?"; + $params_update = array($last_id); + $query_update = $db->getHandle()->prepare($sql_update); + $query_update->execute($params_update); + } } + # Pocket génère un fichier HTML avec deux