aboutsummaryrefslogtreecommitdiff
path: root/wikijscmd/util.py
diff options
context:
space:
mode:
authorMark Powers <mark@marks.kitchen>2022-12-17 20:58:41 -0600
committerMark Powers <mark@marks.kitchen>2022-12-17 20:58:41 -0600
commitadf68faa1438212cb745aa07931ca56891af2933 (patch)
tree7baf1018e304294c66d062ca447b0ebc2cad40e5 /wikijscmd/util.py
parent6b8a2bf4328e446c98c08208e15fdaf25f1a9049 (diff)
Add tracker hook
Diffstat (limited to 'wikijscmd/util.py')
-rw-r--r--wikijscmd/util.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/wikijscmd/util.py b/wikijscmd/util.py
index 6720831..e16bf85 100644
--- a/wikijscmd/util.py
+++ b/wikijscmd/util.py
@@ -1,4 +1,5 @@
from wikijscmd import graphql_queries
+from wikijscmd import custom_requests
import subprocess
import re
import os
@@ -57,7 +58,17 @@ def open_editor(action, pathname, initial_body):
return new_body
def args_for_date(date):
- return {
+ obj = {
"path": date.strftime("journal/%Y/%b/%d").lower(),
"title": date.strftime("%B %-d"),
}
+ date_content_json = custom_requests.query_date(date.strftime("%Y-%m-%d"))
+ if date_content_json:
+ date_content = ""
+ for item in date_content_json:
+ if item.get("key"):
+ date_content += f'{item["datatype"]}: {item["key"]}-{item["value"]}\n'
+ else:
+ date_content += f'{item["datatype"]}: {item["value"]}\n'
+ obj["content"] = str(date_content)
+ return obj