diff options
Diffstat (limited to 'inc/poche')
-rw-r--r-- | inc/poche/Poche.class.php | 22 | ||||
-rw-r--r-- | inc/poche/config.inc.php | 5 |
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 | ||
11 | define ('POCHE_VERSION', '0.4'); | 11 | define ('POCHE_VERSION', '1.0-alpha'); |
12 | define ('MODE_DEMO', FALSE); | 12 | define ('MODE_DEMO', TRUE); |
13 | define ('DEBUG_POCHE', FALSE); | 13 | define ('DEBUG_POCHE', FALSE); |
14 | define ('CONVERT_LINKS_FOOTNOTES', FALSE); | 14 | define ('CONVERT_LINKS_FOOTNOTES', FALSE); |
15 | define ('REVERT_FORCED_PARAGRAPH_ELEMENTS', FALSE); | 15 | define ('REVERT_FORCED_PARAGRAPH_ELEMENTS', FALSE); |
16 | define ('DOWNLOAD_PICTURES', FALSE); | 16 | define ('DOWNLOAD_PICTURES', FALSE); |
17 | define ('SHARE_TWITTER', TRUE); | ||
17 | define ('SALT', '464v54gLLw928uz4zUBqkRJeiPY68zCX'); | 18 | define ('SALT', '464v54gLLw928uz4zUBqkRJeiPY68zCX'); |
18 | define ('ABS_PATH', 'assets/'); | 19 | define ('ABS_PATH', 'assets/'); |
19 | define ('TPL', './tpl'); | 20 | define ('TPL', './tpl'); |