Last active
April 3, 2021 18:10
-
-
Save wilbeibi/489ae95d625733b726e0d562c55b761d to your computer and use it in GitHub Desktop.
Export Reeder starred iterms to csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import getpass | |
import sqlite3 | |
import csv | |
RKIT_PATH = "/Users/" + getpass.getuser() + "/Library/Containers/com.reederapp.rkit2.mac/Data/Library/Application Support/Reeder/rkit/" | |
conn = sqlite3.connect(RKIT_PATH + "rkit.db") | |
DATA_DB_PATH = RKIT_PATH + "rkit-data.db" | |
cursor = conn.cursor() | |
cursor.execute("ATTACH DATABASE '%s' AS data" % DATA_DB_PATH) | |
cursor.execute(''' | |
SELECT data.rkitemdata.title, data.rkitemdata.link, data.rkitemdata.content FROM data.rkitemdata | |
INNER JOIN rkitem | |
WHERE data.rkitemdata.id == rkitem.id and rkitem.starred == 1 | |
''') | |
data = cursor.fetchall() | |
with open("starred_items.csv", "w") as f: | |
writer = csv.writer(f) | |
for row in data: | |
writer.writerow(row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for python2.7 not ascii content