From: Nicolas Boisselier Date: Mon, 5 Jun 2023 11:01:12 +0000 (+0200) Subject: lib/postgres/php_function.sql X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=96927064a825d4256394503ed7932494611dae5a;p=nb.git lib/postgres/php_function.sql --- diff --git a/lib/postgres/php_function.sh b/lib/postgres/php_function.sh new file mode 100755 index 00000000..16a8c63d --- /dev/null +++ b/lib/postgres/php_function.sh @@ -0,0 +1,40 @@ +#!/bin/bash +cd "$(dirname "$0")" || exit 1; +IFS=$'\n' +for i in \ + array \ + "calendar '' 1"\ + "date '' 2"\ + directory \ + "error '' 2"\ + exception \ + "filesystem '' 2"\ + "filter '' 2"\ + "ftp '' 1"\ + "json '' 1"\ + keywords \ + "libxml '' 1"\ + "mail '' 2"\ + "math '' 1"\ + "misc '' 2"\ + mysqli \ + network \ + "output '' 2"\ + "regex '' 2"\ + simplexml \ + stream \ + string \ + variable_handling \ + "xml '' 1"\ + zip \ +; do + + opt=${i#*" "} + [ "$opt" == "$i" ] && opt="" + i=${i%%" "*} + [ -n "$1" -a "$i" != "$1" ] && continue + + echo "- $i $opt" 1>&2 + eval ./w3schools.sh /php/php_ref_${i}.asp $opt | sed "s/^/$i\t/" +done +#./w3schools.sh /php/php_ref_timezones.asp | sed 's/^/timezones\t/' diff --git a/lib/postgres/php_function.sql b/lib/postgres/php_function.sql new file mode 100644 index 00000000..7c49f474 --- /dev/null +++ b/lib/postgres/php_function.sql @@ -0,0 +1,9 @@ +DROP TABLE IF EXISTS php_function; +CREATE TABLE IF NOT EXISTS php_function ( + cat varchar(30), + name varchar(100), + description varchar(500), + link varchar(200), + PRIMARY KEY(cat,name) +); +-- COPY php_function FROM '/home/nico/tmp/csv' WITH (format 'text', NULL ''); diff --git a/lib/postgres/w3schools.sh b/lib/postgres/w3schools.sh index 6047c205..b935823e 100755 --- a/lib/postgres/w3schools.sh +++ b/lib/postgres/w3schools.sh @@ -2,14 +2,17 @@ path=${1:?Usage: $0 /path/ for url https://www.w3schools.com} cut="$2" +num="$3" + url="https://www.w3schools.com$path" preff="$(echo "$url"|sed -E 's,[^/]+\.[^/]+$,,')" #exec echo $preff +#exec echo "<$cut>" http_get "$url" | \ xmllint --format --html --xpath '/html/body//div[@id="main"]//table' - 2>/dev/null | \ grep -Ev '