MagicMirror² DocsMagicMirror² Docs
Donate
Discord
Forum
GitHub
Donate
Discord
Forum
GitHub
  • Getting Started

    • Introduction
    • Requirements
    • Installation & Usage
    • Upgrade Guide
  • Configuration

    • Introduction
    • Autostart your MagicMirror²
    • Raspberry Specific
  • Modules

    • Introduction
    • Module Configuration
    • Default Modules

      • Alert
      • Calendar
      • Clock
      • Compliments
      • Hello World
      • News Feed
      • Update Notification
      • Weather Module
    • Animation Guide
  • Module Development

    • Introduction
    • The Core module file
    • The Node Helper
    • MagicMirror Helper Methods
    • Logger
    • Notifications
    • Weather Module Weather Provider Development
    • How to write good documentation
  • About

    • MagicMirror² Manifesto
    • Contributing Guidelines
    • Donate
    • Support
    • License

News Feed

The newsfeed module is one of the default modules of the MagicMirror. This module displays news headlines based on an RSS feed. Scrolling through news headlines happens time-based (updateInterval), but can also be controlled by sending news feed specific notifications to the module.

Screenshot

NYT News Feed Screenshot

Using the module

Configuration

To use this module, add it to the modules array in the config/config.js file:

modules: [
  {
    module: "newsfeed",
    position: "bottom_bar", // This can be any of the regions. Best results in center regions.
    config: {
      // The config property is optional.
      // If no config is set, an example calendar is shown.
      // See 'Configuration options' for more information.

      feeds: [
        {
          title: "New York Times",
          url: "https://www.nytimes.com/services/xml/rss/nyt/HomePage.xml",
        },
        {
          title: "BBC",
          url: "https://feeds.bbci.co.uk/news/video_and_audio/news_front_page/rss.xml?edition=uk",
        },
      ],
    },
  },
];

Notifications

Interacting with the module

MagicMirror's notification mechanism allows to send notifications to the newsfeed module. The following notifications are supported:

Notification IdentifierDescription
ARTICLE_NEXTShows the next news title (hiding the summary or previously fully displayed article)
ARTICLE_PREVIOUSShows the previous news title (hiding the summary or previously fully displayed article)
ARTICLE_MORE_DETAILSWhen received the first time, shows the corresponding description of the currently displayed news title.
The module expects that the module's configuration option showDescription is set to false (default value).

When received a second consecutive time, shows the full news article in an IFRAME.
This requires that the news page can be embedded in an IFRAME, e.g. doesn't have the HTTP response header X-Frame-Options set to e.g. DENY.

When received the next consecutive times, reloads the page and scrolls down by scrollLength pixels to paginate through the article.
ARTICLE_LESS_DETAILSHides the summary or full news article and only displays the news title of the currently viewed news item.
ARTICLE_TOGGLE_FULLToggles article in fullscreen.
ARTICLE_INFO_REQUESTCauses newsfeed to respond with the notification ARTICLE_INFO_RESPONSE, the payload of which provides the title, source, date, desc and url of the current news title.

Notifications sent by the module

MagicMirror's notification mechanism can also be used to send notifications from the current module to all other modules. The following notifications are broadcasted from this module:

Notification IdentifierDescription
NEWS_FEEDBroadcast the current list of news items.
NEWS_FEED_UPDATEBroadcasts the list of updates news items.

Note the payload of the sent notification event is ignored.

Example

The following example shows how the next news article title can be displayed on the MagicMirror.

this.sendNotification("ARTICLE_NEXT");

newsfeed specific notification emitting modules

The third party MMM-Gestures module supports above notifications when moving your hand up, down, left or right in front of a gesture sensor attached to the MagicMirror. See module's readme for more details.

Configuration options

The following properties can be configured:

OptionDescription
feedsAn array of feed urls that will be used as source.
More info about this object can be found below.
Default value: [{ title: "New York Times", url: "https://www.nytimes.com/services/xml/rss/nyt/HomePage.xml", encoding: "UTF-8" }]
You can add reloadInterval option to set particular reloadInterval to a feed.
showAsListDisplay the news as a list.

