so i put back in the utf8 and then added <br>
after i echo the filename and now its working fine now, i need to tweek it more to suit my needs but so far so good! thanks for your help @sdetweil im sure ill be asking more silly questions again soon! :)
Read the statement by Michael Teeuw here.
Posts
-
RE: folder monitor/ file creation...
-
RE: folder monitor/ file creation...
here is the script that im using to retreve file names…
#!/bin/bash TARGET=/media/TheVault/UnWatched/ PROCESSED=/media/TheVault/Torrentopia/Torrent-Files/ inotifywait -m -e create -e moved_to -r --format "%f" $TARGET \ | while read FILENAME do echo Detected $FILENAME, Adding to list... echo $FILENAME | cat - $PROCESSED/new-tv-list.txt > temp && mv temp $PROCESSED/new-tv-list.txt # echo $FILENAME `date` >> $PROCESSED/new-tv-list.txt cp $PROCESSED/new-tv-list.txt /home/pi/MagicMirror/new-tv-list.txt done
if i take out the utf8 part i get an [object array buffer] instead of my file names…
-
RE: folder monitor/ file creation...
i have it partly working… i have the contents displaying on my mirror but its all showing up on one line, how can i display it with each line break as in txt file?
deluge.js:Module.register("deluge",{ defaults: { updateInterval: 30 * 60 * 1000 //reads the file every 30 mins }, start: function(){ this.sendSocketNotification("START", this.config); }, socketNotificationReceived: function(notification, payload) { if(notification === "DATA"){ this.dataFile = payload; this.updateDom(); } }, getDom: function(){ var wrapper = document.createElement("div"); if(this.dataFile){ wrapper.innerHTML = this.dataFile; } else { wrapper.innerHTML = "No data"; } return wrapper; } });
and my node helper.js
const NodeHelper = require("node_helper"); const fs= require("fs"); module.exports = NodeHelper.create({ //here comes the part of the nodehelper after the 3 dots as posted above socketNotificationReceived: function(notification, payload) { if(notification === "START"){ this.config = payload; this.readData(); setInterval(() => { this.readData(); }, this.config.updateInterval); } }, readData: function(){ //to read a file to do the following fs.readFile("new-tv-list.txt", "utf8", (err, data) => { if (err) throw err; this.sendSocketNotification("DATA", data); }); } });
thanks
-
RE: .txt file include
hi,
sorry to be dragging up old posts, but im trying to get my mirror to display the contents of a txt file and i have it partly working… i have the contents displaying on my mirror but its all showing up on one line, how can i display it with each line break as in txt file?thanks
-
RE: folder monitor/ file creation...
@sdetweil thanks for the reply, unfortunately all that is a little bit above my head atm, any chance you’d have a link or some info on how to implement the code?
Richie
-
RE: MMM-AssistantMk2
howdy,
ive seen a couple of people running assistantmk2 v2 and i liked the interface better than the v3 and i was wondering if its possible to install the v2 instead of v3. how would i go about downgrading to v2?
thanks
Richie
-
RE: A whole lot upgrades to my MagicMirror, finally!
ah i see… so its taken from the nokia apps! Im looking for the same but with either ios or google fit!
thanks for your reply! :)
-
folder monitor/ file creation...
Hi folks,
i was just wondering if its possible to have a module that monitors a folder for new files/downloads and prints the last say 5 or 10 results on the mirror?
many thanks,
Richie -
RE: A whole lot upgrades to my MagicMirror, finally!
hi,
What module did you use for your health data (weight etc)
thanks
Richie -
RE: Family Dashboard
hi, your setup looks great, i was wondering how is it possible to use assistantMk2 V2, ive installed V3 but prefer the layout of V2.
Thanks
Richie