]> git.nbdom.net Git - nb.git/commitdiff
lib/postgres/hostads.sql
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 2 Jan 2020 12:45:23 +0000 (12:45 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 2 Jan 2020 12:45:23 +0000 (12:45 +0000)
lib/postgres/hostads.sql
lib/postgres/lang.sh [new file with mode: 0755]
lib/postgres/lang.sql

index d69bb3b3843b087c66928015ce33075fe2417e2d..8ea15da005b037285795f641b4ff576e72de4212 100644 (file)
@@ -4,5 +4,5 @@ CREATE TABLE IF NOT EXISTS hostads (
 );
 BEGIN TRANSACTION;
 DELETE FROM hostads;
-COPY hostads FROM PROGRAM 'curl -s http://pgl.yoyo.org/adservers/serverlist.php?hostformat=nohtml' WITH (format 'text', NULL ''); 
+COPY hostads FROM PROGRAM 'curl -s https://pgl.yoyo.org/adservers/serverlist.php?hostformat=nohtml' WITH (format 'text', NULL ''); 
 COMMIT;
diff --git a/lib/postgres/lang.sh b/lib/postgres/lang.sh
new file mode 100755 (executable)
index 0000000..64e624c
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+curl -s http://download.geonames.org/export/dump/iso-languagecodes.txt \
+| tail -n +2 \
+| cut -f 1,4 \
+| sed -e "s/ *(.*$//" -e "s/\tModern /\t/" \
+| grep -Ev '^\s' \
+;
index 366cdf6f352ec9dc1e1594501cdef63c3e7b8daf..410a471939a700ade385c7556fed68b31639c9aa 100644 (file)
@@ -3,11 +3,11 @@ CREATE TABLE IF NOT EXISTS lang (
   id char(3) PRIMARY KEY,
   name varchar(60)
 );
-BEGIN TRANSACTION;
-DELETE FROM lang;
-COPY lang FROM PROGRAM 'curl -s http://download.geonames.org/export/dump/iso-languagecodes.txt \
-| tail -n +2 \
-| cut -f 1,4 \
-| sed -e "s/ *(.*$//" -e "s/\tModern /\t/"
-' WITH (format 'text', NULL '');
-COMMIT;
+-- NB 02.12.19 BEGIN TRANSACTION;
+-- NB 02.12.19 DELETE FROM lang;
+-- NB 02.12.19 COPY lang FROM PROGRAM 'curl -s http://download.geonames.org/export/dump/iso-languagecodes.txt \
+-- NB 02.12.19 | tail -n +2 \
+-- NB 02.12.19 | cut -f 1,4 \
+-- NB 02.12.19 | sed -e "s/ *(.*$//" -e "s/\tModern /\t/"
+-- NB 02.12.19 ' WITH (format 'text', NULL '');
+-- NB 02.12.19 COMMIT;