38 todo("Inserting and Querying Data"),
39 todo("Running Migrations"),
40 todo("SQLite as a KV Database"),
41 todo("Drizzle in Val Town"),
42 ],
38 todo("Inserting and Querying Data"),
39 todo("Running Migrations"),
40 todo("SQLite as a KV Database"),
41 todo("Drizzle in Val Town"),
42 ],
30- [ ] add triggers to sidebar
31- [ ] add upload from SQL, CSV and JSON
32- [ ] add ability to connect to a non-val town Turso database
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
30- [ ] add triggers to sidebar
31- [ ] add upload from SQL, CSV and JSON
32- [ ] add ability to connect to a non-val town Turso database
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
3I wanted to log this data so I can analyse which days do I game the most ? which periods do I log the most hours in my confort game (Dead By Daylight) ? And so on. I think the data viz possibilities are super interesting, just like when Valve releases the "Steam in review" at the end of the year
4
5This val fetches your recent playtime history from valve's API and stores it in a database every day !
6
7The project uses multiple vals to work:
30- [ ] add triggers to sidebar
31- [ ] add upload from SQL, CSV and JSON
32- [ ] add ability to connect to a non-val town Turso database
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
3
4const app = createApp({
5 url: Deno.env.get("TURSO_DATABASE_URL")!,
6 authToken: Deno.env.get("TURSO_AUTH_TOKEN")!,
7});
30- [ ] add triggers to sidebar
31- [ ] add upload from SQL, CSV and JSON
32- [ ] add ability to connect to a non-val town Turso database
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
7import { z } from "npm:zod";
8
9const force_update_database = false; // set force update database to true
10// if you added new items to habitify after running this script
11// for the first time.
390}
391
392async function get_habitify_database()
393{
394 const habits_list = await blob.getJSON("habitify_database");
395 if (!habits_list || force_update_database)
396 {
397 const HABITIFY_API_KEY = process.env.HABITIFY_API_KEY;
441 // Log the result JSON
442 console.log(JSON.stringify(habitsByArea, null, 2));
443 await blob.setJSON("habitify_database", habitsByArea);
444 return habitsByArea;
445 } catch (error) {
455
456export default async function(interval: Interval) {
457 const habits_list = await get_habitify_database();
458 var tasks = await todoistapi.getTasks({
459 projectId: add_to_habitify_todoist_project_id,
38}
39
40export async function setupDatabase() {
41 await createTable();
42 const docs = await fetchJSON(thisWebURL());