MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. lolo
    3. Best
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    L
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 29
    • Groups 0

    Posts

    Recent Best Controversial
    • MMM-HNB-Exchange

      It uses API from HNB (Croatian National Bank) to pull currency exchange rate data for croatian kuna.

      Screenshot

      mode: “carousel” - rotate between currency
      Capture.PNG

      mode: “table”
      Capture2.PNG

      Download
      MMM-HNB-Exchange

      Configuration:

      {
          module: "MMM-HNB'Exchange",
          position: "top_right",
          config: {
              decimal: 2, 
              currency: ['GBP', 'USD', 'EUR', 'BAM', 'AUD', 'CAD'],
              mode: "table", //"carousel"  or  "table"
          }
      },          
      

      Version:
      28.12.2020 - v1.0.0 - Initial Release

      posted in Productivity
      L
      lolo
    • MMM-Fuel-HR fuel prices from various gas station in Croatia

      I am very happy to announce one of the first module. Others are still in the alpha version and this one is in beta.

      Description:
      It is scraping for fuel prices, location and distance of various gas stations in Croatia. The result is returned as the lowest price in the radius of the selected location.
      It is limited to show up to five OPEN stations in range of radius.

      Screenshots:
      Capture.PNG
      Download
      MMM-Fuel-HR

      Version
      23.12.2020 - v1.0.0 - Initial Release Beta

      Any feedback from anyone is more than welcome.

      posted in Transport
      L
      lolo
    • RE: module that displays a certain text from a website, the text on the website is updated daily

      This should be your node_helper.

      const NodeHelper = require("node_helper");
      const cheerio = require("cheerio");
      const request = require('request');
      
      module.exports = NodeHelper.create({
      
          start: function () {
              self = this;
              console.log("Starting node_helper for: " + this.name);
          },
      
          getData: function () {
              const url = 'https://wol.jw.org/hr/wol/h/r19/lp-c';
              request({
                  url: url,
                  method: 'GET'
              }, (error, response, body) => {
                  if (error) {
                      return console.error(error)
                  };
      
                  var $ = cheerio.load(body);
                  //console.log($.html());
                  const data = $('div[class="tabContent"]').first();
      
                  let header = $(data).find('h2').text();
                  let title = $(data).find('p').first().text();
                  let text = $(data).find('div.pGroup>p').text();
                  //console.log(header,title,text);
                  var recivedData = {
                      header,
                      title,
                      text
                  }
      			console.log(recivedData);
                  
      			self.sendSocketNotification('TEXT_RESULT', recivedData);
              });
          },
      
          socketNotificationReceived: function (notification, payload) {
      
              if (notification === 'GET_TEXT_DATA') {
                  self.getData();
              }
          },
      });
      
      
      posted in Requests
      L
      lolo
    • 1 / 1