cldwalker
01/12/2023, 7:00 PMdanzu
01/12/2023, 8:32 PMcannibalox
01/12/2023, 10:08 PMcliffordx
01/13/2023, 5:43 AMERROR ! ReferenceError: fetch is not defined
installed both node-fetch
and cross-fetch
. entered config.js
correctly.cliffordx
01/13/2023, 5:44 AMsaveFilePath
is this correct for Mac? saveFilePath: "file:///Users/xxx/xxx/pages/"
drawingthesun
01/13/2023, 12:36 PMalxlg
01/13/2023, 12:55 PMpatrick.py
01/14/2023, 7:05 PMbad3r
01/14/2023, 8:33 PMpatrick.py
01/14/2023, 8:34 PMednico
01/15/2023, 1:27 PMrlhk
01/16/2023, 9:35 AMbad3r
01/16/2023, 9:40 AMkcm2dmdpF
01/17/2023, 9:53 AM(clojure.string/starts-with?...
work out of the box?
* Did you retrospectively find a solution for the date logic issue?siferiax
01/17/2023, 12:15 PM#+BEGIN_QUERY
{:title [:h2 "Last contact"]
:query [:find ?name ?interval (max ?day)
:keys name interval day
:where
[?jp :block/journal-day ?day]
[?mention :block/page ?jp]
[?mention :block/refs ?person]
[?person :block/original-name ?name] ; gets the name of the page as displayed in Logseq.
[?person :block/properties ?prop] ; I'm assuming the use of a page-property here. (i.e. first block on the page)
[(get ?prop :contact) ?interval]
]
:result-transform (fn [result]
(sort-by
(juxt
(fn [i] (get i :interval))
(fn [d] (get d :day))
) result)
)
:view (fn [rows]
[:table
[:thead [:tr
[:th "Name"]
[:th "Interval"]
[:th "Date"]
] ]
[:tbody (for [r rows] [:tr
[:td [:a {:href (str "#/page/" (get r :name))} (get r :name)]]
[:td (get r :interval)]
[:td (get r :day)]
] ) ]
]
)
}
#+END_QUERY
Nowadays query tables are build in, so the admin query is a lot simpler this way.
#+BEGIN_QUERY
{:title [:h2 "Persons list"]
:query [:find (pull ?p [*])
:where
[?p :page/name ?name]
[(clojure.string/starts-with? ?name "@")]
; [?p :block/properties ?prop]
; [(get ?prop :contact)] ; optional, only needed if you have @ pages without property contact that you want to exclude.
]
}
#+END_QUERY
siferiax
01/17/2023, 12:17 PMkcm2dmdpF
01/17/2023, 8:18 PMcontact:: month
in the first block on that page (I can add other properties in that same block as well)
I get @John Doe
in the persons list. If I additionally
* Link to [[@John Doe]]
on one or multiple Journal pages, John Doe comes up in the "Last contact" list with the most recent journal page's date.
This is really good, and thanks to copy & paste very simple; thank you! (omg, no idea how many weeks it would have taken me and how many hairs I had lost to write this query all by myself...)
What you suggest in terms of "write something where it gives a list of people that you haven't contacted in the timespan assigned to them", that'd really bring it to the top. It'd mean, we would have a page that tells us straight away whom to contact. I'd not know how to do this, especially without date comparisons. Sure; any help would be greatly appreciated!bad3r
01/17/2023, 10:00 PMsiferiax
01/18/2023, 7:40 AM#+BEGIN_QUERY
{:title [:h2 "Longer than 7 days"]
:query [:find (pull ?person [*])
:in $ ?dl
:where
; all people with a weekly contact interval
[?person :block/original-name ?name]
[?person :block/properties ?prop]
[(get ?prop :contact) ?interval]
[(= ?interval "weekly")]
; who are not mentioned on journal pages of the last 7 days
(not [?mention :block/refs ?person]
[?mention :block/page ?jp]
[?jp :block/journal-day ?day]
[(>= ?day ?dl)])
]
:inputs [:7d] ; only accepts dynamic days
}
#+END_QUERY
siferiax
01/18/2023, 7:40 AMsiferiax
01/18/2023, 8:21 AMkcm2dmdpF
01/18/2023, 8:53 AMsiferiax
01/18/2023, 8:55 AMednico
01/28/2023, 2:30 PMsiferiax
01/28/2023, 2:36 PMednico
01/28/2023, 2:38 PMmaxatoms
01/29/2023, 10:46 PMphoenix5939
01/30/2023, 2:25 AMbad3r
01/30/2023, 1:30 PMBailey Jennings
10/07/2021, 1:12 AM