Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

debug.js 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* CalendarFetcher Tester
  2. * use this script with `node debug.js` to test the fetcher without the need
  3. * of starting the MagicMirror core. Adjust the values below to your desire.
  4. *
  5. * By Michael Teeuw https://michaelteeuw.nl
  6. * MIT Licensed.
  7. */
  8. // Alias modules mentioned in package.js under _moduleAliases.
  9. require("module-alias/register");
  10. const CalendarFetcher = require("./calendarfetcher.js");
  11. const url = "https://calendar.google.com/calendar/ical/pkm1t2uedjbp0uvq1o7oj1jouo%40group.calendar.google.com/private-08ba559f89eec70dd74bbd887d0a3598/basic.ics"; // Standard test URL
  12. //const url = "https://www.googleapis.com/calendar/v3/calendars/primary/events/"; // URL for Bearer auth (must be configured in Google OAuth2 first)
  13. const fetchInterval = 60 * 60 * 1000;
  14. const maximumEntries = 10;
  15. const maximumNumberOfDays = 365;
  16. const user = "magicmirror";
  17. const pass = "MyStrongPass";
  18. const auth = {
  19. user: user,
  20. pass: pass
  21. };
  22. console.log("Create fetcher ...");
  23. const fetcher = new CalendarFetcher(url, fetchInterval, [], maximumEntries, maximumNumberOfDays, auth);
  24. fetcher.onReceive(function (fetcher) {
  25. console.log(fetcher.events());
  26. console.log("------------------------------------------------------------");
  27. process.exit(0);
  28. });
  29. fetcher.onError(function (fetcher, error) {
  30. console.log("Fetcher error:");
  31. console.log(error);
  32. process.exit(1);
  33. });
  34. fetcher.startFetch();
  35. console.log("Create fetcher done! ");