Skip to content

Instantly share code, notes, and snippets.

@khromov
Last active May 16, 2020
Embed
What would you like to do?
Migrate an Amazing Marvin list to Wallabag

Migrate an Amazing Marvin reading list to Wallabag

Example: You've been using the Amazing Marvin Bookmarklet and now the tasks have piled up and Marvin is acting sluggish. Wallabag is a prefect place to migrate these bookmarks.

Prerequisites

  • PHP 7
  • Python 3

Process

  • Export one or more of your reading lists containings URLs from Amazing Marvin by going to Account > Backups > Backup.
  • Name your file MarvinBackup.json and put it in the same folder as this file.
  • Download latest release of wallabag-cli for your platform.
  • Put the wallabag binary in the same folder as this file.
  • Run wallabag config and set up your API keys that you get from Wallabag (In "API Clients management")
  • Now, run php convert.php and your content will be migrated to Wallabag.
<?php
$content = json_decode(file_get_contents('MarvinBackup.json'));
echo sizeof($content);
foreach($content as $item) {
$matches = null;
$url = preg_match('/https?:\/\/[^\s]*/', $item->title, $matches);
if(isset($matches[0])) {
exec("./wallabag add \"{$matches[0]}\" > /dev/null 2>/dev/null &");
usleep(500000);
echo "Adding {$matches[0]}\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment