Changeset 1157
- Timestamp:
- May 9, 2021, 11:53:48 PM (3 years ago)
- Location:
- Validate External Links
- Files:
-
- 4 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
Validate External Links/validate_external_links.command
r1150 r1157 22 22 #bash "$VALEXTLINKS" --links "$LINKS_ONLINE" --exceptions "$EXCEPT_ONLINE" --output "$REPORT_DIR" --record-ok-links --suggest-snapshots-ng --end-url 70 23 23 24 # Run with start/end URLs, record OK codes, and don't upload25 #bash "$VALEXTLINKS" --links "$LINKS_ONLINE" --exceptions "$EXCEPT_ONLINE" --output "$REPORT_DIR" --record-ok-links --suggest-snapshots-ng --s tart-url 2588 --end-url 259424 # Run with start/end URLs, record OK codes, suggest OK snapshots, and don't upload 25 #bash "$VALEXTLINKS" --links "$LINKS_ONLINE" --exceptions "$EXCEPT_ONLINE" --output "$REPORT_DIR" --record-ok-links --suggest-snapshots-ng --suggest-snapshots-ok --start-url 2836 --end-url 3300 26 26 27 27 # Run with local extlinks and exceptions, start/end URLs, record OK codes, and don't upload -
Validate External Links/validate_external_links.sh
r1149 r1157 87 87 88 88 # These are parallel arrays giving the prefixes that can be used in place of normal external links to 89 # some wikis and other sites 89 # some wikis and other sites; based on https://wiki.oni2.net/Special:Interwiki 90 90 declare -a INTERWIKI_PREFIXES=(commons metawikimedia mw wikibooks wikidata wikimedia wikinews wikiquote wikisource wikispecies wikiversity wikivoyage wikt wp) 91 91 declare -a INTERWIKI_DOMAINS=(commons.wikimedia.org meta.wikimedia.org mediawiki.org wikibooks.org wikidata.org wikimediafoundation.org wikinews.org wikiquote.org wikisource.org species.wikimedia.org wikiversity.org wikivoyage.org wiktionary.org wikipedia.org) … … 234 234 --end-url ) URL_LIMIT=$2; shift 2;; 235 235 --upload ) UPLOAD_INFO=$2; shift 2;; 236 * ) echo "Invalid argument $1detected. Aborting."; exit 1;;236 * ) echo "Invalid argument '$1' detected. Aborting."; exit 1;; 237 237 esac 238 238 done … … 960 960 961 961 # If this is a YouTube link, we have to look at the actual page source to know if the video 962 # is good or not 962 # is good or not; override the link's info if it's actually NG 963 963 if [[ $URL == *www.youtube.com* ]]; then 964 964 PAGE_TEXT=$(curl --silent --insecure --user-agent '$AGENT' --max-time $TIMEOUT $URL | grep "\"simpleText\":\"Video unavailable\"") 965 965 if [ ! -z "$PAGE_TEXT" ]; then 966 966 STATUS="NG" 967 CURL_RESULT=404 967 968 let OK_LINKS-=1 968 969 let NG_LINKS+=1
Note:
See TracChangeset
for help on using the changeset viewer.