]> git.nbdom.net Git - nb.git/commitdiff
lib/postgres/css_entity.sql
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 19 Jun 2018 22:14:19 +0000 (23:14 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Tue, 19 Jun 2018 22:14:19 +0000 (23:14 +0100)
lib/postgres/css_entity.sql [new file with mode: 0644]

diff --git a/lib/postgres/css_entity.sql b/lib/postgres/css_entity.sql
new file mode 100644 (file)
index 0000000..e1d27db
--- /dev/null
@@ -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;