History

mdn: update CSS, HTML, JavaScript, SVG, XSLT&XPath

Simon Legner committed 6 years ago

Commit 04db81e1 parent b5032413 files · +6 −7Browse files

Showing the changes to lib/docs (2 of 3 files). Show all

Unified · Split

2 files
  1. lib/docs/scrapers/mdn/mdn.rb +4 −2
  2. lib/docs/scrapers/mdn/xslt_xpath.rb +1 −4
lib/docs/scrapers/mdn/mdn.rb+4−2
@@ -17,18 +17,20 @@ module Docs · 16 unmodified lines
17 }17 }
18 18
19 options[:attribution] = <<-HTML19 options[:attribution] = <<-HTML
20 &copy; 2005&ndash;2018 Mozilla Developer Network and individual contributors.<br>20 &copy; 2005&ndash;2020 Mozilla and individual contributors.<br>
21 Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.21 Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
22 HTML22 HTML
23 23
24 def get_latest_version(opts)24 def get_latest_version(opts)
25 json = fetch_json("https://developer.mozilla.org/en-US/docs/feeds/json/tag/#{options[:mdn_tag]}", opts)25 json = fetch_json("https://developer.mozilla.org/en-US/docs/feeds/json/tag/#{options[:mdn_tag]}", opts)
26 DateTime.parse(json[0]['pubdate']).to_time.to_i26 dates = json.map { |i| i['pubdate'] }
27 DateTime.parse(dates.max).to_time.to_i
27 end28 end
28 29
29 private30 private
30 31
31 def process_response?(response)32 def process_response?(response)
33 response.effective_url.host = 'developer.mozilla.org' if response.effective_url.host == 'wiki.developer.mozilla.org'
32 super && response.effective_url.query == 'raw=1&macros=1'34 super && response.effective_url.query == 'raw=1&macros=1'
33 end35 end
34 end36 end
lib/docs/scrapers/mdn/xslt_xpath.rb+1−4
@@ -15,10 +15,7 @@ module Docs · 14 unmodified lines
15 options[:only_patterns] = [/\A\/XSLT/, /\A\/XPath/]15 options[:only_patterns] = [/\A\/XSLT/, /\A\/XPath/]
16 16
17 options[:fix_urls] = ->(url) do17 options[:fix_urls] = ->(url) do
18 url.sub! 'https://developer.mozilla.org/en/XPath', "#{XsltXpath.base_url}/XPath"18 url.sub! 'https://developer.mozilla.org/en-US/docs/Web/XSLT/Element', "#{XsltXpath.base_url}/XSLT"
19 url.sub! 'https://developer.mozilla.org/en/XSLT', "#{XsltXpath.base_url}/XSLT"
20 url.sub! 'https://developer.mozilla.org/en-US/docs/XPath', "#{XsltXpath.base_url}/XPath"
21 url.sub! 'https://developer.mozilla.org/en-US/docs/XSLT', "#{XsltXpath.base_url}/XSLT"
22 url19 url
23 end20 end
24 end21 end

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t