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
No known key found for this signature in database
GPG Key ID: C82492E4FF813823

View File

@ -477,7 +477,7 @@ create_instance_entry ()
# #
# Future versions of Libreddit may advertise the version in a <meta> tag in # Future versions of Libreddit may advertise the version in a <meta> tag in
# <head>, but it doesn't right now. # <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}" ]] if [[ -z "${version}" ]]
then then
return 4 return 4