mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
#100: welcome to you, instapaper users
This commit is contained in:
parent
3208d538a7
commit
a62788c61e
6 changed files with 30 additions and 6 deletions
|
@ -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 <ol>
|
||||
# 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();
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue