History

Remove hardcoded username and fix broken methods

Jasper van Merle committed 7 years ago

Commit 4ce7dbc1 parent 16061958 files · +11 −15Browse files

Showing the changes to lib/docs (6 of 8 files). Show all

Unified · Split

6 files
  1. lib/docs/scrapers/async.rb +1 −1
  2. lib/docs/scrapers/drupal.rb +2 −7
  3. lib/docs/scrapers/perl.rb +3 −2
  4. lib/docs/scrapers/phalcon.rb +1 −1
  5. lib/docs/scrapers/sass.rb +1 −1
  6. lib/docs/scrapers/statsmodels.rb +1 −1
lib/docs/scrapers/async.rb+1−1
@@ -19,7 +19,7 @@ module Docs · 18 unmodified lines
19 HTML19 HTML
20 20
21 def get_latest_version(opts)21 def get_latest_version(opts)
22 doc = fetch_doc('https://caolan.github.io/async/', opts)22 doc = fetch_doc('https://caolan.github.io/async/v3/', opts)
23 doc.at_css('#version-dropdown > a').content.strip[1..-1]23 doc.at_css('#version-dropdown > a').content.strip[1..-1]
24 end24 end
25 end25 end
lib/docs/scrapers/drupal.rb+2−7
@@ -100,13 +100,8 @@ module Docs · 99 unmodified lines
100 end100 end
101 101
102 def get_latest_version(opts)102 def get_latest_version(opts)
103 doc = fetch_doc('http://cgit.drupalcode.org/drupal', opts)103 json = fetch_json('https://packagist.org/packages/drupal/drupal.json', opts)
104 104 json['package']['versions'].keys.find {|version| !version.end_with?('-dev')}
105 version = doc.at_css('td.form > form > select > option[selected]').content
106 version = version.scan(/([0-9.]+)/)[0][0]
107 version = version[0...-1] if version.end_with?('.')
108
109 version
110 end105 end
111 end106 end
112end107end
lib/docs/scrapers/perl.rb+3−2
@@ -45,8 +45,9 @@ module Docs · 44 unmodified lines
45 end45 end
46 46
47 def get_latest_version(opts)47 def get_latest_version(opts)
48 body = fetch('https://perldoc.perl.org/static/perlversion.js', opts)48 doc = fetch_doc('https://perldoc.perl.org/', opts)
49 body.scan(/>Perl ([0-9.]+)/)[0][0]49 header = doc.at_css('h2.h1').content
50 header.scan(/Perl ([0-9.]+)/)[0][0]
50 end51 end
51 end52 end
52end53end
lib/docs/scrapers/phalcon.rb+1−1
@@ -32,7 +32,7 @@ module Docs · 31 unmodified lines
32 32
33 def get_latest_version(opts)33 def get_latest_version(opts)
34 doc = fetch_doc('https://docs.phalconphp.com/', opts)34 doc = fetch_doc('https://docs.phalconphp.com/', opts)
35 doc.at_css('.custom-select__version').content.strip.sub(/Version /, '')35 doc.at_css('.header__lang.expand > div > ul > li > a').content
36 end36 end
37 end37 end
38end38end
lib/docs/scrapers/sass.rb+1−1
@@ -25,7 +25,7 @@ module Docs · 24 unmodified lines
25 HTML25 HTML
26 26
27 def get_latest_version(opts)27 def get_latest_version(opts)
28 get_github_file_contents('sass', 'sass', 'VERSION', opts).strip28 get_latest_github_release('sass', 'libsass', opts)['tag_name']
29 end29 end
30 end30 end
31end31end
lib/docs/scrapers/statsmodels.rb+1−1
@@ -23,7 +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('http://www.statsmodels.org/stable/', opts)25 doc = fetch_doc('http://www.statsmodels.org/stable/', opts)
26 doc.at_css('.sphinxsidebarwrapper h3 + p > b').content26 doc.at_css('.sphinxsidebarwrapper h3 + p > b').content[1..-1]
27 end27 end
28 end28 end
29end29end

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