Possible values: true or false
Default value: false
showSourceTitleDisplay the title of the source.

Possible values: true or false
Default value: true
showPublishDateDisplay the publish date of an headline.

Possible values: true or false
Default value: true
broadcastNewsFeedsGives the ability to broadcast news feeds to all modules, by using sendNotification() when set to true, rather than sendSocketNotification() when false

Possible values: true or false
Default value: true
broadcastNewsUpdatesGives the ability to broadcast news feed updates to all modules

Possible values: true or false
Default value: true
showDescriptionDisplay the description of an item.

Possible values: true or false
Default value: false
showTitleAsUrlIf set, the displayed title is a link to the article which is useful when running in a browser and you want to read this article.

Possible values: true or false
Default value: false
wrapTitleWrap the title of the item to multiple lines.

Possible values: true or false
Default value: true
wrapDescriptionWrap the description of the item to multiple lines.

Possible values: true or false
Default value: true
truncDescriptionTruncate description?

Possible values: true or false
Default value: true
lengthDescriptionHow many characters to be displayed for a truncated description?

Possible values: 1 - 500
Default value: 400
hideLoadingHide module instead of showing LOADING status.

Possible values: true or false
Default value: false
reloadIntervalHow often does the content needs to be fetched? (Milliseconds)

Possible values: 1000 - 86400000
Default value: 300000 (5 minutes)
updateIntervalHow often do you want to display a new headline? (Milliseconds)

Possible values:1000 - 60000
Default value: 10000 (10 seconds)
animationSpeedSpeed of the update animation. (Milliseconds)

Possible values:0 - 5000
Default value: 2500 (2.5 seconds)
maxNewsItemsTotal amount of news items to cycle through. (0 for unlimited)

Possible values:0 - ...
Default value: 0
ignoreOldItemsIgnore news items that are outdated.

Possible values:true or false
Default value: false
ignoreOlderThanHow old should news items be before they are considered outdated? (Milliseconds)

Possible values:1 - ...
Default value: 86400000 (1 day)
removeStartTagsSome news feeds feature tags at the beginning of their titles or descriptions, such as [VIDEO]. This setting allows for the removal of specified tags from the beginning of an item's description and/or title.

Possible values:'title', 'description', 'both'
startTagsList the tags you would like to have removed at the beginning of the feed item

Possible values: ['TAG'] or ['TAG1','TAG2',...]
removeEndTagsRemove specified tags from the end of an item's description and/or title.

Possible values:'title', 'description', 'both'
endTagsList the tags you would like to have removed at the end of the feed item

Possible values: ['TAG'] or ['TAG1','TAG2',...]
prohibitedWordsRemove news feed item if one of these words is found anywhere in the title (case insensitive and greedy matching)

Possible values: ['word'] or ['word1','word2',...]
scrollLengthScrolls the full news article page by a given number of pixels when a ARTICLE_MORE_DETAILS notification is received and the full news article is already displayed.

Possible values: 1 or 10000
Default value: 500
logFeedWarningsLog warnings when there is an error parsing a news article.

Possible values: true or false
Default value: false

The feeds property contains an array with multiple objects. These objects have the following properties:

OptionDescription
titleThe name of the feed source to be displayed above the news items.

This property is optional.
urlThe url of the feed used for the headlines.

Example: 'https://www.nytimes.com/services/xml/rss/nyt/HomePage.xml'
encodingThe encoding of the news feed.

This property is optional.
Possible values: 'UTF-8', 'ISO-8859-1', etc ...
Default value: 'UTF-8'
useCorsProxyUses the internal cors proxy to avoid cors errors.

This property is optional.
Possible values: true or false
Default value: true
ignoreOldItemsOverrides the property defined for the module (see above) for the specific feed
ignoreOlderThanOverrides the property defined for the module (see above) for the specific feed
Help us improve this page!
Last Updated:: 4/30/25, 8:00 PM
Prev
Hello World
Next
Update Notification