| 102 |
|
SYNOPSIS |
| 103 |
|
validate_external_links.sh --help |
| 104 |
|
validate_external_links.sh --links URL --output DIR [--exceptions URL] |
| 105 |
< |
[--record-ok-links] [--suggest-snapshots] [--take-screenshots DIR] |
| 105 |
> |
[--record-ok-links] [--suggest-snapshots] [--take-screenshots FILE] |
| 106 |
|
[--start-url NUM] [--end-url NUM] [--upload FILE] |
| 107 |
|
|
| 108 |
|
DESCRIPTION |
| 123 |
|
(--output). All other arguments are optional. |
| 124 |
|
|
| 125 |
|
OPTIONS |
| 126 |
< |
--help Show this page. |
| 127 |
< |
--links URL (required) URL from which to download the CSV file |
| 128 |
< |
with external links. Note that this URL can be a |
| 129 |
< |
local file if you supply a file:// path. |
| 130 |
< |
--output DIR (required) Place the folder which will contain the |
| 131 |
< |
reports and optional screenshots at this (Unix- |
| 132 |
< |
format) path. |
| 133 |
< |
--exceptions URL In order to remove links from the report which Val |
| 134 |
< |
finds an issue with, but which you regard as OK, |
| 135 |
< |
list those desired exceptions in this file. See |
| 136 |
< |
the sample file exceptions.txt for details. Note |
| 137 |
< |
that this text file can be a local file if you |
| 138 |
< |
supply a file:// path. |
| 139 |
< |
--record-ok-links Log a link in the report even if its response code |
| 140 |
< |
is "OK". |
| 141 |
< |
--suggest-snapshots Query the Internet Archive for a possible snapshot |
| 142 |
< |
URL for each "NG" page. |
| 143 |
< |
--take-screenshots DIR Use the copy of Google Chrome at this path to take |
| 144 |
< |
screenshots of each "OK" page. |
| 145 |
< |
--start-url NUM Start at this link in the link dump CSV file. |
| 146 |
< |
--end-url NUM Stop at this link in the link dump CSV file. |
| 147 |
< |
--upload FILE Upload report using the credentials in this local |
| 148 |
< |
text file. See sftp_login.txt for example. |
| 126 |
> |
--help Show this page. |
| 127 |
> |
--links URL (required) URL from which to download the CSV |
| 128 |
> |
file with external links. Note that this URL can |
| 129 |
> |
be a local file if you supply a file:// path. |
| 130 |
> |
--output DIR (required) Unix path to directory in which Val |
| 131 |
> |
should place its reports. |
| 132 |
> |
--exceptions URL In order to remove links from the report which |
| 133 |
> |
Val finds an issue with, but which you regard as |
| 134 |
> |
OK, list those desired exceptions in this file. |
| 135 |
> |
See the sample file exceptions.txt for details. |
| 136 |
> |
Note that this URL can point to a local file if |
| 137 |
> |
you supply a file:// path. |
| 138 |
> |
--record-ok-links Log a link in the report even if its response |
| 139 |
> |
code is "OK". |
| 140 |
> |
--suggest-snapshots Query the Internet Archive for a possible |
| 141 |
> |
snapshot URL for each "NG" page. |
| 142 |
> |
--take-screenshots FILE Call the Google Chrome binary at this path to |
| 143 |
> |
take screenshots of each "OK" page. |
| 144 |
> |
--start-url NUM Start at this link in the links CSV file. |
| 145 |
> |
--end-url NUM Stop at this link in the links CSV file. |
| 146 |
> |
--upload FILE Upload report using the credentials and path |
| 147 |
> |
given in this local text file. See sftp_login.txt |
| 148 |
> |
for template. |
| 149 |
|
|
| 150 |
|
BUGS |
| 151 |
|
The script cannot properly parse any line in the external links file |
| 866 |
|
valPrint hn "<tr><td colspan=\"2\" align=\"right\">Server suggests</td><td><a href=\"$NEW_URL\" target=\"_blank\">$NEW_URL</a></td></tr>" |
| 867 |
|
fi |
| 868 |
|
|
| 869 |
– |
# Get everything after domain name in URL for use in EI and IW listings |
| 870 |
– |
POST_DOMAIN=${URL#*://*/} |
| 871 |
– |
|
| 869 |
|
# Notify reader if we can use an intrawiki link for this URL |
| 870 |
|
if [ $STATUS == "EI" ]; then |
| 871 |
< |
valPrint t " Just use [[$POST_DOMAIN]]" |
| 872 |
< |
valPrint r " Just use [[$POST_DOMAIN]]" |
| 873 |
< |
valPrint hn "<tr><td colspan=\"2\" align=\"right\">Just use</td><td>[[$POST_DOMAIN]]</td></tr>" |
| 871 |
> |
INTRA_PAGE=${URL#*://*/} |
| 872 |
> |
valPrint t " Just use [[$INTRA_PAGE]]" |
| 873 |
> |
valPrint r " Just use [[$INTRA_PAGE]]" |
| 874 |
> |
valPrint hn "<tr><td colspan=\"2\" align=\"right\">Just use</td><td>[[$INTRA_PAGE]]</td></tr>" |
| 875 |
|
fi |
| 876 |
|
|
| 877 |
|
# Notify reader if we can use an interwiki prefix for this URL |
| 878 |
|
if [ $STATUS == "IW" ]; then |
| 879 |
< |
valPrint t " You can use [[${INTERWIKI_PREFIXES[$INTERWIKI_INDEX]}:$POST_DOMAIN]]" |
| 880 |
< |
valPrint r " You can use [[${INTERWIKI_PREFIXES[$INTERWIKI_INDEX]}:$POST_DOMAIN]]" |
| 881 |
< |
valPrint hn "<tr><td colspan=\"2\" align=\"right\">You can use</td><td>[[${INTERWIKI_PREFIXES[$INTERWIKI_INDEX]}:$POST_DOMAIN]]</td></tr>" |
| 879 |
> |
INTER_PAGE=$(echo "$URL" | sed 's/.*\///') |
| 880 |
> |
valPrint t " You can use [[${INTERWIKI_PREFIXES[$INTERWIKI_INDEX]}:$INTER_PAGE]]" |
| 881 |
> |
valPrint r " You can use [[${INTERWIKI_PREFIXES[$INTERWIKI_INDEX]}:$INTER_PAGE]]" |
| 882 |
> |
valPrint hn "<tr><td colspan=\"2\" align=\"right\">You can use</td><td>[[${INTERWIKI_PREFIXES[$INTERWIKI_INDEX]}:$INTER_PAGE]]</td></tr>" |
| 883 |
|
fi |
| 884 |
|
|
| 885 |
|
# Query Internet Archive for latest "OK" snapshot for "NG" page |