aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas Lœuillet <nicolas.loeuillet@gmail.com>2013-08-05 09:43:33 +0200
committerNicolas Lœuillet <nicolas.loeuillet@gmail.com>2013-08-05 09:43:33 +0200
commita62788c61ef80e6b0f1cf0b6304b2dfd2223aa38 (patch)
tree9fae636bd0d7006e8adcf16783e69130cd6b03d9
parent3208d538a750866221fa231d4230082eef90ca69 (diff)
downloadwallabag-a62788c61ef80e6b0f1cf0b6304b2dfd2223aa38.tar.gz
wallabag-a62788c61ef80e6b0f1cf0b6304b2dfd2223aa38.tar.zst
wallabag-a62788c61ef80e6b0f1cf0b6304b2dfd2223aa38.zip
#100: welcome to you, instapaper users
-rw-r--r--inc/poche/Poche.class.php22
-rw-r--r--inc/poche/config.inc.php5
-rw-r--r--index.php1
-rw-r--r--tpl/config.twig1
-rw-r--r--tpl/login.twig6
-rw-r--r--tpl/view.twig1
6 files changed, 30 insertions, 6 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index 5c3eda80..0d37e3c2 100644
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -212,6 +212,28 @@ class Poche
212 212
213 private function importFromInstapaper() 213 private function importFromInstapaper()
214 { 214 {
215 $html = new simple_html_dom();
216 $html->load_file('./instapaper-export.html');
217
218 $read = 0;
219 $errors = array();
220 foreach($html->find('ol') as $ul)
221 {
222 foreach($ul->find('li') as $li)
223 {
224 $a = $li->find('a');
225 $url = new Url(base64_encode($a[0]->href));
226 $this->action('add', $url);
227 if ($read == '1') {
228 $last_id = $this->store->getLastId();
229 $this->store->archiveById($last_id);
230 }
231 }
232 # Instapaper génère un fichier HTML avec deux <ol>
233 # Le premier concerne les éléments non lus
234 # Le second concerne les éléments archivés
235 $read = 1;
236 }
215 Tools::logm('import from instapaper completed'); 237 Tools::logm('import from instapaper completed');
216 Tools::redirect(); 238 Tools::redirect();
217 } 239 }
diff --git a/inc/poche/config.inc.php b/inc/poche/config.inc.php
index 67d0c887..a16098d1 100644
--- a/inc/poche/config.inc.php
+++ b/inc/poche/config.inc.php
@@ -8,12 +8,13 @@
8 * @license http://www.wtfpl.net/ see COPYING file 8 * @license http://www.wtfpl.net/ see COPYING file
9 */ 9 */
10 10
11define ('POCHE_VERSION', '0.4'); 11define ('POCHE_VERSION', '1.0-alpha');
12define ('MODE_DEMO', FALSE); 12define ('MODE_DEMO', TRUE);
13define ('DEBUG_POCHE', FALSE); 13define ('DEBUG_POCHE', FALSE);
14define ('CONVERT_LINKS_FOOTNOTES', FALSE); 14define ('CONVERT_LINKS_FOOTNOTES', FALSE);
15define ('REVERT_FORCED_PARAGRAPH_ELEMENTS', FALSE); 15define ('REVERT_FORCED_PARAGRAPH_ELEMENTS', FALSE);
16define ('DOWNLOAD_PICTURES', FALSE); 16define ('DOWNLOAD_PICTURES', FALSE);
17define ('SHARE_TWITTER', TRUE);
17define ('SALT', '464v54gLLw928uz4zUBqkRJeiPY68zCX'); 18define ('SALT', '464v54gLLw928uz4zUBqkRJeiPY68zCX');
18define ('ABS_PATH', 'assets/'); 19define ('ABS_PATH', 'assets/');
19define ('TPL', './tpl'); 20define ('TPL', './tpl');
diff --git a/index.php b/index.php
index 94c72a27..294620d1 100644
--- a/index.php
+++ b/index.php
@@ -49,7 +49,6 @@ $tpl_vars = array(
49 'referer' => $referer, 49 'referer' => $referer,
50 'view' => $view, 50 'view' => $view,
51 'poche_url' => Tools::getPocheUrl(), 51 'poche_url' => Tools::getPocheUrl(),
52 'demo' => MODE_DEMO,
53 'title' => _('poche, a read it later open source system'), 52 'title' => _('poche, a read it later open source system'),
54 'token' => Session::getToken(), 53 'token' => Session::getToken(),
55); 54);
diff --git a/tpl/config.twig b/tpl/config.twig
index c18806bc..dc49ee39 100644
--- a/tpl/config.twig
+++ b/tpl/config.twig
@@ -42,6 +42,7 @@
42 <p><ul> 42 <p><ul>
43 <li><a href="./?import&from=pocket">{% trans "import from Pocket" %}</a> (you must have a "ril_export.html" file on your server)</li> 43 <li><a href="./?import&from=pocket">{% trans "import from Pocket" %}</a> (you must have a "ril_export.html" file on your server)</li>
44 <li><a href="./?import&from=readability">{% trans "import from Readability" %}</a> (you must have a "readability" file on your server)</li> 44 <li><a href="./?import&from=readability">{% trans "import from Readability" %}</a> (you must have a "readability" file on your server)</li>
45 <li><a href="./?import&from=instapaper">{% trans "import from Instapaper" %}</a> (you must have a "instapaper-export.html" file on your server)</li>
45 </ul></p> 46 </ul></p>
46 47
47 <h2>{% trans "Export your poche datas" %}</h2> 48 <h2>{% trans "Export your poche datas" %}</h2>
diff --git a/tpl/login.twig b/tpl/login.twig
index c3028795..b24674e2 100644
--- a/tpl/login.twig
+++ b/tpl/login.twig
@@ -5,15 +5,15 @@
5 <form method="post" action="?login" name="loginform"> 5 <form method="post" action="?login" name="loginform">
6 <fieldset class="w500p center"> 6 <fieldset class="w500p center">
7 <h2 class="mbs txtcenter">{% trans "login to your poche" %}</h2> 7 <h2 class="mbs txtcenter">{% trans "login to your poche" %}</h2>
8 {% if demo == 1 %}<p>{% trans "you are in demo mode, some features may be disabled." %}</p>{% endif %} 8 {% if constant('MODE_DEMO') == 1 %}<p>{% trans "you are in demo mode, some features may be disabled." %}</p>{% endif %}
9 <div class="row"> 9 <div class="row">
10 <label class="col w150p" for="login">{% trans "Login" %}</label> 10 <label class="col w150p" for="login">{% trans "Login" %}</label>
11 <input class="col" type="text" id="login" name="login" placeholder="Login" tabindex="1" autofocus {% if demo == 1 %}value="poche"{% endif %} /> 11 <input class="col" type="text" id="login" name="login" placeholder="Login" tabindex="1" autofocus {% if constant('MODE_DEMO') == 1 %}value="poche"{% endif %} />
12 </div> 12 </div>
13 13
14 <div class="row"> 14 <div class="row">
15 <label class="col w150p" for="password">{% trans "Password" %}</label> 15 <label class="col w150p" for="password">{% trans "Password" %}</label>
16 <input class="col" type="password" id="password" name="password" placeholder="Password" tabindex="2" {% if demo == 1 %}value="poche"{% endif %} /> 16 <input class="col" type="password" id="password" name="password" placeholder="Password" tabindex="2" {% if constant('MODE_DEMO') == 1 %}value="poche"{% endif %} />
17 </div> 17 </div>
18 <div class="row"> 18 <div class="row">
19 <label class="col w150p" for="longlastingsession">{% trans "Stay signed in" %}</label> 19 <label class="col w150p" for="longlastingsession">{% trans "Stay signed in" %}</label>
diff --git a/tpl/view.twig b/tpl/view.twig
index 8ef5cd9c..bf9a9af9 100644
--- a/tpl/view.twig
+++ b/tpl/view.twig
@@ -8,6 +8,7 @@
8 </div> 8 </div>
9 <div class="tools"> 9 <div class="tools">
10 <ul> 10 <ul>
11 {% if constant('SHARE_TWITTER') == 1 %}<li><a href="https://twitter.com/home?status={{entry.title}}%20{{ entry.url|e }}%20via%20@getpoche" target="_blank" class="tool twitter"><span></span></a></li>{% endif %}
11 <li><a title="{% trans "toggle mark as read" %}" class="tool archive {% if entry.is_read == 0 %}archive-off{% endif %}" onclick="toggle_archive(this, {{ entry.id|e }})"><span></span></a></li> 12 <li><a title="{% trans "toggle mark as read" %}" class="tool archive {% if entry.is_read == 0 %}archive-off{% endif %}" onclick="toggle_archive(this, {{ entry.id|e }})"><span></span></a></li>
12 <li><a href="#" id="themeswitch">{% trans "dark" %}</a></li> 13 <li><a href="#" id="themeswitch">{% trans "dark" %}</a></li>
13 <li><a title="{% trans "toggle favorite" %}" class="tool fav {% if entry.is_fav == 0 %}fav-off{% endif %}" onclick="toggle_favorite(this, {{ entry.id|e }})"><span></span></a></li> 14 <li><a title="{% trans "toggle favorite" %}" class="tool fav {% if entry.is_fav == 0 %}fav-off{% endif %}" onclick="toggle_favorite(this, {{ entry.id|e }})"><span></span></a></li>