osu-cc-scraper 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/osu-cc-scraper/course.rb +8 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00e547e50b759e05a38eb3251f333ef13acda4bb
|
4
|
+
data.tar.gz: 2fe51e85192c1e79df01eba6392d680c1979c8ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b07ba4686e5d1ff8fad54f92d4dbf13372fc4cba300d3c71fa76683fcb832703a04f7db8e1b0b0e39b263df67cc6ee780c49f303b4f6b14ab1d5bc40918948e
|
7
|
+
data.tar.gz: 2ac1f329ec36729cbc347fe3cd59cb639a5867dde8ed9e13e284e1b3e37d71b3c67cdf497687915241f46ced0cf185e18ad1344dcaac4917ddf2357b6ce9edbe
|
@@ -7,6 +7,8 @@ class OsuCcScraper::Course
|
|
7
7
|
attr_accessor :subject_code
|
8
8
|
# @return [String]
|
9
9
|
attr_accessor :course_number
|
10
|
+
# @return [String]
|
11
|
+
attr_accessor :name
|
10
12
|
|
11
13
|
# @return [OsuCcScraper::Course]
|
12
14
|
def initialize(args)
|
@@ -30,12 +32,12 @@ class OsuCcScraper::Course
|
|
30
32
|
def self.parse(html)
|
31
33
|
ng = Nokogiri::HTML(html)
|
32
34
|
ng.css("tr td strong a:last").map{ |course|
|
33
|
-
|
34
|
-
|
35
|
-
OsuCcScraper::Course.new
|
36
|
-
subject_code:
|
37
|
-
course_number:
|
38
|
-
|
35
|
+
# NE 311H INTRODUCTION TO THERMAL-FLUID SCIENCES (4)
|
36
|
+
parts = course.text.split(' ')
|
37
|
+
OsuCcScraper::Course.new \
|
38
|
+
subject_code: parts[0],
|
39
|
+
course_number: parts[1],
|
40
|
+
name: parts[2..parts.length-2].join(" ")
|
39
41
|
}
|
40
42
|
end
|
41
43
|
end
|