diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 5c3eda8..0d37e3c 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -212,6 +212,28 @@ class Poche private function importFromInstapaper() { + $html = new simple_html_dom(); + $html->load_file('./instapaper-export.html'); + + $read = 0; + $errors = array(); + foreach($html->find('ol') as $ul) + { + foreach($ul->find('li') as $li) + { + $a = $li->find('a'); + $url = new Url(base64_encode($a[0]->href)); + $this->action('add', $url); + if ($read == '1') { + $last_id = $this->store->getLastId(); + $this->store->archiveById($last_id); + } + } + # Instapaper génère un fichier HTML avec deux
    + # Le premier concerne les éléments non lus + # Le second concerne les éléments archivés + $read = 1; + } Tools::logm('import from instapaper completed'); Tools::redirect(); } diff --git a/inc/poche/config.inc.php b/inc/poche/config.inc.php index 67d0c88..a16098d 100644 --- a/inc/poche/config.inc.php +++ b/inc/poche/config.inc.php @@ -8,12 +8,13 @@ * @license http://www.wtfpl.net/ see COPYING file */ -define ('POCHE_VERSION', '0.4'); -define ('MODE_DEMO', FALSE); +define ('POCHE_VERSION', '1.0-alpha'); +define ('MODE_DEMO', TRUE); define ('DEBUG_POCHE', FALSE); define ('CONVERT_LINKS_FOOTNOTES', FALSE); define ('REVERT_FORCED_PARAGRAPH_ELEMENTS', FALSE); define ('DOWNLOAD_PICTURES', FALSE); +define ('SHARE_TWITTER', TRUE); define ('SALT', '464v54gLLw928uz4zUBqkRJeiPY68zCX'); define ('ABS_PATH', 'assets/'); define ('TPL', './tpl'); diff --git a/index.php b/index.php index 94c72a2..294620d 100644 --- a/index.php +++ b/index.php @@ -49,7 +49,6 @@ $tpl_vars = array( 'referer' => $referer, 'view' => $view, 'poche_url' => Tools::getPocheUrl(), - 'demo' => MODE_DEMO, 'title' => _('poche, a read it later open source system'), 'token' => Session::getToken(), ); diff --git a/tpl/config.twig b/tpl/config.twig index c18806b..dc49ee3 100644 --- a/tpl/config.twig +++ b/tpl/config.twig @@ -42,6 +42,7 @@

    {% trans "Export your poche datas" %}

    diff --git a/tpl/login.twig b/tpl/login.twig index c302879..b24674e 100644 --- a/tpl/login.twig +++ b/tpl/login.twig @@ -5,15 +5,15 @@

    {% trans "login to your poche" %}

    - {% if demo == 1 %}

    {% trans "you are in demo mode, some features may be disabled." %}

    {% endif %} + {% if constant('MODE_DEMO') == 1 %}

    {% trans "you are in demo mode, some features may be disabled." %}

    {% endif %}
    - +
    - +
    diff --git a/tpl/view.twig b/tpl/view.twig index 8ef5cd9..bf9a9af 100644 --- a/tpl/view.twig +++ b/tpl/view.twig @@ -8,6 +8,7 @@