about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/catalogue.lil7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/catalogue.lil b/src/catalogue.lil
index e305f57..b3eb8ba 100644
--- a/src/catalogue.lil
+++ b/src/catalogue.lil
@@ -1,3 +1,5 @@
+csv_db:"test.csv"
+
 on load_db db do
 	data:read[db]
 	out:readcsv[data "sss"]
@@ -13,10 +15,11 @@ on entry d t do
 	date_fmt_string:"date +%Y-%m-%d | tr -d '\n'"
 	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
+	# TODO protect against wget fails
 end
 
 # read in a csv, and store in memory as a table
-catalogue:load_db["test.csv"]
+catalogue:load_db[csv_db]
 
 # add a row to the table stored in memory
 row.url:"https://tenforward.social"
@@ -24,4 +27,4 @@ row:table row
 catalogue:entry[row catalogue]
 
 # write the updated data to csv
-save_db[catalogue "test.csv"]
+save_db[catalogue csv_db]