MagicMirror² v2.12.0 is available! For more information about this release, check out this topic.

MMM-Facebook



  • Greetings,
    almost 2 years since my last contribution here and thanks to Covid19 #stay_home am back again with lots of great ideas 🙂
    I want to create a facebook notifications module using this simple idea:
    1- login to mbasic.facebook.com through iframe (simple to user and more secure than typing account details in config.js plus I can’t find any API for that yet.
    2- parse the very basic html tags https://mbasic.facebook.com data and extract :

    <strong>Notifications< span aria-label="X new">(X)</strong>
    
    Messages< span aria-label="X unread">(X)
    
    Friends< span aria-label="X new requests">(X)
    
    <strong>Pages< span aria-label="XX new alerts">(XX)</strong>
    

    and so on…
    3- Create a Facebook like notification bar/icons with red counter bubble of parsed X number for each notification.
    4- regular check/update the page to get the new count and send.notification
    to the Alert module (playing some notify sound).
    the module config would be like that:

    session.login:"true",  /*set for the first time(login) only*/
    sound.notify:"true",   /*enable sound notification through local file (omx or vlc to play) or through send.notification Alert module if current X the notification number higher than old X */ 
    update.interval:"10", /* minutes maybe*/
    style:"2", /* kinda optional for view style 0 horizontal 1 vertical 2 themed...etc 
    

    The great news is all facebook notifications, messages, page messages, page notifications, friend request…etc are enclosed in simple html tags can be parsed easily also we can skip the iframe part here and login from any iframe module the login data will be saved to mirror cache… but the bad news is I don’t know how (very newbie in JS coding from scratch).
    Kindly help me creating such great and useful module I’ve seen some tutorials in parsing data using node.JS but it’s kinda hard to me

    Thanks in advance


Log in to reply