Using a cronjob on node for storing a json file, parsing it and update a database
Clash Royale CLAN TAG #URR8PPP .everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0; up vote 0 down vote favorite I need to retrieve a file from a website every minute that contains boats location. Then, I parse the file, delete all the boats from my database and re-create all of them at the new position indicated in the file. Here's my code so far - in the server.js of my loopbackjs app: var CronJob = require('cron').CronJob; var exec = require("child_process").exec; var reload = require('require-reload')(require); var app = module.exports = loopback(); // Bootstrap the application, configure models, datasources and middleware.(loopbackjs mandatory code) boot(app, __dirname, function (err) if (err) throw err; var Boat = app.models.Boat; var ais_url_france = 'http://data.aishub.net/ws.php?username=XXXXXXXXX&format=1&output=json&compress=0&latmin=40&latmax=52&lonmin=-5&...