Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import json
import sqlite3
import zlib
# ~/Library/Safari/CloudTabs.db
# Ref:
db = sqlite3.connect('CloudTabs.db')
tabs = []
# Ref:
for row in db.execute('SELECT position,url,title FROM cloud_tabs'):
jsonstr = json.loads(zlib.decompress(str(row[0])))
tabs.append([ jsonstr['sortValues'][0]['sortValue'], row[1], row[2] ])
for row in sorted(tabs, key=lambda k: k[0]):
print row[1].encode('utf-8') + " | " + row[2].encode('utf-8')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.