uniara_virtual_parser 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3a5dacf4b3d8ecbfe10299f706e6bf4bf247cc1
|
4
|
+
data.tar.gz: e56b6449a5c3a19f56806779b0435c41838cc437
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f677077d6583cfe11673d21a36abf31e86fa40bb5bb8b1bdb84829420df52e7f03ede346e13c83360b6614c7efe53f6e3120ac56401cd4193d2039c1458d06dd
|
7
|
+
data.tar.gz: 6551cdc7d15c4d0312950086e65a2137a6e81a85b697dbe119fffb5010bf81d127015765373bd87a706ee3a635356933bbcbcb07c18b85a8eca57c669c2f0a74
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'pry'
|
1
2
|
module UniaraVirtualParser
|
2
3
|
module Services
|
3
4
|
module Student
|
@@ -9,9 +10,11 @@ module UniaraVirtualParser
|
|
9
10
|
private
|
10
11
|
|
11
12
|
def parse_student_profile(html)
|
12
|
-
return '' if html.empty?
|
13
13
|
doc = Nokogiri::HTML(html)
|
14
|
-
|
14
|
+
name = doc.css("b:contains('Bom Dia')").first ||
|
15
|
+
doc.css("b:contains('Boa Tarde')").first || doc.css("b:contains('Boa Noite')").first
|
16
|
+
return '' unless name
|
17
|
+
student = Models::Student.new(name: name.text.match(/Bo[am] (Dia|Tarde|Noite), (.*)/)[2])
|
15
18
|
student
|
16
19
|
end
|
17
20
|
end
|