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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/osu-cc-scraper/course.rb +8 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d043f4714c11306e409b3b41d64c8eaaa08e8ef5
4
- data.tar.gz: 409904c69c2dc0efc345f96430021aa89561afbf
3
+ metadata.gz: 00e547e50b759e05a38eb3251f333ef13acda4bb
4
+ data.tar.gz: 2fe51e85192c1e79df01eba6392d680c1979c8ae
5
5
  SHA512:
6
- metadata.gz: 5e884a9cf2d71cb581d8b3455956020c1ee77b09dc4b327f564e1349ed665ae2fba7f3a66d948ce638928cc39ac90ecda2403e79221e7e8f34a697d566dbee54
7
- data.tar.gz: 1c95e3923d27996cb6ac5d2b8bb7118dc0aaf226c48e8f7b7766bd8843929e00999e11843f8db86defaff7a8cb493203e03c2037664f0ab5252ee4474eb6272a
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
- uri = course.attribute('href').to_s.gsub('CourseDetail.aspx?', '')
34
- params = URI.decode_www_form(uri).to_h
35
- OsuCcScraper::Course.new({
36
- subject_code: params["subjectcode"],
37
- course_number: params["coursenumber"]
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osu-cc-scraper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonah George