Merge pull request #1177 from simon04/fix-get_latest_version

Fix get_latest_version for various scrapers
pull/1298/head
Simon Legner 4 years ago committed by GitHub
commit 3a3d5d433b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -71,7 +71,7 @@ module Docs
def get_latest_version(opts) def get_latest_version(opts)
doc = fetch_doc('https://docs.ansible.com/ansible/latest/index.html', opts) doc = fetch_doc('https://docs.ansible.com/ansible/latest/index.html', opts)
doc.at_css('.DocSiteProduct-CurrentVersion').content.strip doc.at_css('.version').content.strip
end end
end end
end end

@ -33,7 +33,7 @@ module Docs
def get_latest_version(opts) def get_latest_version(opts)
doc = fetch_doc('https://api.dartlang.org/', opts) doc = fetch_doc('https://api.dartlang.org/', opts)
label = doc.at_css('footer > span').content.strip label = doc.at_css('footer > span').content.strip
label.sub(/Dart /, '') label.sub(/Dart\s*/, '')
end end
end end
end end

@ -37,5 +37,11 @@ module Docs
Distributed under the <a href="https://sourceforge.net/p/gnuplot/gnuplot-main/ci/master/tree/Copyright">gnuplot license</a> (rights to distribute modified versions are withheld). Distributed under the <a href="https://sourceforge.net/p/gnuplot/gnuplot-main/ci/master/tree/Copyright">gnuplot license</a> (rights to distribute modified versions are withheld).
HTML HTML
def get_latest_version(opts)
doc = fetch_doc('http://www.gnuplot.info/download.html', opts)
label = doc.at_css('h2').content.strip
label.sub(/[^0-9.]*/, '')
end
end end
end end

@ -62,9 +62,7 @@ module Docs
end end
def get_latest_version(opts) def get_latest_version(opts)
doc = fetch_doc('http://pandas.pydata.org/pandas-docs/stable/', opts) get_latest_github_release('pandas-dev', 'pandas', opts)
label = doc.at_css('.body > .section > p').content
label.scan(/Version: ([0-9.]+)/)[0][0]
end end
end end
end end

Loading…
Cancel
Save