simplify and fix fetching chrome version after some wikipedia format change

This commit is contained in:
Albert S. 2019-11-10 09:50:31 +01:00
parent 39e724dc90
commit 7667d32191
1 changed files with 1 additions and 1 deletions

View File

@ -5,7 +5,7 @@ echo "usage: $0 url output" 1>&2
exit 1
fi
if find "$RANDRSS_ROOT/fetchers/chrome_version" -mtime +1 | grep -q chrome_version ; then
curl "https://en.wikipedia.org/w/index.php?title=Template:Latest_stable_software_release/Google_Chrome&action=edit" | grep version1 | sed -e 's/.*version1 = \([0-9][0-9]\).\([0-9]\)\+.\([0-9]\+\)\.\([0-9]\+\)..*/\1.\2.\3.\4/g' > /"$RANDRSS_ROOT/fetchers/chrome_version"
curl "https://en.wikipedia.org/w/index.php?title=Template:Latest_stable_software_release/Google_Chrome&action=edit" | grep version1 | awk '{print $4}' | sed -e 's/[^0-9.]//g' > /"$RANDRSS_ROOT/fetchers/chrome_version"
fi
VERSION=$(cat "$RANDRSS_ROOT/fetchers/chrome_version")
useragent=$(shuf -n 1 $RANDRSS_ROOT/fetchers/chrome_agents | sed -e "s/VERSION/$VERSION/g")