Changeset 1178 for Validate External Links
- Timestamp:
- Jan 23, 2023, 2:51:32 AM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Validate External Links/validate_external_links.sh
r1177 r1178 48 48 49 49 # Fixed strings -- see the occurrences of these variables to learn their purpose 50 AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/10 3.0.5060.134Safari/537.36"50 AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36" 51 51 ARCHIVE_API="http://archive.org/wayback/available" 52 52 ARCHIVE_GENERIC="https://web.archive.org/web/*" … … 77 77 declare -a OK_CODES=(200 401 405 406 418 501) 78 78 declare -a RD_CODES=(301 302 303 307 308) 79 declare -a NG_CODES=(000 400 403 404 410 429 500 502 503 504 5 30)79 declare -a NG_CODES=(000 400 403 404 410 429 500 502 503 504 520 530) 80 80 81 81 # Characters not allowed in a URL. Curly braces are sometimes used on the wiki to build a link using … … 124 124 ### HELP OUTPUT ### 125 125 # A pseudo-man page. Here is the 80-character rule for the page text: 126 # 234567890123456789012345678901234567890123456789012345678901234567890123456789126 # 345678901234567890123456789012345678901234567890123456789012345678901234567890 127 127 function printHelp() 128 128 { … … 535 535 if [ $LINKS_PROCESSED -gt 0 ]; then valPrint ctrh "$LINKS_PROCESSED processed $(pluralCheckNoun link $LINKS_PROCESSED):"; fi 536 536 if [ $LINK_ERRORS -gt 0 ]; then valPrint ctrh "- $LINK_ERRORS $(pluralCheckNoun link $LINK_ERRORS) could not be processed"; fi 537 if [ $SKIP_ARCHIVES -gt 0 ]; then valPrint ctrh "- $SKIP_ARCHIVES archive.org/archive.is $(pluralCheckNoun link $SKIP_ARCHIVES) werenot checked"; fi537 if [ $SKIP_ARCHIVES -gt 0 ]; then valPrint ctrh "- $SKIP_ARCHIVES archive.org/archive.is $(pluralCheckNoun link $SKIP_ARCHIVES) $(pluralCheckWas $SKIP_ARCHIVES) not checked"; fi 538 538 if [ $LINK_PROBLEMS_TOTAL -gt 0 ]; then valPrint ctrh "- $LINK_PROBLEMS_TOTAL processed $(pluralCheckNoun link $LINK_PROBLEMS_TOTAL) had $(pluralCheckAn $LINK_PROBLEMS_TOTAL)$(pluralCheckNoun issue $LINK_PROBLEMS_TOTAL)"; fi 539 539 if [ $LINKS_EXCEPTED -gt 0 ]; then valPrint ctr " (excepted $LINKS_EXCEPTED link $(pluralCheckNoun issue $LINKS_EXCEPTED) from report)"; valPrint h " (excepted $LINKS_EXCEPTED $(pluralCheckNoun link $LINKS_EXCEPTED) from report)"; fi … … 1137 1137 EXCEPT_URL="${EXCEPT_LINE#*,}" 1138 1138 EXCEPT_URL="${EXCEPT_URL%,*}" 1139 if [ "$EXCEPT_URL" != "$URL" ]; then 1140 continue 1139 if [[ "$EXCEPT_URL" =~ \* ]]; then # if this exception URL contains the '*' wildcard, use pattern-matching with it 1140 if [[ "$URL" =~ "$EXCEPT_URL" ]]; then 1141 continue 1142 fi 1143 else 1144 if [ "$EXCEPT_URL" != "$URL" ]; then # otherwise just use a straight string comparison 1145 continue 1146 fi 1141 1147 fi 1142 1148
Note:
See TracChangeset
for help on using the changeset viewer.