Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
ifro-aqs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alan de Oliveira
ifro-aqs
Commits
19e88eab
Commit
19e88eab
authored
Aug 17, 2018
by
Alan de Oliveira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cursos
parent
5d95b066
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
2 deletions
+93
-2
cursos.js
functions/cursos.js
+89
-0
horario.js
functions/horario.js
+1
-1
index.js
functions/index.js
+3
-1
No files found.
functions/cursos.js
0 → 100644
View file @
19e88eab
const
{
dialogflow
,
SimpleResponse
,
BasicCard
,
Carousel
,
BrowseCarousel
,
BrowseCarouselItem
,
Image
,
Item
,
List
,
Suggestions
}
=
require
(
'actions-on-google'
);
const
request
=
require
(
'sync-request'
);
exports
.
action
=
(
conv
)
=>
{
conv
.
ask
(
'aqui estão:'
);
// Create a browse carousel
conv
.
ask
(
new
BrowseCarousel
({
items
:
[
new
BrowseCarouselItem
({
title
:
'Bacharelado em Agronomia'
,
url
:
'https://portal.ifro.edu.br/ariquemes/cursos/4183-engenharia-agronomica'
,
description
:
'Carga Horária: 4.500 horas
\
n'
+
'Vagas: 40
\
n'
+
'Duração: 5 a 10 anos
\
n'
,
image
:
new
Image
({
url
:
"https://upload.wikimedia.org/wikipedia/commons/f/f5/Agro_logo.png"
,
alt
:
'imagem agronomia'
,
}),
footer
:
'INTEGRAL'
,
}),
new
BrowseCarouselItem
({
title
:
'Licenciatura em Ciências Biológicas'
,
url
:
'https://portal.ifro.edu.br/ariquemes/cursos/1979-ciencias-biologicas-licenciatura'
,
description
:
'Carga Horária: 3.338 horas
\
n'
+
'Vagas: 40
\
n'
+
'Duração: 8 à 16 Semestres
\
n'
,
image
:
new
Image
({
url
:
'https://learn.studyhubb.com/wp-content/uploads/group-avatars/1/5aaf20be9f4dd-bpfull.png'
,
alt
:
'logo biologia'
,
}),
footer
:
'NOTURNO'
,
}),
new
BrowseCarouselItem
({
title
:
'Técnico em Agropecuária'
,
url
:
'https://portal.ifro.edu.br/ariquemes/cursos/1983-tecnico-em-agropecuaria-integrado'
,
description
:
'Carga Horária: 3.792 horas
\
n'
+
'Vagas: 80
\
n'
+
'Duração: 3 a 6 anos
\
n'
,
image
:
new
Image
({
url
:
'https://ifrs.edu.br/ibiruba/wp-content/uploads/sites/4/2017/12/logo.png'
,
alt
:
'logo agropecuaria'
,
}),
footer
:
'INTEGRAL'
,
}),
new
BrowseCarouselItem
({
title
:
'Técnico em Alimentos'
,
url
:
'https://portal.ifro.edu.br/ariquemes/cursos/1985-tecnico-em-alimentos-integrado'
,
description
:
'Carga Horária: 3.407 horas
\
n'
+
'Vagas: 80
\
n'
+
'Duração: 3 a 6 anos
\
n'
,
image
:
new
Image
({
url
:
'http://ingresso.ifc.edu.br/wp-content/uploads/sites/6/2014/04/TIntegrado-Alimentos-1-e1475872981484-300x233.png'
,
alt
:
'logo alimentos'
,
}),
footer
:
'INTEGRAL'
,
}),
new
BrowseCarouselItem
({
title
:
'Técnico em Manutenção e Suporte em Informática'
,
url
:
'https://portal.ifro.edu.br/ariquemes/cursos/1987-tecnico-em-suporte-e-manutencao-em-informatica-integrado'
,
description
:
'Carga Horária: 3.400 horas
\
n'
+
'Vagas: 80
\
n'
+
'Duração: 3 a 6 anos
\
n'
,
image
:
new
Image
({
url
:
'https://ifrs.edu.br/ibiruba/wp-content/uploads/sites/4/2017/12/logo-1.png'
,
alt
:
'logo informatica'
,
}),
footer
:
'MATUTINO E VESPERTINO'
,
}),
new
BrowseCarouselItem
({
title
:
'Técnico em Aquicultura'
,
url
:
'https://portal.ifro.edu.br/ariquemes/cursos/1981-tecnico-em-aquicultura-subsequente'
,
description
:
'Carga Horária: 1.100 horas
\
n'
+
'Vagas: 40
\
n'
+
'Duração: 3 a 6 Semestres
\
n'
,
image
:
new
Image
({
url
:
'http://foz.ifpr.edu.br/wp-content/uploads/2015/05/Logo-Aquicultura.png'
,
alt
:
'logo aquicultura'
,
}),
footer
:
'NOTURNO'
,
}),
],
}));
}
functions/horario.js
View file @
19e88eab
...
@@ -84,7 +84,7 @@ exports.action = (conv) => {
...
@@ -84,7 +84,7 @@ exports.action = (conv) => {
let
speech
=
"Encontrei essas aulas: "
;
let
speech
=
"Encontrei essas aulas: "
;
horario
.
aulas
.
forEach
(
a
=>
{
horario
.
aulas
.
forEach
(
a
=>
{
var
naula
=
a
.
nomeClasse
.
substring
(
a
.
nomeClasse
.
indexOf
(
"-"
)
+
1
,
a
.
nomeClasse
.
length
);
var
naula
=
a
.
nomeClasse
.
substring
(
a
.
nomeClasse
.
indexOf
(
"-"
)
+
1
,
a
.
nomeClasse
.
length
);
text
=
text
.
concat
(
`__
${
naula
}
__
,
às *
${
a
.
horarioInicio
}
*; \n`
);
text
=
text
.
concat
(
`__
${
naula
}
__ às *
${
a
.
horarioInicio
}
*; \n`
);
speech
=
speech
.
concat
(
`às
${
a
.
horarioInicio
}
, aula de
${
naula
}
. `
);
speech
=
speech
.
concat
(
`às
${
a
.
horarioInicio
}
, aula de
${
naula
}
. `
);
});
});
...
...
functions/index.js
View file @
19e88eab
...
@@ -2,10 +2,12 @@ const functions = require('firebase-functions');
...
@@ -2,10 +2,12 @@ const functions = require('firebase-functions');
const
{
dialogflow
}
=
require
(
'actions-on-google'
);
const
{
dialogflow
}
=
require
(
'actions-on-google'
);
const
horario
=
require
(
'./horario'
);
const
horario
=
require
(
'./horario'
);
const
help
=
require
(
'./help'
);
const
help
=
require
(
'./help'
);
const
cursos
=
require
(
'./cursos'
);
let
app
=
dialogflow
({
debug
:
true
});
let
app
=
dialogflow
({
debug
:
true
});
app
.
intent
(
'horario'
,
horario
.
action
);
app
.
intent
(
'horario'
,
horario
.
action
);
app
.
intent
(
'help'
,
help
.
action
);
app
.
intent
(
'help'
,
help
.
action
);
app
.
intent
(
'cursos'
,
cursos
.
action
);
exports
.
actionsifro
=
functions
.
https
.
onRequest
(
app
);
exports
.
actionsifro
=
functions
.
https
.
onRequest
(
app
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment