From 58714011d3647c3b4b8bcfaeb7ea9283fe6a19ba Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Tue, 19 Jun 2018 23:14:19 +0100 Subject: [PATCH] lib/postgres/css_entity.sql --- lib/postgres/css_entity.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/postgres/css_entity.sql diff --git a/lib/postgres/css_entity.sql b/lib/postgres/css_entity.sql new file mode 100644 index 00000000..e1d27db5 --- /dev/null +++ b/lib/postgres/css_entity.sql @@ -0,0 +1,16 @@ +DROP TABLE IF EXISTS css_entity; +CREATE TABLE IF NOT EXISTS css_entity ( + entity char(4) PRIMARY KEY, + chr varchar(2), + name varchar(200) +); +BEGIN TRANSACTION; +DELETE FROM css_entity; +COPY css_entity (chr,entity,name) FROM PROGRAM '. /etc/profile && \ +http_get https://www.w3schools.com/cssref/css_entities.asp | \ +xmllint --html --xpath "/html/body//div[@id=\"main\"]//table" - 2>/dev/null | \ +xml2csv - | \ +tail -n+2 | \ +sed -E "s,(\\\\),\\\\\1," \ +' WITH (format 'text', NULL ''); +COMMIT; -- 2.47.3