Access the iCloud API
###for contact fetching
var icloud = require('icloud');
var instance = icloud();
instance.login("username", "password", function(err) {
if (err) return console.log('login failed');
instance.contacts(function(err, results) {
if (err) return console.log('failed to fetch contacts');
console.log(results.contacts);
});
});
###for event fetching
var icloud = require('icloud');
var instance = icloud();
instance.login("username", "password", function(err) {
if (err) return console.log('login failed');
instance.calendar(function(err, results) {
if (err) return console.log('failed to fetch events');
console.log(results);
});
});
####in the index.js, you can change the Date Range
for the range of events you would like to fetch
The implementation is heavily inspired by pycloud