Plugin info Du Monde
2 participants
Page 1 sur 1
Plugin info Du Monde
plugin info du monde avec un site qui son api converti un flux rss en format json : https://rss-to-json-serverless-api.vercel.app/api?feedURL= // ici un site avec du contenus en flux rss
sur ce plugin j'utilise le site le monde pour lire des infos en flux rss/xml : https://www.lemonde.fr/rss/une.xml
un beau cadeau pour les utilisateurs de jarvis et sarah pour developper des plugins sur des site avec du contenus en flux rss (xml)
exports.action = function(data, callback){
var tblCommand = {
infoMonde : function() {infoMonde (data, client);
},
command2 : function() {command2 (data, client);
}
};
let client = setClient(data);
info("InfoDuMonde:", data.action.command, "From:", data.client, "To:", client);
tblCommand[data.action.command]();
callback();
}
function infoMonde (data, client) {
fetch('https://rss-to-json-serverless-api.vercel.app/api?feedURL=https://www.lemonde.fr/rss/une.xml')
.then(response => response.json())
.then(reponse2 => {
console.log(reponse2)
Avatar.speak("Info un." + ":" + reponse2.items[0].description + "." + " " +
"Info deux." + ":" + reponse2.items[1].description + "." + " " +
"Info trois." + ":" + reponse2.items[2].description + "." + " " +
"Info quatre." + ":" + reponse2.items[3].description + "." + " " +
"Info cinq." + ":" + reponse2.items[4].description , data.client, () => {
Avatar.Speech.end(data.client);
});
})
}
function demandeContinue (data, client) {
}
function command2 (data, client) {
}
function setClient (data) {
var client = data.client;
if (data.action.room)
client = (data.action.room != 'current') ? data.action.room : (Avatar.currentRoom) ? Avatar.currentRoom : Config.default.client;
if (data.action.setRoom)
client = data.action.setRoom;
return client;
}
sur ce plugin j'utilise le site le monde pour lire des infos en flux rss/xml : https://www.lemonde.fr/rss/une.xml
un beau cadeau pour les utilisateurs de jarvis et sarah pour developper des plugins sur des site avec du contenus en flux rss (xml)
exports.action = function(data, callback){
var tblCommand = {
infoMonde : function() {infoMonde (data, client);
},
command2 : function() {command2 (data, client);
}
};
let client = setClient(data);
info("InfoDuMonde:", data.action.command, "From:", data.client, "To:", client);
tblCommand[data.action.command]();
callback();
}
function infoMonde (data, client) {
fetch('https://rss-to-json-serverless-api.vercel.app/api?feedURL=https://www.lemonde.fr/rss/une.xml')
.then(response => response.json())
.then(reponse2 => {
console.log(reponse2)
Avatar.speak("Info un." + ":" + reponse2.items[0].description + "." + " " +
"Info deux." + ":" + reponse2.items[1].description + "." + " " +
"Info trois." + ":" + reponse2.items[2].description + "." + " " +
"Info quatre." + ":" + reponse2.items[3].description + "." + " " +
"Info cinq." + ":" + reponse2.items[4].description , data.client, () => {
Avatar.Speech.end(data.client);
});
})
}
function demandeContinue (data, client) {
}
function command2 (data, client) {
}
function setClient (data) {
var client = data.client;
if (data.action.room)
client = (data.action.room != 'current') ? data.action.room : (Avatar.currentRoom) ? Avatar.currentRoom : Config.default.client;
if (data.action.setRoom)
client = data.action.setRoom;
return client;
}
halim- Messages : 93
Date d'inscription : 19/11/2022
Re: Plugin info Du Monde
merci pour ton plugin
andre guerchet- Messages : 10
Date d'inscription : 06/09/2020
Re: Plugin info Du Monde
merci andre mais depuis 10 ans tu es toujours sur sarah; il est temps que tu passe sous avatar ou jarvis
halim- Messages : 93
Date d'inscription : 19/11/2022
Re: Plugin info Du Monde
avatar non j'ai fait des essais et sa marche pas jarvis je les déjas tu parle du quelle Jarvis IA
andre guerchet- Messages : 10
Date d'inscription : 06/09/2020
Page 1 sur 1
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
|
|