1
0
mirror of https://github.com/osmarks/meme-search-engine.git synced 2026-06-08 22:02:11 +00:00
Files

14 lines
305 B
Python

import sqlite3
import json
import sys
iteration = sys.argv[1]
db = sqlite3.connect("data.sqlite3")
db.row_factory = sqlite3.Row
with open("top.json", "r") as f:
listing = json.load(f)
db.executemany("INSERT INTO queue VALUES (?, ?, ?)", [ (x[0], x[1], iteration) for x, v in listing ])
db.commit()