Skip to content

Instantly share code, notes, and snippets.

View kinisoftware's full-sized avatar

Joaquin Engelmo Moriche kinisoftware

View GitHub Profile
class TheMovieDBService(private val gson: Gson) {
fun getNowPlayingMovies(locale: String): List<Movie> {
val retrofit = Retrofit.Builder()
.addConverterFactory(GsonConverterFactory.create(gson))
.baseUrl("https://api.themoviedb.org/3/")
.build()
val theMovieDBAPI = retrofit.create(TheMovieDBAPI::class.java)
interface TheMovieDBAPI {
@GET("movie/now_playing")
fun getNowPlaying(
@Query("api_key") apiKey: String,
@Query("language") language: String,
@Query("page") page: Int,
@Query("region") region: String
): Call<ApiResults>
data class ApiResults(val results: List<Movie>)
data class Movie(val title: String, val originalTitle: String, val releaseDate: String, val originalLanguage: String)
implementation 'com.squareup.retrofit2:retrofit:2.1.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
const ScheduleIntentHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'IntentRequest'
&& handlerInput.requestEnvelope.request.intent.name === 'ScheduleIntent';
},
handle(handlerInput) {
const {intent} = handlerInput.requestEnvelope.request;
const slotTime = intent.slots.slotTime.value;
const talkTopic = intent.slots.talkTopic;
module.exports = {
talks: [
{"track":"1", "time": "09:00", "title":"<lang xml:lang='en-US'>Keynote</lang>", "topics":[]},
{"track":"1", "time": "10:15", "title":"Dando a amor a los tests con Kotlin", "topics":["jvm"]},
{"track":"1", "time": "11:15", "title":"Alexa, ¿has venido para quedarte?", "topics":["alexa", "asistentes de voz"]},
{"track":"1", "time": "12:15", "title":"Java 10, ¿mito o realidad?", "topics":["jvm"]},
{"track":"1", "time": "13:15", "title":"Conoce a LUIS", "topics":["microsoft", "asistentes de voz"]},
{"track":"1", "time": "15:30", "title":"Creando un juego con el asistente de Google", "topics":["google", "asistentes de voz"]},
{"track":"1", "time": "16:30", "title":"El modelo Spotify", "topics":["agile"]},
{"track":"1", "time": "17:45", "title":"Keynote de cierre", "topics":[]},
{
"interactionModel": {
"languageModel": {
"invocationName": "conferencia muy molona",
"intents": [
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
// This sample demonstrates handling intents from an Alexa skill using the Alexa Skills Kit SDK (v2).
// Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management,
// session persistence, api calls, and more.
const Alexa = require('ask-sdk-core');
const talksRepository = require('./talks-repository');
const interceptors = require('./interceptors');
const LaunchRequestHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'LaunchRequest';
// This request interceptor will log all incoming requests to this lambda
const LoggingRequestInterceptor = {
process(handlerInput) {
console.log(`Incoming request: ${JSON.stringify(handlerInput.requestEnvelope)}`);
}
};
// This response interceptor will log all outgoing responses of this lambda
const LoggingResponseInterceptor = {
process(handlerInput, response) {