Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A simple Wallabag -> Pocket conversion script
import time
import io
import csv
import sys
from datetime import datetime
print("""<!DOCTYPE html>
<!--So long and thanks for all the fish-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Pocket Export</title>
with open(sys.argv[1]) as fp:
reader = csv.reader(fp, delimiter=';')
for i, row in enumerate(reader):
if i == 0:
title = row[0]
url = row[1]
tags = row[3]
date = row[-1]
date = int(time.mktime(datetime.strptime(date, '%d/%m/%Y %H:%M:%S').timetuple()))
print('<li><a href="{url}" time_added="{time}" tags="{tags}">{title}</a></li>'.format(title=title, url=url, tags=tags, time=date))
<h1>Read Archive</h1>
#Title;URL;Content;Tags;"MIME Type";Language;"Creation date"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment