Changeset 1066 for Validate External Links/validate_external_links.sh
- Timestamp:
- Aug 1, 2017, 4:30:24 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Validate External Links/validate_external_links.sh
r1064 r1066 26 26 27 27 # Fixed strings -- see the occurrences of these variables to learn their purpose 28 AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10 _12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3146.0 Safari/537.36"28 AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:54.0) Gecko/20100101 Firefox/54.0" 29 29 ARCHIVE_API="http://archive.org/wayback/available" 30 30 ARCHIVE_GENERIC="https://web.archive.org/web/*" … … 32 32 CHROME="/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary" 33 33 CHROME_SCREENSHOT="screenshot.png" 34 CURL_CODES="http://iritscen.oni2.net/ wiki/curl_codes.txt"34 CURL_CODES="http://iritscen.oni2.net/val/curl_codes.txt" 35 35 EXPECT_SCRIPT_NAME="val_expect_sftp.txt" 36 HTTP_CODES="http://iritscen.oni2.net/ wiki/http_codes.txt"36 HTTP_CODES="http://iritscen.oni2.net/val/http_codes.txt" 37 37 MY_WIKI_PAGE="http://wiki.oni2.net/User:Iritscen" 38 38 THIS_DIR=$(cd $(dirname $0); pwd) … … 51 51 # These arrays tells us which HTTP response codes are OK (good) and which are NG (no good). Pages that 52 52 # return NG codes will not be screenshotted. Remember to update http_codes.txt if you add a new code. 53 declare -a OK_CODES=(200 301 30 2 307 401 405 406 501)54 declare -a NG_CODES=(000 403 404 410 500 503)53 declare -a OK_CODES=(200 301 307 401 405 406 501) 54 declare -a NG_CODES=(000 302 403 404 410 500 503) 55 55 56 56 # Characters not allowed in a URL. Curly braces are sometimes used on the wiki to build a link using … … 746 746 ARCHIVE_QUERY=$(curl --silent --max-time 10 "$ARCHIVE_API?url=$URL&$ARCHIVE_OK_CODES") 747 747 748 # Isolate "url" property in response and log it if received...749 if [[ "$ARCHIVE_QUERY" == *\" url\":* ]]; then750 SNAPSHOT_URL=${ARCHIVE_QUERY# *\"url\":\"}751 SNAPSHOT_URL=${SNAPSHOT_URL%\", \"timestamp*}748 # Isolate "url" property in response and log it if a "closest" snapshot was received... 749 if [[ "$ARCHIVE_QUERY" == *\"closest\":* ]]; then 750 SNAPSHOT_URL=${ARCHIVE_QUERY##*\"url\": \"} 751 SNAPSHOT_URL=${SNAPSHOT_URL%\", \"timestamp*} 752 752 valPrint t " IA suggests $SNAPSHOT_URL" 753 753 valPrint r " IA suggests {\field{\*\fldinst{HYPERLINK \"$SNAPSHOT_URL\"}}{\fldrslt $SNAPSHOT_URL}}"
Note:
See TracChangeset
for help on using the changeset viewer.