Fix multiple version checks of scrapers.
Unified · Split
| @@ -96,7 +96,7 @@ module Docs · 95 unmodified lines | ||
| 96 | 96 | |
| 97 | 97 | def get_latest_version(opts) |
| 98 | 98 | doc = fetch_doc('https://docs.docker.com/engine/release-notes/', opts) |
| 99 | − latest_version = doc.at_css('.DocSearch-content > h2 > a').content.strip | |
| 99 | + latest_version = doc.at_css('h2.scroll-mt-20 > a').content.strip | |
| 100 | 100 | latest_version.rpartition(' ')[-1] |
| 101 | 101 | end |
| 102 | 102 | end |
| @@ -47,8 +47,7 @@ module Docs · 46 unmodified lines | ||
| 47 | 47 | end |
| 48 | 48 | |
| 49 | 49 | def get_latest_version(opts) |
| 50 | − doc = fetch_doc('https://docs.meteor.com/#/full/', opts) | |
| 51 | − doc.at_css('select.version-select > option').content | |
| 50 | + get_npm_version('meteor', opts) | |
| 52 | 51 | end |
| 53 | 52 | end |
| 54 | 53 | end |
| @@ -23,9 +23,7 @@ module Docs · 22 unmodified lines | ||
| 23 | 23 | |
| 24 | 24 | def get_latest_version(opts) |
| 25 | 25 | doc = fetch_doc('https://nixos.org/manual/nix/stable/', opts) |
| 26 | − json = JSON.parse(doc.at_css('body')['data-nix-channels']) | |
| 27 | − channel = json.find { |c| c['channel'] == 'stable' } | |
| 28 | − channel['version'] | |
| 26 | + doc.at_css('a.active')['href'].scan(/([0-9.]+)/)[0][0] | |
| 29 | 27 | end |
| 30 | 28 | end |
| 31 | 29 | end |
| @@ -77,8 +77,8 @@ module Docs · 76 unmodified lines | ||
| 77 | 77 | |
| 78 | 78 | def get_latest_version(opts) |
| 79 | 79 | doc = fetch_doc('https://phpunit.readthedocs.io/', opts) |
| 80 | − label = doc.at_css('.rst-current-version').content.strip | |
| 81 | − label.scan(/v: ([0-9.]+)/)[0][0] | |
| 80 | + label = doc.at_css('meta[name="readthedocs-version-slug"]')["content"] | |
| 81 | + label | |
| 82 | 82 | end |
| 83 | 83 | |
| 84 | 84 | end |
| @@ -22,8 +22,7 @@ module Docs · 21 unmodified lines | ||
| 22 | 22 | |
| 23 | 23 | def get_latest_version(opts) |
| 24 | 24 | body = fetch('http://download.redis.io/redis-stable/00-RELEASENOTES', opts) |
| 25 | − body = body.lines[1..-1].join | |
| 26 | − body.scan(/Redis ([0-9.]+)/)[0][0] | |
| 25 | + body.scan(/Redis Community Edition ([0-9.]+)/)[0][0] | |
| 27 | 26 | end |
| 28 | 27 | |
| 29 | 28 | private |
| @@ -20,13 +20,13 @@ module Docs · 19 unmodified lines | ||
| 20 | 20 | © 2006–2024 the Sass team, and numerous contributors<br> |
| 21 | 21 | Licensed under the MIT License. |
| 22 | 22 | HTML |
| 23 | − | |
| 24 | − private | |
| 25 | 23 | |
| 26 | 24 | def get_latest_version(opts) |
| 27 | 25 | get_npm_version('sass', opts) |
| 28 | 26 | end |
| 29 | 27 | |
| 28 | + private | |
| 29 | + | |
| 30 | 30 | def parse(response) |
| 31 | 31 | response.body.gsub! '<span class="widont"> </span>', ' ' |
| 32 | 32 | end |
| @@ -25,7 +25,7 @@ module Docs · 24 unmodified lines | ||
| 25 | 25 | |
| 26 | 26 | def get_latest_version(opts) |
| 27 | 27 | doc = fetch_doc('https://trio.readthedocs.io/en/stable/', opts) |
| 28 | − doc.at_css('.rst-other-versions a[href^="/en/v"]').content[1..-1] | |
| 28 | + doc.at_css('div.trio-version').content[0..-1] | |
| 29 | 29 | end |
| 30 | 30 | end |
| 31 | 31 | end |