From 92690f0f9341f41c6a077b622eb9637dc7a55ee4 Mon Sep 17 00:00:00 2001 From: elioat Date: Sat, 10 Dec 2022 14:31:15 -0500 Subject: lil bit of clean up --- src/catalogue.lil | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') 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 \"[^<]*\" | 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] -- cgit 1.4.1-2-gfad0