The newsfeed
module is one of the default modules of the MagicMirror.
This module displays news headlines based on an RSS feed.
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: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml",
},
{
title: "BBC",
url: "http://feeds.bbci.co.uk/news/video_and_audio/news_front_page/rss.xml?edition=uk",
},
]
}
}
]
The following properties can be configured:
<tr>
<td><code>feeds</code></td>
<td>An array of feed urls that will be used as source.<br>
More info about this object can be found below.
<br><b>Default value:</b> <code>[
{
title: "New York Times",
url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml",
}
]</code>
</td>
</tr>
<tr>
<td><code>showSourceTitle</code></td>
<td>Display the title of the source.<br>
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
<br><b>Default value:</b> <code>true</code>
</td>
</tr>
<tr>
<td><code>showPublishDate</code></td>
<td>Display the publish date of an headline.<br>
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
<br><b>Default value:</b> <code>true</code>
</td>
</tr>
<tr>
<td><code>showDescription</code></td>
<td>Display the description of an item.<br>
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
<br><b>Default value:</b> <code>false</code>
</td>
</tr>
<tr>
<td><code>reloadInterval</code></td>
<td>How often does the content needs to be fetched? (Milliseconds)<br>
<br><b>Possible values:</b> <code>1000</code> - <code>86400000</code>
<br><b>Default value:</b> <code>300000</code> (5 minutes)
</td>
</tr>
<tr>
<td><code>updateInterval</code></td>
<td>How often do you want to display a new headline? (Milliseconds)<br>
<br><b>Possible values:</b><code>1000</code> - <code>60000</code>
<br><b>Default value:</b> <code>10000</code> (10 seconds)
</td>
</tr>
<tr>
<td><code>animationSpeed</code></td>
<td>Speed of the update animation. (Milliseconds)<br>
<br><b>Possible values:</b><code>0</code> - <code>5000</code>
<br><b>Default value:</b> <code>2000</code> (2.5 seconds)
</td>
</tr>
<tr>
<td><code>maxNewsItems</code></td>
<td>Total amount of news items to cycle through. (0 for unlimited)<br>
<br><b>Possible values:</b><code>0</code> - <code>...</code>
<br><b>Default value:</b> <code>0</code>
</td>
</tr>
</tbody>
Option | Description |
---|
The feeds
property contains an array with multiple objects. These objects have the following properties:
<tr>
<td><code>title</code></td>
<td>The name of the feed source to be displayed above the news items.<br>
<br>This property is optional.
</td>
</tr>
<tr>
<td><code>url</code></td>
<td>The url of the feed used for the headlines.<br>
<br><b>Example:</b> <code>'http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml'</code>
</td>
</tr>
<tr>
<td><code>encoding</code></td>
<td>The encoding of the news feed.<br>
<br>This property is optional.
<br><b>Possible values:</b><code>'UTF-8'</code>, <code>'ISO-8859-1'</code>, etc ...
<br><b>Default value:</b> <code>'UTF-8'</code>
</td>
</tr>
</tbody>
Option | Description |
---|