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());
2
3```ts
4import { setupDatabase } from "https://esm.town/v/stevekrouse/dateme_sqlite"
5
6await setupDatabase()
7```
8
9## Contributing
10
11Forking this repo should mostly work, except for the sqlite database. You'll need to create the table & populate it with some data. [This script](https://www.val.town/v/stevekrouse/dateme_sqlite) *should* do it, but I think it has a couple bugs. If you're interested in contributing to this project contact me or comment on this val and I'll get it working for ya!
12
13## Todos
14
15- [ ] Make the SQLite database forkable and build a widget/workflow for that, ie fix @stevekrouse/dateme_sqlite
16- [ ] Require an email (that isn't shared publicly)
17 - [ ] Verify the email address with a "magic link"