MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    show ICLOUD ToDo's on Mirror

    Scheduled Pinned Locked Moved Development
    1 Posts 1 Posters 1.3k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      Dimonic
      last edited by

      On mir first version of the MagicMirror i’ve created a php file witch loads ICLOUD ToDo’s and shows it on the Mirror. Now i’ve updated to MagicMirror² an i have to create a Module witch loads the ToDo’s from the ICLOUD too.
      In the fist Version i used CURL to create the request for the ICLOUD, now i have to use something else to realize the request in JavaScript.

      Is there anyone who could help me with this?

      I’ve tried already NPM REQUEST but i have no Solution for CURLOPT_CUSTOMREQUEST, “REPORT”); and CURLOPT_RETURNTRANSFER, 1);

      This was my old php / CURL Request:
      // Do CalDAV request to iCloud
      $request_body = ‘’;
      $request_body .= ‘<c:calendar-query xmlns:d=“DAV:” xmlns:c=“urn:ietf:params:xml:ns:caldav”>’;
      $request_body .= ’ <d:prop>‘;
      $request_body .= ’ <c:calendar-data>’;
      $request_body .= ’ </c:calendar-data>‘;
      $request_body .= ’ </d:prop>’;
      $request_body .= ’ <c:filter>‘;
      $request_body .= ’ <c:comp-filter name=“VCALENDAR”>’;
      $request_body .= ’ <c:comp-filter name=“VTODO”>‘;
      $request_body .= ’ </c:comp-filter>’;
      $request_body .= ’ </c:comp-filter>‘;
      $request_body .= ’ </c:filter>’;
      $request_body .= ‘</c:calendar-query>’;
      $request_body = sprintf($request_body);

      $url = ‘https://’.$my_icloud_server.‘-caldav.icloud.com/’.$my_user_id.‘/calendars/’.$my_calendar_id.‘/’;
      $c = curl_init($url);
      curl_setopt($c, CURLOPT_HTTPHEADER, array( “Depth: 1”,
      “Content-Type: text/xml; charset=‘UTF-8’”,
      “User-Agent: DAVKit/4.0.1 (730); CalendarStore/4.0.1 (973); iCal/4.0.1 (1374); Mac OS X/10.6.2 (10C540)”
      ));
      curl_setopt($c, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
      curl_setopt($c, CURLOPT_USERPWD, $my_icloud_username.“:”.$my_icloud_password);
      curl_setopt($c, CURLOPT_CUSTOMREQUEST, “REPORT”);
      curl_setopt($c, CURLOPT_POSTFIELDS, $request_body);
      curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
      $caldav_answer = curl_exec($c);
      curl_close($c);

      $caldav_answer_object = simplexml_load_string($caldav_answer, ‘SimpleXMLElement’, LIBXML_NOCDATA);
      $caldav_answer_array = @json_decode(@json_encode($caldav_answer_object),1);;

      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • 1 / 1
      • First post
        Last post
      Enjoying MagicMirror? Please consider a donation!
      MagicMirror created by Michael Teeuw.
      Forum managed by Sam, technical setup by Karsten.
      This forum is using NodeBB as its core | Contributors
      Contact | Privacy Policy