From: Nicolas Boisselier Date: Wed, 6 Dec 2017 04:36:16 +0000 (+0000) Subject: ./share/db/useragent X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=68a071c7c32b108987a62df6bc360b52f34390f4;p=nb.git ./share/db/useragent --- diff --git a/bin/say b/bin/say index a10b184e..ecf6988c 100755 --- a/bin/say +++ b/bin/say @@ -14,11 +14,10 @@ sub espeak { return $_; } -$_ = qq{ -It was day. -It was sunny. -}; - +#$_ = qq{ +#It was day. +#It was sunny. +#}; #die $_; #open(SAY,"| espeak -v mb-en1+f5 -s 140 -m 2>/dev/null") or die $!; diff --git a/etc/profile.d/net.sh b/etc/profile.d/net.sh index ba6911f8..1e001a20 100644 --- a/etc/profile.d/net.sh +++ b/etc/profile.d/net.sh @@ -28,9 +28,16 @@ cdr2mask() { } html2txt() { - lynx -pseudo_inlines -nomargins -display_charset=utf8 -nocolor -nolist -width=999 -dump $@ + if which lynx > /dev/null; then + lynx -pseudo_inlines -nomargins -display_charset=utf8 -nocolor -nolist -width=999999 -dump "$1" + elif which w3m > /dev/null; then + w3m -dump -cols 999999 "$1" + else + echo "Please install lynx or w3m" 1>&2 + return 1 + fi } xml2csv() { - xsltproc lib/xslt/csv.xslt $@ + xsltproc lib/xslt/xml2csv.xslt $@ } diff --git a/lib/xslt/csv.xslt b/lib/xslt/csv.xslt deleted file mode 100644 index 5da10f5a..00000000 --- a/lib/xslt/csv.xslt +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/xslt/xml2csv.xslt b/lib/xslt/xml2csv.xslt new file mode 100644 index 00000000..5da10f5a --- /dev/null +++ b/lib/xslt/xml2csv.xslt @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/share/db/http_status b/share/db/http_status index 2cae0465..1d8837ee 100755 --- a/share/db/http_status +++ b/share/db/http_status @@ -1,7 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; -@ARGV = ('w3m -dump -cols 10000 https://en.wikipedia.org/wiki/List_of_HTTP_status_codes |'); +@ARGV = ('bash --login -c "html2txt https://en.wikipedia.org/wiki/List_of_HTTP_status_codes" |'); while (<>) { next unless /^\d\d\d / .. /^ /; diff --git a/share/db/nb.db b/share/db/nb.db index 30236da3..c354813c 100644 Binary files a/share/db/nb.db and b/share/db/nb.db differ diff --git a/share/db/useragent b/share/db/useragent index b5806d94..c410f15e 100755 --- a/share/db/useragent +++ b/share/db/useragent @@ -1,3 +1,3 @@ -#!/bin/sh +#!/usr/bin/env bash [ -n "$NB_ROOT" ] || . "$(dirname "$0")/../../etc/profile" || exit -xsltproc $NB_ROOT/lib/xslt/csv.xslt http://www.user-agents.org/allagents.xml +xml2csv http://www.user-agents.org/allagents.xml diff --git a/share/db/useragent.sql b/share/db/useragent.sql new file mode 100644 index 00000000..ba581c82 --- /dev/null +++ b/share/db/useragent.sql @@ -0,0 +1,15 @@ +DROP TABLE IF EXISTS useragent; +CREATE TABLE IF NOT EXISTS useragent ( + id INT PRIMARY KEY, + string VARCHAR(500), + description VARCHAR(2000), + type VARCHAR(20), + comment VARCHAR(100), + link1 VARCHAR(1000), + link2 VARCHAR(1000) +); + +BEGIN TRANSACTION; +.separator \t +.import "useragent.csv" useragent +COMMIT;