|
|
|
@ -68,7 +68,7 @@ async function init() {
|
|
|
|
|
'⌛ trouver les évènements qui ne font pas partie de la BDD mobilizon postgresql',
|
|
|
|
|
);
|
|
|
|
|
feed.items.forEach((eventFound) => {
|
|
|
|
|
console.log(eventFound.title);
|
|
|
|
|
// console.log(eventFound.title);
|
|
|
|
|
// console.log('item', item)
|
|
|
|
|
utilsTools.agendadulibre.doesEventExists(eventFound);
|
|
|
|
|
});
|
|
|
|
@ -112,26 +112,35 @@ async function init() {
|
|
|
|
|
utilsTools.agendadulibre.queryToAdd.forEach((graphQLquery: any) => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (limiter && !counter) {
|
|
|
|
|
if (limiter && counter<1) {
|
|
|
|
|
counter++;
|
|
|
|
|
console.log('graphQLquery.variables.title', graphQLquery.variables.title);
|
|
|
|
|
console.log(counter,' * ', graphQLquery.variables.title);
|
|
|
|
|
|
|
|
|
|
const body = {
|
|
|
|
|
operationName: "createEvent",
|
|
|
|
|
query: graphQLquery.query,
|
|
|
|
|
variables: graphQLquery.variables
|
|
|
|
|
}
|
|
|
|
|
// fetch(parserConfig.dev_url, {
|
|
|
|
|
// method: "post",
|
|
|
|
|
// body: JSON.stringify(body),
|
|
|
|
|
// headers: {"Content-Type": "application/json"}
|
|
|
|
|
// })
|
|
|
|
|
// .then(res => {
|
|
|
|
|
// res.json()
|
|
|
|
|
// console.log('succès');
|
|
|
|
|
// })
|
|
|
|
|
// .then(json => console.log(json))
|
|
|
|
|
// .catch(err => console.log(err))
|
|
|
|
|
|
|
|
|
|
if(parserConfig.enableFetch){
|
|
|
|
|
fetch(parserConfig.dev_mode? parserConfig.dev_url : parserConfig.mobilizon_public_url, {
|
|
|
|
|
method: "post",
|
|
|
|
|
body: JSON.stringify(body),
|
|
|
|
|
headers: {
|
|
|
|
|
"Content-Type": "application/json",
|
|
|
|
|
"authorization": "Bearer "+parserConfig.bearer_token,
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.then((res:any) => {
|
|
|
|
|
res.json()
|
|
|
|
|
console.log('succès');
|
|
|
|
|
})
|
|
|
|
|
.then((json:any) => console.log(json))
|
|
|
|
|
.catch((err:any) => console.log(err))
|
|
|
|
|
}else{
|
|
|
|
|
console.log('---- le fetch est désactivé');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|