Skip to content

Instantly share code, notes, and snippets.

@phiresky
Created May 22, 2020 13:25

Revisions

  1. phiresky created this gist May 22, 2020.
    21 changes: 21 additions & 0 deletions newscatcher-json.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    <meta charset="utf-8">

    <script src="https://unpkg.com/sql.js@1.2.2/dist/sql-asm.js"></script>

    <script>
    async function go() {
    const SQL = await initSqlJs();

    const dbres = await fetch("https://rawcdn.githack.com/kotartemiy/newscatcher/b30358cf57c9f8f4a481b51c0a0884a64e0b85b2/newscatcher/data/package_rss.db");

    const dbbuf = await dbres.arrayBuffer()

    const db = new SQL.Database(new Uint8Array(dbbuf));
    const data = [];
    db.each("select * from rss_main", obj => data.push(obj));


    document.write(`<pre>${JSON.stringify(data, null, 3)}</pre>`);
    }
    go();
    </script>