updated readme

This commit is contained in:
kolaente 2017-11-20 21:28:31 +01:00
parent 25ba4e7542
commit 6c76303bd8
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 7 additions and 6 deletions

View File

@ -1,3 +1,5 @@
# wallabag-broken-export
# Wallabag Broken Export
Ein Script, um Wallabag-Einträge nachträglich in ein JSON zu exportieren um dieses dann in eine andere wallabag-inztanz zu importieren.
A small helper script, to extract all your Wallabag articles from the database into a format you can input into another fresh Wallabag instace.
At some point, my Wallabag instance wasn't accessible anymore, however the database was still intact - therefore I wrote this small script.

View File

@ -1,6 +1,6 @@
<?php
require_once 'db-mysql.php';
$db = new db('db', 'wallabag', 'root', 'tTuG04Z5N2', '');
$db = new db('db', 'wallabag', 'root', 'supersecretpassword', '');
echo '<pre>';
//Get all Tags
@ -27,6 +27,7 @@ foreach($entries as $entry)
$tags_entry[] = $tags[$tag_entry['tag_id']]['label'];
}
// Build the JSON-Array with all Articles
$entries_export[] = [
'is_archived' => $entry['is_archived'],
'is_starred' => $entry['is_starred'],
@ -46,6 +47,7 @@ foreach($entries as $entry)
];
}
// Save the entries
$entries = json_encode($entries);
if(file_put_contents('wallabag_export.json', $entries))
{
@ -54,7 +56,4 @@ if(file_put_contents('wallabag_export.json', $entries))
echo 'Error saving export';
}
//echo $entries;
echo '</pre>';