uniara_virtual_parser 0.1.4 → 1.1.0

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: 2547303d40def005a12c8b204f2fafe12341a640
4
- data.tar.gz: 59342919e11aea9982ec549b537e884337fe9ef0
3
+ metadata.gz: 99e8ed56f4e6d86e3103be1ba9d7d7b762154531
4
+ data.tar.gz: c9586fb3b1fe732800204ddef7fc8cee9a94a6a0
5
5
  SHA512:
6
- metadata.gz: 918c3b1579d68d245fde2f3e9c73dab30ffbb10b611e983f27b2482c5c40383857fca0518f69d2a7f551f28a7111c670a9e40a1ef1088842fc7cf2dd1fdfda8c
7
- data.tar.gz: 236b2e7acd53cdb991f6154446fcdb248fa020c3f36056ba925658e0aa1fce356eca579fec5562259b3dcb60ec825ee627c84a7ed998b40473a59a2f1833abef
6
+ metadata.gz: ae45425a4db8b7096d34c880c23a4c2a241af0e5173931f8f5db0e24980c94bd8acc0b27fc77e7195ddbcf5bd5ae3e8fa105aa48a503023bf0af5a39a8807574
7
+ data.tar.gz: bf702fb2f87a49a5333a36682482b8a58ada0163446a35be84e89ae148a9e87d3ea4837fe4c05adb87940a2612240a1bb0ec0223f44764569d46034ee9c3d38d
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Coverage Status](https://coveralls.io/repos/duduribeiro/uniara_virtual_parser/badge.svg?branch=master&service=github)](https://coveralls.io/github/duduribeiro/uniara_virtual_parser?branch=master)
2
+
1
3
  # UniaraVirtualParser
2
4
 
3
5
  A gem to parse the Uniara Virtual system.
@@ -0,0 +1,13 @@
1
+ module UniaraVirtualParser
2
+ module Models
3
+ class Absence
4
+ attr_reader :name, :frequency, :total
5
+
6
+ def initialize(attributes={})
7
+ @name = attributes.fetch :name, nil
8
+ @frequency = attributes.fetch :frequency, nil
9
+ @total = attributes.fetch :total, nil
10
+ end
11
+ end
12
+ end
13
+ end
@@ -5,15 +5,15 @@ module UniaraVirtualParser
5
5
  :fourth_bimester, :substitutive, :average, :recovery, :status
6
6
 
7
7
  def initialize(attributes = {})
8
- @name = attributes.fetch :name
9
- @first_bimester = attributes.fetch :first_bimester
10
- @second_bimester = attributes.fetch :second_bimester
11
- @third_bimester = attributes.fetch :third_bimester
12
- @fourth_bimester = attributes.fetch :fourth_bimester
13
- @substitutive = attributes.fetch :substitutive
14
- @average = attributes.fetch :average
15
- @recovery = attributes.fetch :recovery
16
- @status = attributes.fetch :status
8
+ @name = attributes.fetch :name, nil
9
+ @first_bimester = attributes.fetch :first_bimester, nil
10
+ @second_bimester = attributes.fetch :second_bimester, nil
11
+ @third_bimester = attributes.fetch :third_bimester, nil
12
+ @fourth_bimester = attributes.fetch :fourth_bimester, nil
13
+ @substitutive = attributes.fetch :substitutive, nil
14
+ @average = attributes.fetch :average, nil
15
+ @recovery = attributes.fetch :recovery, nil
16
+ @status = attributes.fetch :status, nil
17
17
  end
18
18
  end
19
19
  end
@@ -0,0 +1,27 @@
1
+ module UniaraVirtualParser
2
+ module Services
3
+ module Absences
4
+ def absences(token)
5
+ response = Client.get_with_token('/alunos/consultas/faltas', token)
6
+ parse_absences response.body
7
+ end
8
+
9
+ private
10
+
11
+ def parse_absences(html)
12
+ doc = Nokogiri::HTML(html)
13
+ absences = []
14
+
15
+ doc.css('div#conteudo ~table tr').each_with_index do |absence, index|
16
+ next if index.zero?
17
+ absences << Models::Absence.new(
18
+ name: absence.css('td:nth-child(1)').text,
19
+ frequency: absence.css('td:nth-child(2)').text,
20
+ total: absence.css('td:nth-child(3)').text
21
+ )
22
+ end
23
+ absences
24
+ end
25
+ end
26
+ end
27
+ end
@@ -1,3 +1,3 @@
1
1
  module UniaraVirtualParser
2
- VERSION = '0.1.4'
2
+ VERSION = '1.1.0'
3
3
  end
@@ -2,14 +2,17 @@ require 'hurley'
2
2
  require 'nokogiri'
3
3
  require 'uniara_virtual_parser/version'
4
4
  require 'uniara_virtual_parser/client'
5
+ require 'uniara_virtual_parser/models/absence'
5
6
  require 'uniara_virtual_parser/models/file'
6
7
  require 'uniara_virtual_parser/models/student'
7
8
  require 'uniara_virtual_parser/models/subject'
8
9
  require 'uniara_virtual_parser/services/login'
10
+ require 'uniara_virtual_parser/services/absences'
9
11
  require 'uniara_virtual_parser/services/files'
10
12
  require 'uniara_virtual_parser/services/grades'
11
13
  require 'uniara_virtual_parser/services/student'
12
14
 
15
+ include UniaraVirtualParser::Services::Absences
13
16
  include UniaraVirtualParser::Services::Files
14
17
  include UniaraVirtualParser::Services::Grades
15
18
  include UniaraVirtualParser::Services::Login
@@ -0,0 +1,450 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
+ <html>
3
+ <head>
4
+ <title>Uniara Virtual - Acadêmico > Consultas > Registro de Faltas</title>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
+ <meta name="Author" content="Weverton Velludo - wvelludo@uniara.com.br">
7
+ <meta name="Robots" CONTENT="noindex,nofollow">
8
+ <link type="image/x-icon" rel="shortcut icon" href="http://www.uniara.com.br/favicon.ico" />
9
+ <link rel="stylesheet" href="http://www.uniara.com.br/barra_navegacao.css" type="text/css">
10
+ <script type="text/javascript" src="http://www.uniara.com.br/barra_navegacao_virtual.js.php"></script>
11
+ <link href="/templates/alunos/css.css" rel="stylesheet" type="text/css">
12
+
13
+ <script type="text/javascript" src="/templates/alunos/ferramentas/js/jquery.js"></script>
14
+ <script type="text/javascript" src="/templates/alunos/ferramentas/js/jquery.jqDock.min.js"></script>
15
+ <script type="text/javascript" src="/templates/alunos/ferramentas/js/jquery-ui-1.8.15.custom.min.js"></script>
16
+ <link type="text/css" href="/templates/alunos/ferramentas/css/ui-lightness/jquery-ui-1.8.15.custom.css" rel="stylesheet" />
17
+
18
+ <script src="/templates/js/generico.js" type="text/javascript"></script>
19
+ <script src="/templates/alunos/js/generico.js" type="text/javascript"></script>
20
+ <script src="/templates/js/mascaraHellas.js"></script>
21
+ <script type="text/javascript">
22
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
23
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
24
+ </script>
25
+ <script type="text/javascript">
26
+ try {
27
+ var pageTracker = _gat._getTracker("UA-9447697-1");
28
+ pageTracker._trackPageview();
29
+ } catch(err) {}
30
+ </script>
31
+ <script type="text/javascript">
32
+
33
+ function tempolimite() {
34
+ if (atual != 0) {
35
+ document.getElementById('tlimite').innerHTML = "Tempo restante: <b>" + atual + "</b> min."
36
+ if (atual==2) {
37
+ if (pagina != "/index.php") {
38
+ document.getElementById('limite').innerHTML = "<table width='99%' align='center' border='0' cellpadding='3' cellspacing='1' bgcolor='#000000'><tr bgcolor='#0f3b4d'><td align='center'><font color='#FFFFFF'><b>ATENÇÃO</b></font></td></tr><tr bgcolor='#47778b'><td align=center><b>Sua sessão está chegando ao fim, salve as informações para evitar perda de dados.<BR>Você tem menos de 2 minutos para verificar e postar seus dados.</b></td></tr></table><BR>"
39
+ document.getElementById('limite2').innerHTML = "<BR><table width='99%' align='center' border='0' cellpadding='3' cellspacing='1' bgcolor='#000000'><tr bgcolor='#0f3b4d'><td align='center'><font color='#FFFFFF'><b>ATENÇÃO</b></font></td></tr><tr bgcolor='#47778b'><td align=center><b>Sua sessão está chegando ao fim, salve as informações para evitar perda de dados.<BR>Você tem menos de 2 minutos para verificar e postar seus dados.</b></td></tr></table><BR>"
40
+ }
41
+ }
42
+ atual-=1;
43
+ } else {
44
+ window.location="/login/";
45
+ }
46
+ setTimeout("tempolimite()",60000);
47
+ }
48
+
49
+ // Institucional
50
+ var menu1=new Array()
51
+ menu1[0]='<div class=dropmenu style="width:100%">&nbsp;<b>Informações</b></div>'
52
+ menu1[1]='<a href="/alunos/institucional/reitor/" class=dropmenul target=_self>Palavra do Reitor</a>'
53
+ menu1[2]='<a href="http://www.uniara.com.br/institucional/a_uniara.php" class=dropmenul target=_blank>A Uniara</a>'
54
+ menu1[3]='<a href="http://www.uniara.com.br/atividades_culturais/" class=dropmenul target=_blank>Atividades Culturais</a>'
55
+ menu1[4]='<a href="http://www.uniara.com.br/esporte/" class=dropmenul target=_blank>Esporte</a>'
56
+ menu1[5]='<a href="http://www.uniara.com.br/revistauniara/default.asp" class=dropmenul target=_blank>Revista Uniara</a>'
57
+ menu1[6]='<a href="http://www.uniara.com.br/parque_do_basalto/" class=dropmenul target=_blank>Parque do Basalto</a>'
58
+ menu1[7]='<a href="http://www.uniara.com.br/ageuniara/" class=dropmenul target=_blank>Ageuniara</a>'
59
+ menu1[8]='<a href="http://www.uniara.com.br/guia_turistico/" class=dropmenul target=_blank>Guia de Araraquara</a>'
60
+ menu1[9]='<a href="http://www.uniara.com.br/visitavirtual/" class=dropmenul target=_blank>Visita Virtual</a>'
61
+
62
+ // Uniara Virtual
63
+ var menu2=new Array()
64
+ menu2[0]='<div class=dropmenu style="width:100%">&nbsp;<b>Informações</b></div>'
65
+ menu2[1]='<a href="/alunos/virtual/apresentacao/" class=dropmenul target=_self>Apresentação</a>'
66
+ menu2[2]='<div class=dropmenu style="width:100%">&nbsp;<b>Contato</b></div>'
67
+ menu2[3]='<a href="/alunos/contato/criticas/" class=dropmenul target=_self>Críticas e Sugestões</a>'
68
+ menu2[4]='<div class=dropmenu style="width:100%">&nbsp;<b>Serviços</b></div>'
69
+ menu2[5]='<a href="/alunos/servicos/senha/" class=dropmenul target=_self>Alteração de Senha</a>'
70
+
71
+ // Academico
72
+ var menu3=new Array()
73
+ menu3[0]='<div class=dropmenu style="width:100%">&nbsp;<b>Informações</b></div>'
74
+ menu3[1]='<a href="/alunos/informacoes/apresentacao/" class=dropmenul target=_self>Apresentação</a>'
75
+ menu3[2]='<a href="/alunos/informacoes/duvidas/" class=dropmenul target=_self>Dúvidas Freqüentes</a>'
76
+ //menu3[3]='<a href="#" onclick="javascript:guia();" class=dropmenul target=_self>Guia do Aluno</a>'
77
+ menu3[4]='<a href="http://www.uniara.com.br/graduacao/eng_computacao/" class=dropmenul target=_blank>Meu Curso</a>'
78
+ menu3[5]='<div class=dropmenu style="width:100%">&nbsp;<b>Consultas</b></div>'
79
+ menu3[6]='<a href="/alunos/consultas/disciplinas/" class=dropmenul target=_self>Disciplinas Matriculadas</a>'
80
+ menu3[7]='<a href="/alunos/consultas/dados/" class=dropmenul target=_self>Dados Cadastrais</a>'
81
+ menu3[8]='<a href="/alunos/consultas/horario/" class=dropmenul target=_self>Horário de Aula</a>'
82
+ menu3[9]='<a href="/alunos/consultas/atividades/" class=dropmenul target=_self>Atividades Complementares</a>'
83
+ menu3[10]='<a href="/alunos/consultas/historico/" class=dropmenul target=_self>Histórico Escolar</a>'
84
+ menu3[11]='<a href="/alunos/consultas/arquivos/" class=dropmenul target=_self>Arquivos Disponíveis</a>'
85
+ menu3[12]='<a href="/alunos/consultas/requerimentos/" class=dropmenul target=_self>Requerimentos</a>'
86
+ menu3[13]='<a href="/alunos/consultas/planoensino/" class=dropmenul target=_self>Planos de Ensino das Disciplinas</a>'
87
+ menu3[14]='<a href="/alunos/consultas/calendario/" class=dropmenul target=_self>Calendário Acadêmico</a>'
88
+ menu3[15]='<a href="/alunos/consultas/notas/" class=dropmenul target=_self>Registro de Notas</a>'
89
+ menu3[16]='<a href="/alunos/consultas/faltas/" class=dropmenul target=_self>Registro de Faltas</a>'
90
+
91
+
92
+
93
+ //menu3[17]='<a href="/alunos/consultas/mensagens/" class=dropmenul target=_self>Caixa de Mensagens</a>'
94
+
95
+ menu3[18]='<div class=dropmenu style="width:100%">&nbsp;<b>Serviços</b></div>'
96
+ menu3[19]='<a href="/alunos/servicos/dados/" class=dropmenul target=_self>Alteração de Cadastro</a>'
97
+ menu3[20]='<a href="/alunos/servicos/biblioteca/" class=dropmenul target=_self>Biblioteca</a>'
98
+ menu3[21]='<a href="/alunos/servicos/requerimentos/" class=dropmenul target=_self>Solicitação de Requerimentos</a>'
99
+ menu3[22]='<a href="/alunos/servicos/matricula/" class=dropmenul target=_self>Matrícula On-line</a>'
100
+ menu3[23]='<div class=dropmenu style="width:100%">&nbsp;<b>Contato</b></div>'
101
+ menu3[24]='<a href="/alunos/contato/central/" class=dropmenul target=_self>Central de Atendimento</a>'
102
+ menu3[25]='<a href="/alunos/servicos/coordenador/" class=dropmenul target=_self>Fale com seu coordenador</a>'
103
+
104
+
105
+ // Financeiro
106
+ var menu4=new Array()
107
+ menu4[0]='<div class=dropmenu style="width:100%">&nbsp;<b>Informações</b></div>'
108
+ menu4[1]='<a href="/alunos/financeiro/apresentacao/" class=dropmenul target=_self>Apresentação</a>'
109
+ menu4[2]='<a href="/alunos/financeiro/duvidas/" class=dropmenul target=_self>Dúvidas Freqüentes</a>'
110
+ menu4[3]='<div class=dropmenu style="width:100%">&nbsp;<b>Consultas</b></div>'
111
+ menu4[4]='<a href="/alunos/financeiro/dados/" class=dropmenul target=_self>Dados Financeiros</a>'
112
+ menu4[5]='<a href="/alunos/financeiro/mensalidades/" class=dropmenul target=_self>Mensalidades Atrasadas</a>'
113
+ menu4[6]='<div class=dropmenu style="width:100%">&nbsp;<b>Serviços</b></div>'
114
+ menu4[7]='<a href="/alunos/financeiro/segundavia/" class=dropmenul target=_self>Segunda via de Carnê</a>'
115
+ menu4[8]='<div class=dropmenu style="width:100%">&nbsp;<b>Contato</b></div>'
116
+ menu4[9]='<a href="/alunos/contato/financeiro/" class=dropmenul target=_self>Tesouraria</a>'
117
+
118
+ // Fora de Sala
119
+ var menu5=new Array()
120
+ menu5[0]='<a href="/alunos/foradesala/vagasestagio/" class=dropmenul target=_self>Estágios e Oportunidades</a>'
121
+ menu5[1]='<a href="http://neuvoo.com.br/pt" class=dropmenul target=_self>Oportunidades de Emprego</a>'
122
+
123
+ menu5[2]='<div class=dropmenu style="width:100%">&nbsp;<b>Entretenimento</b></div>'
124
+ //menu5[2]='<a href="/alunos/foradesala/enquetes/" class=dropmenul target=_self>Enquetes</a>'
125
+ menu5[3]='<a href="http://www.dceuniara.com.br" class=dropmenul target=_blank>Site DCE</a>'
126
+ menu5[4]='<a href="/alunos/foradesala/calendario/" class=dropmenul target=_self>Agenda</a>'
127
+ menu5[5]='<div class=dropmenu style="width:100%">&nbsp;<b>Setores de Apoio ao Aluno</b></div>'
128
+ menu5[6]='<a href="/alunos/foradesala/relacionamento/" class=dropmenul target=_self>Setor de Relacionamento</a>'
129
+ menu5[7]='<a href="/alunos/foradesala/estagios/" class=dropmenul target=_self>Divisão de Estágios</a>'
130
+ menu5[8]='<a href="/alunos/foradesala/central/" class=dropmenul target=_self>Central de Atendimento</a>'
131
+ menu5[9]='<a href="/alunos/foradesala/biblioteca/" class=dropmenul target=_self>Biblioteca</a>'
132
+ </script>
133
+ <script src="/templates/js/menu.js" type="text/javascript"></script>
134
+ </head>
135
+ <body onLoad="barranavegacao();" bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
136
+ <div id="barranavegacao"></div>
137
+ <table width="770" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
138
+ <tr>
139
+ <td height="62">
140
+ <table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
141
+ <tr>
142
+ <td width="25" background="/templates/alunos/imagens/t1.gif"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
143
+ <td background="/templates/alunos/imagens/t2.gif" align="center">
144
+ <img src="/templates/alunos/imagens/trans.gif"><BR>
145
+ </td>
146
+ <td width="25" background="/templates/alunos/imagens/t3.gif"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
147
+ </tr>
148
+ </table>
149
+ </td>
150
+ </tr>
151
+ <tr>
152
+ <td height="50">
153
+ <table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
154
+ <tr>
155
+ <td width="25" background="/templates/alunos/imagens/t1.gif" valign="bottom"><img src="/templates/alunos/imagens/t4.gif"><BR></td>
156
+ <td width="68" background="/templates/alunos/imagens/t5.gif"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
157
+ <td width="8"><img src="/templates/alunos/imagens/t21.gif"><BR></td>
158
+ <td width="111" background="/templates/alunos/imagens/t22.gif" align="center">
159
+ <table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
160
+ <tr>
161
+ <td height="30" colspan="2"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
162
+ </tr>
163
+ <tr>
164
+ <td align="center">
165
+ <font color="#FFFFFF" size="1" style="font:10px"><b>UNIARA VIRTUAL</b></font>
166
+ </td>
167
+ <td width="4"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
168
+ </tr>
169
+ </table>
170
+ </td>
171
+ <td width="9"><img src="/templates/alunos/imagens/t23.gif"><BR></td>
172
+ <td width="8" bgcolor="#5E8EA2"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
173
+ <td bgcolor="#5E8EA2"><font color="#FFFFFF" size="6">ALUNO</font></td>
174
+ <td width="5"><img src="/templates/alunos/imagens/t8.gif"><BR></td>
175
+ <td width="134" background="/templates/alunos/imagens/t9.gif">
176
+ <table width="100%" height="50" border="0" align="center" cellpadding="0" cellspacing="0">
177
+ <tr>
178
+ <td><img src="/templates/alunos/imagens/trans.gif"><BR></td>
179
+ </tr>
180
+ <tr>
181
+ <td height="16" align="center">
182
+ <table width="98%" height="16" border="0" align="CENTER" cellpadding="0" cellspacing="0">
183
+ <form name="redirect" action="#">
184
+ <tr>
185
+ <td align="center">
186
+ <div id="tlimite">
187
+ <script>
188
+ var atual = 120;
189
+ var pagina = "faltas.php";
190
+ tempolimite();
191
+ </script>
192
+ </div>
193
+ </td>
194
+ </tr>
195
+ </form>
196
+ </table>
197
+ </td>
198
+ </tr>
199
+ </table>
200
+ </td>
201
+ <td width="4"><img src="/templates/alunos/imagens/t10.gif"><BR></td>
202
+ <td width="25" background="/templates/alunos/imagens/t3.gif" valign="bottom"><img src="/templates/alunos/imagens/t6.gif"><BR></td>
203
+ </tr>
204
+ </table>
205
+ </td>
206
+ </tr>
207
+ <tr>
208
+ <td height="46">
209
+ <table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
210
+ <tr>
211
+ <td width="9"><img src="/templates/alunos/imagens/t11.gif"><BR></td>
212
+ <td width="152" bgcolor="#5E8EA2"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
213
+ <td width="51"><img src="/templates/alunos/imagens/t12.gif"><BR></td>
214
+ <td>
215
+ <table width="400" height="18" border="0" cellpadding="0" cellspacing="0">
216
+ <tr>
217
+ <td background="/templates/alunos/imagens/local.jpg">
218
+ <font color="#737373"><b>&nbsp;&nbsp;&nbsp;&nbsp;Acadêmico > Consultas > Registro de Faltas</b></font>
219
+ </td>
220
+ </tr>
221
+ </table>
222
+ </td>
223
+ <td width="12"><img src="/templates/alunos/imagens/t13.gif"><BR></td>
224
+ </tr>
225
+ </table>
226
+ </td>
227
+ </tr>
228
+ <tr>
229
+ <td height="20">
230
+ <table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
231
+ <tr>
232
+ <td width="3" background="/templates/alunos/imagens/s1.gif"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
233
+ <td width="151" bgcolor="#5E8EA2"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
234
+ <td width="9"><img src="/templates/alunos/imagens/t14.gif"><BR></td>
235
+ <td width="49">&nbsp;</td>
236
+ <td width="4"><img src="/templates/alunos/imagens/t15.gif"><BR></td>
237
+ <td bgcolor="#5E8EA2">
238
+ <table width="98%" height="100%" border="0" align="CENTER" cellpadding="0" cellspacing="0">
239
+ <tr>
240
+ <td align="left">
241
+ <font color="#FFFFFF">
242
+ <b>Bom Dia, EZEQUIEL MESSORE</b>
243
+ </font>
244
+ </td>
245
+ <td width="110" align="right">
246
+ <font color="#FFFFFF" size="2">
247
+ <b>|</b>
248
+ </font>
249
+ <font color="#FFFFFF" size="1">
250
+ &nbsp;
251
+ <b>Acesso nº 1464</b>
252
+ </font>
253
+ </td>
254
+ <td width="5">
255
+ <img src="/templates/alunos/imagens/trans.gif"><BR>
256
+ </td>
257
+ </tr>
258
+ </table>
259
+ </td>
260
+ <td width="51"><a href="/login/"><img src="/templates/alunos/imagens/sair.gif"></a><BR></td>
261
+ <td width="3" background="/templates/alunos/imagens/s2.gif"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
262
+ </tr>
263
+ </table>
264
+ </td>
265
+ </tr>
266
+ <tr>
267
+ <td height="22">
268
+ <table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
269
+ <tr>
270
+ <td width="3" background="/templates/alunos/imagens/s1.gif"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
271
+ <td width="150" bgcolor="#5E8EA2"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
272
+ <td width="8"><img src="/templates/alunos/imagens/t16.gif"><BR></td>
273
+ <td><img src="/templates/alunos/imagens/trans.gif"><BR></td>
274
+ <td width="1" bgcolor="#929292"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
275
+ <td width="3" background="/templates/alunos/imagens/s2.gif"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
276
+ </tr>
277
+ </table>
278
+ </td>
279
+ </tr>
280
+ <tr>
281
+ <td height="26">
282
+ <table width="100%" height="26" border="0" align="center" cellpadding="0" cellspacing="0">
283
+ <tr>
284
+ <td width="3" background="/templates/alunos/imagens/s1.gif"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
285
+ <td width="150" bgcolor="#47778B" align="center"><a href="/alunos/index/" class="menu">home</a></td>
286
+ <td bgcolor="#B1B1B1">
287
+ <table height="26" border="0" align="CENTER" cellpadding="0" cellspacing="0">
288
+ <tr>
289
+
290
+
291
+
292
+ <td width="103" align="center"><a href=# class="menu" onMouseOver="return dropdownmenu(this, event, menu1, '150px')" onMouseout="delayhidemenu()">institucional</a><BR></td>
293
+ <td width="22" align="center"><font size="2" color="#ffffff"><b>|</b></font><BR></td>
294
+ <td width="103" align="center"><a href=# class="menu" onMouseOver="return dropdownmenu(this, event, menu2, '150px')" onMouseout="delayhidemenu()">uniara virtual</a><BR></td>
295
+ <td width="22" align="center"><font size="2" color="#ffffff"><b>|</b></font><BR></td>
296
+ <td width="103" align="center"><a href=# class="menu" onMouseOver="return dropdownmenu(this, event, menu3, '203px')" onMouseout="delayhidemenu()">acadêmico</a><BR></td>
297
+ <td width="22" align="center"><font size="2" color="#ffffff"><b>|</b></font><BR></td>
298
+ <td width="103" align="center"><a href=# class="menu" onMouseOver="return dropdownmenu(this, event, menu4, '150px')" onMouseout="delayhidemenu()">financeiro</a><BR></td>
299
+ <td width="22" align="center"><font size="2" color="#ffffff"><b>|</b></font><BR></td>
300
+ <td width="103" align="center"><a href=# class="menu" onMouseOver="return dropdownmenu(this, event, menu5, '170px')" onMouseout="delayhidemenu()">fora de sala</a><BR></td>
301
+ </tr>
302
+ </table>
303
+ </td>
304
+ <td width="1" bgcolor="#929292"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
305
+ <td width="3" background="/templates/alunos/imagens/s2.gif"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
306
+ </tr>
307
+ </table>
308
+ </td>
309
+ </tr>
310
+ <tr>
311
+ <td valign="top">
312
+ <!-- Centro da Página -->
313
+ <table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
314
+ <tr>
315
+ <td width="3" background="/templates/alunos/imagens/s1.gif"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
316
+ <td width="150" valign="top">
317
+ <table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
318
+ <tr>
319
+ <td bgcolor="#5E8EA2" valign="top" align="center">
320
+ <BR>
321
+ <a href="/redir/41/" target="_blank"><img src="/arquivos/banners/673d343611964aec8f9dfeb4b172d9cd.jpg" border="0"></a> <BR><img src="/templates/imagens/trans.gif" height="6"><BR>
322
+ <a href="/redir/32/" target="_blank"><img src="/arquivos/banners/a36a232bf3d5402b2912e5cb611e8269.jpg" border="0"></a> <BR><img src="/templates/imagens/trans.gif" height="6"><BR>
323
+ <a href="/redir/60/" target="_blank"><img src="/arquivos/banners/799799a12e9190d6a7a0d0114287ac81.png" border="0"></a> <BR><img src="/templates/imagens/trans.gif" height="6"><BR>
324
+ <a href="/redir/47/" target="_blank"><img src="/arquivos/banners/f19d981b9ea9470fb99784931184f83c.jpg" border="0"></a> <BR><img src="/templates/imagens/trans.gif" height="6"><BR>
325
+ </td>
326
+ </tr>
327
+ <tr>
328
+ <td height="8"><img src="/templates/alunos/imagens/t17.gif"><BR></td>
329
+ </tr>
330
+ </table>
331
+ </td>
332
+ <td valign="top">
333
+ <table width="96%" align="center">
334
+ <tr>
335
+ <td valign="top">
336
+ <BR>
337
+ <div id="limite"></div>
338
+ <div id='conteudo'></div>
339
+ <table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#000000">
340
+ <tr bgcolor="#9999CC">
341
+ <td bgcolor="#47778b"><b>Disciplina</b></td>
342
+ <td valign="top" align="center" bgcolor="#47778b"><b>C. H.</b></td>
343
+ <td valign="top" align="center" bgcolor="#47778b"><b>Frequência (%)</b></td>
344
+ <td valign="top" align="center" bgcolor="#47778b"><b>Faltas</b></td>
345
+ <td valign="top" align="center" bgcolor="#47778b"><b>Atualização</b></td>
346
+ </tr>
347
+
348
+ <tr bgcolor=#FFFFFF>
349
+ <!--td><a href="#" onmouseover="toolTip('<table align=left border=0 cellpadding=3 cellspacing=1 bgcolor=#000000><tr><td bgcolor=f5f5f5><table align=center border=0 cellpadding=3 cellspacing=1 bgcolor=#000000><tr><td bgcolor=#47778b colspan=9><b>REDES DE COMPUTADORES</b></td></tr><tr bgcolor=#bdd6e0><td align=center><b>Data</b></td><td align=center><b>Faltas</b></td></tr> <tr bgcolor=#FFFFFF> <td align=center>30/09/2015</td><td align=center>2</td> </tr> </table></td></tr></table>',this)"><span id="toolTipBox" width="440"></span>REDES DE COMPUTADORES</a></td-->
350
+ <td><a href="/alunos/consultas/faltasdetalhes/0cgbPZWQdvGAnl4qVfYj7cBwfT5j3ydZUBzJpdvmJw-S-RGEfiOMq0qYYFZt7xhq8_QJO9MrhVcw2821PVX9MQ">REDES DE COMPUTADORES</a></td>
351
+ <td align="center">80h</td>
352
+ <td align="center">98%</td>
353
+ <td align="center">2</td>
354
+ <td align="center">30/11/2015</td>
355
+ </tr>
356
+ <tr bgcolor=#FFFFFF>
357
+ <!--td><a href="#" onmouseover="toolTip('<table align=left border=0 cellpadding=3 cellspacing=1 bgcolor=#000000><tr><td bgcolor=f5f5f5><table align=center border=0 cellpadding=3 cellspacing=1 bgcolor=#000000><tr><td bgcolor=#47778b colspan=9><b>REDES DE COMPUTADORES</b></td></tr><tr bgcolor=#bdd6e0><td align=center><b>Data</b></td><td align=center><b>Faltas</b></td></tr> <tr bgcolor=#FFFFFF> <td align=center>30/09/2015</td><td align=center>2</td> </tr> </table></td></tr></table>',this)"><span id="toolTipBox" width="440"></span>REDES DE COMPUTADORES</a></td-->
358
+ <td><a href="/alunos/consultas/faltasdetalhes/0cgbPZWQdvGAnl4qVfYj7cBwfT5j3ydZUBzJpdvmJw-S-RGEfiOMq0qYYFZt7xhq8_QJO9MrhVcw2821PVX9MQ">MATEMATICA APLICADA</a></td>
359
+ <td align="center">80h</td>
360
+ <td align="center">100%</td>
361
+ <td align="center">0</td>
362
+ <td align="center">30/11/2015</td>
363
+ </tr>
364
+
365
+ </table>
366
+ <BR>
367
+ <center>
368
+ <b>Atenção:</b> Registro de faltas para simples conferência, quantidade de faltas sujeito a alteração,<BR>caso professor entregue listas de presença posteriormente da data da atualização.
369
+ <BR><BR>
370
+ Acesse <b>"<a href="/alunos/consultas/historico/">Histórico Escolar</a>"</b> para consultar disciplinas já encerradas.
371
+ </center>
372
+ <BR>
373
+ <div id="limite2"></div> </td>
374
+ </tr>
375
+ </table>
376
+ </td>
377
+ <td width="1" bgcolor="#929292"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
378
+ <td width="3" background="/templates/alunos/imagens/s2.gif"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
379
+ </tr>
380
+ </table> <!-- Fim Centro da Página -->
381
+
382
+ </td>
383
+ </tr>
384
+ <tr>
385
+ <td height="20">
386
+ <table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
387
+ <tr>
388
+ <td width="3" background="/templates/alunos/imagens/s1.gif"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
389
+ <td width="1" bgcolor="#929292"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
390
+ <td><img src="/templates/alunos/imagens/trans.gif"><BR></td>
391
+ <td width="1" bgcolor="#929292"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
392
+ <td width="3" background="/templates/alunos/imagens/s2.gif"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
393
+ </tr>
394
+ </table>
395
+ </td>
396
+ </tr>
397
+ <tr>
398
+ <td height="1">
399
+ <table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
400
+ <tr>
401
+ <td width="3" background="/templates/alunos/imagens/s1.gif"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
402
+ <td width="2" bgcolor="#929292"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
403
+ <td bgcolor="#000000"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
404
+ <td width="2" bgcolor="#929292"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
405
+ <td width="3" background="/templates/alunos/imagens/s2.gif"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
406
+ </tr>
407
+ </table>
408
+ </td>
409
+ </tr>
410
+ <tr>
411
+ <td height="84">
412
+ <table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
413
+ <tr>
414
+ <td width="109"><img src="/templates/alunos/imagens/t18.jpg"><BR></td>
415
+ <td width="20" background="/templates/alunos/imagens/t19.jpg"><img src="/templates/alunos/imagens/trans.gif"><BR></td>
416
+ <td background="/templates/alunos/imagens/t19.jpg">
417
+ <font face="verdana" size="1" color="#4c4c4c">
418
+ <BR>
419
+ <B>Copyright © 2015 Centro Universitário de Araraquara - UNIARA.</B><BR>
420
+ Todos os direitos reservados - UV.2.1-WV - FALTAS-2.0-BETA-1-WV.<BR><BR>&nbsp;
421
+ </font>
422
+ </td>
423
+ <td width="15"><img src="/templates/alunos/imagens/t20.jpg"><BR></td>
424
+ </tr>
425
+ </table>
426
+ </td>
427
+ </tr>
428
+ <tr>
429
+ <td height="5">
430
+ <img src="/templates/alunos/imagens/trans.gif"><BR>
431
+ </td>
432
+ </tr>
433
+ </table>
434
+ </body>
435
+ </html>
436
+ <script type="text/javascript">
437
+
438
+ var _gaq = _gaq || [];
439
+ _gaq.push(['_setAccount', 'UA-27812250-1']);
440
+ _gaq.push(['_setDomainName', 'uniara.com.br']);
441
+ _gaq.push(['_trackPageview']);
442
+
443
+ (function() {
444
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
445
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
446
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
447
+ })();
448
+
449
+ </script>
450
+
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,9 @@
1
+ require 'coveralls'
1
2
  require 'rspec'
2
3
  require 'webmock/rspec'
3
4
  require 'simplecov'
4
5
  require 'support/fixture_helper'
6
+ Coveralls.wear!
5
7
 
6
8
  SimpleCov.start do
7
9
  add_filter '/spec/'
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+ module UniaraVirtualParser
3
+ module Services
4
+ describe Absences do
5
+ describe '.absence' do
6
+ let(:absences) { described_class.absences 'batman' }
7
+ before do
8
+ stub_request(:get,"http://virtual.uniara.com.br/alunos/consultas/faltas").
9
+ to_return(status: 200, body: uniara_virtual_fixture("absences.html").read, headers:{})
10
+ end
11
+
12
+ it 'fetches the content of uniara virtual and brings the array with absences' do
13
+ expect(absences.first.name).to eq "REDES DE COMPUTADORES"
14
+ expect(absences.first.frequency).to eq "80h"
15
+ expect(absences.length).to eq 2
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -21,9 +21,10 @@ Gem::Specification.new do |spec|
21
21
  spec.add_dependency 'hurley', '~> 0.1'
22
22
  spec.add_dependency 'nokogiri', '~> 1.6.6.2'
23
23
  spec.add_development_dependency 'bundler', '~> 1.7'
24
+ spec.add_development_dependency 'coveralls'
24
25
  spec.add_development_dependency 'rake', '~> 10.0'
25
- spec.add_development_dependency 'pry-meta'
26
26
  spec.add_development_dependency 'rspec', '~> 3.2.0'
27
27
  spec.add_development_dependency 'simplecov', '~> 0.10.0'
28
28
  spec.add_development_dependency 'webmock', '~> 1.21.0'
29
+ spec.add_development_dependency 'pry', '~> 0.10.3'
29
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uniara_virtual_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Ribeiro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-10 00:00:00.000000000 Z
11
+ date: 2016-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hurley
@@ -53,33 +53,33 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.7'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rake
56
+ name: coveralls
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: pry-meta
70
+ name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '10.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '10.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: 1.21.0
125
+ - !ruby/object:Gem::Dependency
126
+ name: pry
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 0.10.3
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 0.10.3
125
139
  description: A Gem to parse the Uniara Virtual system
126
140
  email:
127
141
  - mail@carlosribeiro.me
@@ -143,14 +157,17 @@ files:
143
157
  - bin/rake
144
158
  - lib/uniara_virtual_parser.rb
145
159
  - lib/uniara_virtual_parser/client.rb
160
+ - lib/uniara_virtual_parser/models/absence.rb
146
161
  - lib/uniara_virtual_parser/models/file.rb
147
162
  - lib/uniara_virtual_parser/models/student.rb
148
163
  - lib/uniara_virtual_parser/models/subject.rb
164
+ - lib/uniara_virtual_parser/services/absences.rb
149
165
  - lib/uniara_virtual_parser/services/files.rb
150
166
  - lib/uniara_virtual_parser/services/grades.rb
151
167
  - lib/uniara_virtual_parser/services/login.rb
152
168
  - lib/uniara_virtual_parser/services/student.rb
153
169
  - lib/uniara_virtual_parser/version.rb
170
+ - spec/fixtures/uniara_virtual/absences.html
154
171
  - spec/fixtures/uniara_virtual/files_model_1.html
155
172
  - spec/fixtures/uniara_virtual/files_model_2.html
156
173
  - spec/fixtures/uniara_virtual/grades.html
@@ -158,6 +175,7 @@ files:
158
175
  - spec/spec_helper.rb
159
176
  - spec/support/fixture_helper.rb
160
177
  - spec/uniara_virtual_parser/client_spec.rb
178
+ - spec/uniara_virtual_parser/services/absences_spec.rb
161
179
  - spec/uniara_virtual_parser/services/files_spec.rb
162
180
  - spec/uniara_virtual_parser/services/grades_spec.rb
163
181
  - spec/uniara_virtual_parser/services/login_spec.rb
@@ -188,6 +206,7 @@ signing_key:
188
206
  specification_version: 4
189
207
  summary: A Gem to parse the Uniara Virtual system
190
208
  test_files:
209
+ - spec/fixtures/uniara_virtual/absences.html
191
210
  - spec/fixtures/uniara_virtual/files_model_1.html
192
211
  - spec/fixtures/uniara_virtual/files_model_2.html
193
212
  - spec/fixtures/uniara_virtual/grades.html
@@ -195,6 +214,7 @@ test_files:
195
214
  - spec/spec_helper.rb
196
215
  - spec/support/fixture_helper.rb
197
216
  - spec/uniara_virtual_parser/client_spec.rb
217
+ - spec/uniara_virtual_parser/services/absences_spec.rb
198
218
  - spec/uniara_virtual_parser/services/files_spec.rb
199
219
  - spec/uniara_virtual_parser/services/grades_spec.rb
200
220
  - spec/uniara_virtual_parser/services/login_spec.rb