From c765c3679fee3ed9e4bad9954a808116187a7e83 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolas=20L=C5=93uillet?= Date: Sun, 4 Aug 2013 21:42:46 +0200 Subject: [PATCH] import in poche and not in an external file --- import.php | 73 --------------------- inc/poche/Poche.class.php | 108 ++++++++++++++++++++++++++++++- inc/poche/config.inc.php | 1 + index.php | 49 ++------------ tpl/config.twig | 11 +++- tpl/{export.html => export.twig} | 0 tpl/home.twig | 9 --- tpl/layout.twig | 1 - tpl/login.twig | 9 --- 9 files changed, 125 insertions(+), 136 deletions(-) delete mode 100644 import.php rename tpl/{export.html => export.twig} (100%) diff --git a/import.php b/import.php deleted file mode 100644 index 45fe8334..00000000 --- a/import.php +++ /dev/null @@ -1,73 +0,0 @@ - - * @copyright 2013 - * @license http://www.wtfpl.net/ see COPYING file - */ - -set_time_limit(0); - -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.') . '

' . _('Please choose between Pocket & Readabilty :') . '
' . _('Bye bye Pocket, let\'s go !') . '
' . _('Bye bye Readability, let\'s go !') . ''; -} -else { - 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); - 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