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