about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorelioat <elioat@tilde.institute>2022-12-10 14:14:32 -0500
committerelioat <elioat@tilde.institute>2022-12-10 14:14:32 -0500
commitad53189f13036f268ebbb03e261848a018fd3897 (patch)
tree750d9c80519afdc8abcc1b09444ba5709df2e565
parent1a8b726c84eba5046d499bd4cbe24b65c8bb5e80 (diff)
downloaddecember-2022-ad53189f13036f268ebbb03e261848a018fd3897.tar.gz
our powers combine
-rw-r--r--src/catalogue.lil35
-rw-r--r--src/test.csv9
2 files changed, 15 insertions, 29 deletions
diff --git a/src/catalogue.lil b/src/catalogue.lil
index da542bb..0129360 100644
--- a/src/catalogue.lil
+++ b/src/catalogue.lil
@@ -28,26 +28,20 @@
 # NOTE: I'm using just 1 table so that this can be easily exported as CSV...
 # if it weren't for that requirement, I'd have multiple tables
 
-catalogue.entry_type:"folder","folder","note","link","link"
-catalogue.parent:0,0,0,0,0 # QUESTION: how to reference other entries by IDs
-catalogue.title:"read","to read","what an idea","Oatmeal","sans"
-catalogue.body:0,0,"what if I made a lil cli",0,0
-catalogue.reference:0,0,0,"https://eli.li","https://smallandnearlysilent.com"
-catalogue.created_date:"2022-12-07","2022-12-07","2022-12-07","2022-12-07","2022-12-07"
-catalogue:table catalogue
+# catalogue:table catalogue
 
 # alternate syntax to make a table, 
 # t: insert food:("Eggs","Pancakes","Grapefruit") quantity:(3,4,1) tasty:(1,1,0) into 0
 
 # validate that I can write a table to disk and read it back in
-show[catalogue]
-out:writecsv[catalogue]
-show[out]
-write["test.csv" out]
-
-data:read["test.csv"]
-newtable:readcsv[data "sissss"] # this column spec. syntax looks hilarious
-show[newtable]
+# show[catalogue]
+# out:writecsv[catalogue]
+# show[out]
+# write["test.csv" out]
+
+# data:read["test.csv"]
+# newtable:readcsv[data "sis "] # this column spec. syntax looks hilarious
+# show[newtable]
 # HUGE SUCCESS!
 
 # Not sure how to programmatically access/view the implicit ID column...or if that is wise?
@@ -56,22 +50,17 @@ show[newtable]
 
 on entry d t do
 	date_fmt_string:"date +%Y-%m-%d | tr -d '\n'"
-	t:insert entry_type:(d.entry_type) title:(d.title) created_date:(shell[date_fmt_string].out) into t
+	wget_fmt_string:"wget -qO- " , d.url , " | grep -o \"<title>[^<]*\" | sed -e 's/<[^>]*>//g' | tr -d '\n'"
+	t:insert title:(shell[wget_fmt_string].out) reference:(d.url) created_date:(shell[date_fmt_string].out) into t
 end
 
 # where d is a table representing a new row to be added to t, an existing table
 
-row.entry_type:"note"
-row.title:"in which we test adding a row with a function"
+row.url:"https://smallandnearlysilent.com"
 row:table row
 test:entry[row catalogue]
 
 show[test] # NOTE, keep in mind that this generates a totally new table
 
-
-do search q t do
-	t:select name where ("Alice" = name) from people
-end
-
 # HOLD UP! I've over complicated things; I'm going to shift gears, make this projects
 # only focused on link logging, not a general purpose DB.
\ No newline at end of file
diff --git a/src/test.csv b/src/test.csv
index cfb85c6..8b04c72 100644
--- a/src/test.csv
+++ b/src/test.csv
@@ -1,6 +1,3 @@
-entry_type,parent,title,body,reference,created_date
-folder,0,read,0,0,2022-12-07
-folder,0,to read,0,0,2022-12-07
-note,0,what an idea,what if I made a lil cli,0,2022-12-07
-link,0,Oatmeal,0,https://eli.li,2022-12-07
-link,0,sans,0,https://smallandnearlysilent.com,2022-12-07
\ No newline at end of file
+reference,created_date
+https://eli.li,2022-12-07
+https://smallandnearlysilent.com,2022-12-07
\ No newline at end of file