History

Migrate c scraper from filescraper to urlscraper

Enoc committed 5 years ago

Commit fdfcf3d1 parent e17bc8410 files · +24 −204Browse files

Showing the changes to lib/docs/scrapers/cppref/cppref.rb (1 of 10 files). Show all

Unified · Split

lib/docs/scrapers/cppref/cppref.rb+8−4
@@ -6,7 +6,7 @@ module Docs · 5 unmodified lines
66
77 html_filters.insert_before 'clean_html', 'cppref/fix_code'
88 html_filters.push 'cppref/clean_html', 'title'
9− # 'cpp20/entries',
9+
1010 options[:decode_and_clean_paths] = true
1111 options[:container] = '#content'
1212 options[:title] = false
@@ -21,9 +21,13 @@ module Docs · 8 unmodified lines
2121 Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
2222 HTML
2323
24− # def get_latest_version
25−
26− # end
24+ # Check if the 'headers' page has changed
25+ def get_latest_version(opts)
26+ doc = fetch_doc(self.base_url + self.root_path, opts)
27+ date = doc.at_css('#footer-info-lastmod').content
28+ date = date.match(/[[:digit:]]{1,2} .* [[:digit:]]{4}/).to_s
29+ date = DateTime.strptime(date, '%e %B %Y').to_time.to_i
30+ end
2731
2832 end
2933 end