From 957d7789042969aa8712c27abb0825512c4cd97d Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Fri, 1 Nov 2019 15:36:16 +0000 Subject: [PATCH] /opt/nb/lib/postgres/mime.sql --- lib/postgres/mime.sql | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/postgres/mime.sql b/lib/postgres/mime.sql index 0892914a..f5f05716 100644 --- a/lib/postgres/mime.sql +++ b/lib/postgres/mime.sql @@ -707,15 +707,8 @@ SELECT '>developer.mozilla.org' as log; DELETE FROM tmp_mime; COPY tmp_mime FROM PROGRAM 'true && curl -s \ https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types \ -| tr -d "\n" \ -| sed "s/\\\n/\\n/g" \ -| sed -E "s,^(.*?)]+>(.*?)(.*?)$,\2," \ -| sed "s/<.tr>/\n/g" \ -| grep ",\t,g" \ -| sed -E -e "s/ *]*> */,/g" -e "s/,[^\t]+//" -e "s, *<[^>]+> *,,g" -e "s/^[\t ]*//" -e "s/([^\t]+)\t([^\t]+)$/\2\t\1/" \ -| perl -pe "0 and /^([^\t]+,[^\t]+)/ and @_=split(qq|,|,\$_) and s/^[^\t]+/join(qq|,|,sort {length(\$b)<=>length(\$a)} @_)/e" \ -| sed -e "s/^\.//" \ +| xmllint --html --xpath "/html/body//table[@class=\"standard-table\"]" - 2>/dev/null |html2csv - \ +| tail -n+2 | \ ' WITH (format 'text', NULL ''); INSERT INTO mime SELECT * FROM tmp_mime ON CONFLICT DO NOTHING; -- 2.47.3