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

    Posts

    Recent Best Controversial
    • RE: After update WARNING! Could not load config file.

      @sdetweil said in After update WARNING! Could not load config file.:

      t

      yep its is working thx

      posted in Troubleshooting
      U
      uok825
    • RE: Cannot find module "moment"

      @sdetweil said in Cannot find module "moment":

      git checkout master

      cd4d0118-0f5d-4070-98f5-56760aea9ae6-image.png

      posted in Troubleshooting
      U
      uok825
    • RE: Cannot find module "moment"

      @sdetweil Hi there! Problem solved. New code:

      /* Magic Mirror
       * Module: MMM-LICE
       *
       * By Mykle1
       *
       */
      const NodeHelper = require('node_helper');
      const request = require('request');
      const cheerio = require('cheerio');
      
      
      module.exports = NodeHelper.create({
      
          start: function() {
              console.log("Starting node_helper for: " + this.name);
          },
      
          getLICE: function(url) {
      		
          request({
              url: 'https://kur.altin.in/banka',
              method: 'GET'
          }, (error, response, body) => {
      		
              if (!error && response.statusCode == 200) {
                  const $ = cheerio.load(body);
      			var arr = []
                  var result = $('.fiyat');
                  result.each((_id,el) =>  (arr.push(el.children[0]['data'])))
                  var result = $('h2[id=gfiy]');
                  result.each((_id,el) =>  (arr.push(el.children[0]['data'])))
                  this.sendSocketNotification('LICE_RESULT', arr);
      
              }
      
          });
      },
      
          socketNotificationReceived: function(notification, payload) {
              if (notification === 'GET_LICE') {
                  this.getLICE(payload);
              }
          }
      });
      
      

      But i have an another problem. Turkish characters in the news seem broken. I think there is a utf-8 error but it doesn’t write anything in the logs.
      Edit: The news site is broken, it’s not a mistake about us.

      posted in Troubleshooting
      U
      uok825
    • 1 / 1