Read the statement by Michael Teeuw here.
Character set for news fed text '
-
@huskernut0878 well that didn’t work. It displays Bob ( the code for an apostrophe ) s
-
@huskernut0878 you could try to change the character encoding
see
https://docs.magicmirror.builders/modules/newsfeed.html#configuration-options -
@sdetweil thank you, that did not make a difference.
-
@huskernut0878 there is a similar issue open
https://github.com/MichMich/MagicMirror/issues/2712
the possible fix seems to open a big security exposure
-
@huskernut0878
I had the same frustrating issue - here’s my solution -I actually made a fix for this that works fine for me - Not sure how to present it - but in the newsfeed.js make the following changes
-
At the end of the defaults of the newsfeed.js add the line replaceMe: [] as shown below -
logFeedWarnings: false, replaceMe: []},
-
In the getTemplateData: function () { add the following before the return { loaded: true,
basically everything in the jep section all between the //*******
return item;}); //******* //jep to fix title for various translations such as // a simple ' instead of showing ' // also replace things like Seattle with Seattle, WA var tempTitle = item.title; for(let i = 0; i < this.config.replaceMe.length; i+= 2) { tempTitle = tempTitle.toString().replaceAll(this.config.replaceMe[i], this.config.replaceMe[i+1]); } //********************** return { loaded: true,
2A. In the return section -add the jep line as shown below
publishDate: moment(new Date(item.pubdate)).fromNow(),
title: tempTitle, //jep see above
description: item.description,- Finally - in your config.js - the area for the newsfeed - at the end add this and edit it for the items you want changed…
replaceMe: [ "'", "'", "Seattle", "Seattle, WA", "Biden", "(Pres) Biden", "Zuckerberg", "Zuckerberg [DATA]"](sam, edited to add code block, which preserves the style of the quotes, else u get word processing style, which breaks config.js))
This will replace the 1st item with the 2nd item, etc… Add whatever translations you want (: I’ve had some fun with the replacements…
-
-
@j_joe u should propose that as a fix for the above listed issue…
moves control to the user, and eliminates a possible hack exposure
-
@sdetweil
Not sure how to do that (: -
@j_joe go to the link, and add a comment to the existing issue on how you solved this…
copy your info here, there in the comment -
Got it - thank you. Done.
I hope my solution works for people. It’s been great for me and my needs! And it’s simple. How ever many items are in the array - it will look for them and replace them as dictated by the array… -
@j_joe thank you, this worked for me. but i did have some trouble. only way i coudl get it to work for some reason was to place the character replacement array in the default section of newsfeed.js instead of in config.js
-
@j_joe Thank you. I am very new to this and dont know what some of the things you are saying even are such as "In the getTemplateData: function () " and “in the return section” but that gives me some things to figure out. The best way to understand is to figure things out. Thanks again.
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