Versions

  • v5

    3/11/2024
    Open: Version
    Changes from v4 to v5
    +2
    -1
    import { zip } from "https://esm.town/v/pomdtr/sql";
    import { db } from "https://esm.town/v/sqlite/db?v=9";
    import { renderTable } from "npm:console-table-printer";

    export default async function() {
    const res = await db.execute(
    "SELECT author_username, COUNT(*) AS val_count FROM vals GROUP BY author_username ORDER BY 2 DESC LIMIT 10",
    );
    const table = renderTable(zip(res));

    const resp = await fetch("https://sourcecodeshots.com/api/image", {
    ⦚ 17 unchanged lines ⦚
    import { zip } from "https://esm.town/v/pomdtr/sql";
    import { db } from "https://esm.town/v/sqlite/db?v=9";
    import { renderTable } from "npm:console-table-printer";
    import stripAnsi from "npm:strip-ansi";

    export default async function() {
    const res = await db.execute(
    "SELECT author_username, COUNT(*) AS val_count FROM vals GROUP BY author_username ORDER BY 2 DESC LIMIT 10",
    );
    const table = stripAnsi(renderTable(zip(res)));

    const resp = await fetch("https://sourcecodeshots.com/api/image", {
    ⦚ 17 unchanged lines ⦚
  • v4

    3/11/2024
    Open: Version
    Changes from v3 to v4
    +2
    -2
    import { zip } from "https://esm.town/v/pomdtr/sql";
    import { db } from "https://esm.town/v/sqlite/db?v=9";
    import Table from "npm:easy-table";

    export default async function() {
    const res = await db.execute(
    "SELECT author_username, COUNT(*) AS val_count FROM vals GROUP BY author_username ORDER BY 2 DESC LIMIT 10",
    );
    const table = Table.string(zip(res));

    const resp = await fetch("https://sourcecodeshots.com/api/image", {
    ⦚ 17 unchanged lines ⦚
    import { zip } from "https://esm.town/v/pomdtr/sql";
    import { db } from "https://esm.town/v/sqlite/db?v=9";
    import { renderTable } from "npm:console-table-printer";

    export default async function() {
    const res = await db.execute(
    "SELECT author_username, COUNT(*) AS val_count FROM vals GROUP BY author_username ORDER BY 2 DESC LIMIT 10",
    );
    const table = renderTable(zip(res));

    const resp = await fetch("https://sourcecodeshots.com/api/image", {
    ⦚ 17 unchanged lines ⦚
  • v3

    3/11/2024
    Open: Version
    Changes from v2 to v3
    +5
    -1
    ⦚ 20 unchanged lines ⦚
    throw new Error(await resp.text());
    }
    return new Response(resp.body);
    }
    ⦚ 20 unchanged lines ⦚
    throw new Error(await resp.text());
    }
    return new Response(resp.body, {
    headers: {
    "Content-Type": "image/png",
    },
    });
    }
  • v2

    3/11/2024
    Open: Version
    Changes from v1 to v2
    +21
    -1
    import { db } from "https://esm.town/v/sqlite/db?v=9";


    @zip

    import { zip } from "https://esm.town/v/pomdtr/sql";
    import { db } from "https://esm.town/v/sqlite/db?v=9";
    import Table from "npm:easy-table";

    export default async function() {
    const res = await db.execute(
    "SELECT author_username, COUNT(*) AS val_count FROM vals GROUP BY author_username ORDER BY 2 DESC LIMIT 10",
    );
    const table = Table.string(zip(res));

    const resp = await fetch("https://sourcecodeshots.com/api/image", {
    method: "POST",
    headers: {
    "Content-Type": "application/json",
    },
    body: JSON.stringify(
    { code: table, language: "text" },
    ),
    });
    if (!resp.ok) {
    throw new Error(await resp.text());
    }
    return new Response(resp.body);
    }
  • v1

    3/11/2024
    Open: Version
    Changes from v0 to v1
    +4
    -0

    import { db } from "https://esm.town/v/sqlite/db?v=9";


    @zip

  • v0

    3/11/2024
    Open: Version
    +0
    -0


1
Next
pomdtr-leaderboard.web.val.run
Updated: March 11, 2024