summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2018-02-13 13:14:17 -0500
committerbill-auger <mr.j.spam.me@gmail.com>2020-03-14 19:11:02 -0400
commitfc5a688646870f7d352ccd2103e625a1a288b6af (patch)
tree4a16349a48fbcadbf278e34afa8b54ff96c0d02a
parentbe572e4ed425c2aaf7b45a030d6dc022f7e102b3 (diff)
[find_fsd_pages]: add fsd search scriptwiki-post
-rw-r--r--.gitignore1
-rwxr-xr-xfind_fsd_pages24
2 files changed, 25 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 2f300aa..1b9e96b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@
!blacklist.txt
!check.sh
!COPYING
+!find_fsd_pages
!find-replacements
!post_fsd_wiki.phantomjs
!README
diff --git a/find_fsd_pages b/find_fsd_pages
new file mode 100755
index 0000000..31a9641
--- /dev/null
+++ b/find_fsd_pages
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+
+readonly WIKI_BASE_URL=https://directory.fsf.org/wiki
+readonly BLACKLIST_URL=https://git.parabola.nu/blacklist.git/plain
+readonly BLACKLIST_FILE=blacklist.txt
+
+
+wget $BLACKLIST_URL/$BLACKLIST_FILE
+[ ! -f ./$BLACKLIST_FILE ] && echo "download failed" && exit 1
+
+
+readonly PACKAGES=$(grep '^\s*[^:#]*:.*' ./$BLACKLIST_FILE | \
+ sed 's/^\s*\([^:#]*\):.*/\1/ ; s/^./\U&/g ; s/-./\U&/g ; s/-/_/g')
+
+for package in $PACKAGES
+do status=$(curl -s -o /dev/null -w "%{http_code}" $WIKI_BASE_URL/$package)
+ if [ "$status" == '200' ]
+ then echo "$package entry exists"
+ elif [ "$status" == '404' -o "$status" == '301' ]
+ then echo "$package entry not found"
+ else echo "$package unknown response"
+ fi
+done