2016-04-01 16:43:59 +02:00
|
|
|
# Module: News Feed
|
|
|
|
The `newsfeed ` module is one of the default modules of the MagicMirror.
|
|
|
|
This module displays news headlines based on an RSS feed.
|
|
|
|
|
|
|
|
## Using the module
|
|
|
|
|
|
|
|
To use this module, add it to the modules array in the `config/config.js` file:
|
|
|
|
````javascript
|
|
|
|
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.
|
2016-04-03 19:52:13 +02:00
|
|
|
// See 'Configuration options' for more information.
|
2016-04-20 14:39:38 +02:00
|
|
|
|
|
|
|
feeds: [
|
|
|
|
{
|
|
|
|
title: "New York Times",
|
|
|
|
url: "http://www.nytimes.com/services/xml/rss/nyt/HomePage.xml",
|
|
|
|
},
|
|
|
|
{
|
2016-05-06 11:29:17 +02:00
|
|
|
title: "BBC",
|
2016-04-20 14:39:38 +02:00
|
|
|
url: "http://feeds.bbci.co.uk/news/video_and_audio/news_front_page/rss.xml?edition=uk",
|
|
|
|
},
|
|
|
|
]
|
2016-04-01 16:43:59 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
````
|
|
|
|
|
|
|
|
## Configuration options
|
|
|
|
|
|
|
|
The following properties can be configured:
|
|
|
|
|
|
|
|
|
|
|
|
<table width="100%">
|
|
|
|
<!-- why, markdown... -->
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Option</th>
|
|
|
|
<th width="100%">Description</th>
|
|
|
|
</tr>
|
|
|
|
<thead>
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
<tr>
|
2016-04-20 14:39:38 +02:00
|
|
|
<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>
|
2016-04-01 16:43:59 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
2016-04-03 19:52:13 +02:00
|
|
|
|
2016-04-20 14:39:38 +02:00
|
|
|
<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>
|
2016-04-01 16:43:59 +02:00
|
|
|
<tr>
|
|
|
|
<td><code>showPublishDate</code></td>
|
|
|
|
<td>Display the publish date of an headline.<br>
|
2016-04-12 11:06:59 +02:00
|
|
|
<br><b>Possible values:</b> <code>true</code> or <code>false</code>
|
2016-04-01 16:43:59 +02:00
|
|
|
<br><b>Default value:</b> <code>true</code>
|
2016-04-12 11:06:59 +02:00
|
|
|
</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>
|
2016-04-01 16:43:59 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
2016-04-03 19:52:13 +02:00
|
|
|
|
2016-04-01 16:43:59 +02:00
|
|
|
<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>
|
2016-04-12 11:06:59 +02:00
|
|
|
<br><b>Default value:</b> <code>10000</code> (10 seconds)
|
2016-04-01 16:43:59 +02:00
|
|
|
</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>
|
2016-11-20 20:06:58 -03:00
|
|
|
<br><b>Default value:</b> <code>2500</code> (2.5 seconds)
|
2016-04-01 16:43:59 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
2016-06-06 00:18:01 +02:00
|
|
|
<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>
|
2016-08-27 00:32:47 +02:00
|
|
|
removeStartTags: false,
|
|
|
|
removeEndTags: false,
|
|
|
|
startTags: [],
|
|
|
|
endTags: []
|
|
|
|
|
|
|
|
|
2016-08-26 22:06:03 +02:00
|
|
|
<tr>
|
2016-08-27 00:32:47 +02:00
|
|
|
<td><code>removeStartTags</code></td>
|
2016-08-27 00:37:19 +02:00
|
|
|
<td>Some newsfeeds feature tags at the <B>beginning</B> of their titles or descriptions, such as <em>[VIDEO]</em>.
|
2016-08-27 00:35:27 +02:00
|
|
|
This setting allows for the removal of specified tags from the beginning of an item's description and/or title.<br>
|
2016-08-27 12:59:00 +02:00
|
|
|
<br><b>Possible values:</b><code>'title'</code>, <code>'description'</code>, <code>'both'</code>
|
2016-08-27 00:32:47 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><code>startTags</code></td>
|
|
|
|
<td>List the tags you would like to have removed at the beginning of the feed item<br>
|
2016-08-27 00:37:19 +02:00
|
|
|
<br><b>Possible values:</b> <code>['TAG']</code> or <code>['TAG1','TAG2',...]</code>
|
2016-08-27 00:32:47 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><code>removeEndTags</code></td>
|
2016-08-27 00:35:27 +02:00
|
|
|
<td>Remove specified tags from the <B>end</B> of an item's description and/or title.<br>
|
2016-08-27 13:48:33 +02:00
|
|
|
<br><b>Possible values:</b><code>'title'</code>, <code>'description'</code>, <code>'both'</code>
|
2016-08-26 22:06:03 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2016-08-27 00:32:47 +02:00
|
|
|
<td><code>endTags</code></td>
|
|
|
|
<td>List the tags you would like to have removed at the end of the feed item<br>
|
2016-08-27 00:37:19 +02:00
|
|
|
<br><b>Possible values:</b> <code>['TAG']</code> or <code>['TAG1','TAG2',...]</code>
|
2016-08-26 22:06:03 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
2016-04-20 14:39:38 +02:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
The `feeds` property contains an array with multiple objects. These objects have the following properties:
|
|
|
|
|
|
|
|
<table width="100%">
|
|
|
|
<!-- why, markdown... -->
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Option</th>
|
|
|
|
<th width="100%">Description</th>
|
|
|
|
</tr>
|
|
|
|
<thead>
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
<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>
|
2016-04-05 13:16:23 +02:00
|
|
|
<tr>
|
|
|
|
<td><code>encoding</code></td>
|
|
|
|
<td>The encoding of the news feed.<br>
|
2016-04-20 14:39:38 +02:00
|
|
|
<br>This property is optional.
|
2016-04-05 13:16:23 +02:00
|
|
|
<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>
|
2016-04-03 19:52:13 +02:00
|
|
|
|
2016-04-01 16:43:59 +02:00
|
|
|
</tbody>
|
|
|
|
</table>
|