1
0
mirror of https://github.com/libreddit/libreddit-instances.git synced 2025-10-05 18:52:40 +02:00

Scrape version number from any HTML tag with id version

This commit is contained in:
Daniel Valentine
2023-03-08 22:02:38 -07:00
parent 9aad0adb49
commit 8f4dfbe252

View File

@@ -477,7 +477,7 @@ create_instance_entry ()
#
# Future versions of Libreddit may advertise the version in a <meta> tag in
# <head>, but it doesn't right now.
version="$(<<<"${res}" sed -nE 's/.*<span\s+id="version">(v([0-9]+\.){2}[0-9]+).*$/\1/p')"
version="$(<<<"${res}" sed -nE 's/.*\s+id="version">(v([0-9]+\.){2}[0-9]+).*$/\1/p')"
if [[ -z "${version}" ]]
then
return 4