aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche
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 /inc/poche
parent3208d538a750866221fa231d4230082eef90ca69 (diff)
downloadwallabag-a62788c61ef80e6b0f1cf0b6304b2dfd2223aa38.tar.gz
wallabag-a62788c61ef80e6b0f1cf0b6304b2dfd2223aa38.tar.zst
wallabag-a62788c61ef80e6b0f1cf0b6304b2dfd2223aa38.zip
#100: welcome to you, instapaper users
Diffstat (limited to 'inc/poche')
-rw-r--r--inc/poche/Poche.class.php22
-rw-r--r--inc/poche/config.inc.php5
2 files changed, 25 insertions, 2 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');