Adapter to request and show RSS Feeds of different standards (Atom, RSS, RDF). You can customize the output of the feed with a template system. In the templates you can include HTML, CSS and Javascript.
Important: Only the english translation is valid due to bugs in automatic translations into other languages made by iobroker
After Installation the adapter should then be displayed in the adapter section in the iobroker. Sometimes it happens that the changes are not visible, especially with web changes (widgets / configuration dialog), the following command may have to be executed on the command line:
iobroker upload rssfeed
In the right area in the line of the adapter, an instance can be added using the plus button
The configuration is easy. There are only a few fields
Setting | description |
---|---|
Default Refresh (min) | is the general specification of how often the feed should be called up again in minutes. The default is 60 minutes |
Max Artikel (Standard) | The total amount of data to be processed can be limited here. |
Then for each new feed:
Setting | description |
---|---|
Name | A name for the datapoint. Inside a folder a name must not appear twice. |
Category | Name for a subfolder there the datapoint should appear. The category must be unique |
Url | The full address of the feed (with http: // or https: //, see examples below) |
Refresh (min) | A different value can be specified for this feed. Otherwise the general specification is taken |
Max Articles | A different value can be specified for this feed. Otherwise the general specification is taken |
If you saved and closed the configuration, the feed-data can be found as a JSON data point in the object tree. If you delete an entry, the datapoints aren't deleted.
The following widgets actually exists
RSS Feed widget 2
- to show a single feedRSS Feed Multi widget
- to show several aggregated feeds in one widget.RSS Feed Meta Helper
- a helper widget to inspect the metadata of a feedRSS Feed Article Helper 2
- a helper widget to inspect the article data of a feedRSS Feed Title marquee 3
- a widget to show the Headlines of a feed as a marqueeJSON Template
- a widget that have nothing todo with RSS Feeds, but uses the same technology, and you can define a custom template to show any JSON-Data in vis.
Documentation for the vis-widgets are available inside vis or Widget-Documentation/german
An example that I have tested with the following RSS feeds:
<%= meta.title %>
<% articles.forEach(function(item){ %>
<p><small><%- vis.formatDate(item.pubdate, "TT.MM.JJJJ SS:mm") %></small></p>
<h3><%- item.title %></h3>
<p><%- item.description %></p>
<div style="clear:both;" />
<% }); %>
The template system works with certain tags. The tags used mean the following
tag | description |
---|---|
<%= | The content of the contained expression / variable will be escaped. |
<%- | The content of the contained expression / variable is unescaped. |
<% | No output, is used for enclosed javascript instructions |
%> | is generally a closing tag to complete one of the previous ones |
Everything that is outside of these tags is displayed exactly as it is or if it is HTML interpreted as HTML. (see e.g. the p-tag, div-tag, small-tag Within the template you have 2 predefined variables available
This contains all meta information about the feed. The following content is available. I think the identifiers are self-explanatory. In the help I will describe them in more detail. or specify the content (some are arrays)
meta.title
meta.description
meta.link
meta.xmlurl
meta.date
meta.pubdate
meta.author
meta.language
meta.image
meta.favicon
meta.copyright
meta.generator
meta.categories
Is an array with individual elements (javascript array). Each element has the following properties. So that it fits, for example, I will do the prefix item in front of it. But if you want you can choose that yourself. It only has to be named accordingly in the loop (forEach). Here, too, the identifiers are self-explanatory. Not all attributes are filled in every feed. The most important ones are already included in the template above.
item.title
item.description
item.summary
item.link
item.origlink
item.permalink
item.date
item.pubdate
item.author
item.guid
item.comments
item.image
item.categories
item.source
item.enclosures
<%= meta.title %>
<% articles.forEach(function(item){ %>
<p><small><%- vis.formatDate(item.pubdate, "TT.MM.JJJJ SS:mm") %></small></p>
<h3><%- item.title %></h3>
<p><%- item.description %></p>
<div style="clear:both;" />
<% }); %>
Brief description of what happens in the individual lines
Z1: The output of the feed title
Z2: Without output. Javascript command to loop over all articles, with each turn the current element is assigned to the variable item.
Z3: Output of date and time is. It is enclosed with a p / small tag for formatting. The vis-own date format function is used for formatting. Description can be found in the adapter vis.
Z4: The output of the article title. A Header 3 - tag is used for formatting.
Z5: Output of the content of the article. It is enclosed with a p-tag. Here, at least in the two examples, HTML code is included, which usually comes with an image and descriptive text
Z6: Output a div tag that clears special formatting in the feed-html (in both examples for tagesschau and bild it is needed. Other feed maybe didn't need it.
Z7: Without output. This line closed the javascript loop . Everything that was defined between Z2 and Z7 is repeated for every single article.
- cleanup unused entries in datapoint info.lastRequest by saving in admin dialog.
- button for cleanup not used datapoints in admin dialog
Multi widget RSS FeedsMulti widget marqueeWeitere Datenpunkte im Template verfügbar machen.Widget für Laufschrift mit den Titeln https://forum.iobroker.net/topic/31242/nachrichten-ticker-newsticker-via-php-in-vis-einbinden/2
- (bluefox) Fixed loading of words.js in vis
- (bluefox) Corrected vis widget
- admin changed to jsonConfig, dev-environment now devcontainer
- added more information to sentry
- added sentry
- added name option to marquee widget
- Rework of the admin dialog
- Fix some errors and glitches
- Released in stable
- fixed/extended json template
- adapted configuration pages to react.
- Prepared for stable release
- added some template examples to the widget documentation
- improved error messages
- removed deprecated widget / change widget beta flag
- changed createObject/setState logic due iobroker-controller >3.0
- removed customtab
- adapter configuration is now editable
- corrected changelog size
- the error messages for the template are improved
- errors in the request of feeds are now real errors in the iobroker log
- loading of rules for ejs in the editor is improved
- marquee3 widget: options to show time and date
- republish to npm
- improvements in the configuration dialog
- remove unused admintab
- new RSS Feed multi widget. in this widget you can add your one or more datapoints, that are available in the template.
- New marquee widget 3 replaces the existing marquee widget 2.The marquee widget 3 is now a multi widget and can handle more than one feed. The Headlines are now aggregated.
- the existing widget JSON template is improved. in this widget you can add your one or more datapoints, that are available in the template.
- Remove several deprecated widgets (RSS Feed widget 1, Article Helper 1, Marquee 1, JSON template 1)
- add link option to marquee widget
- widget help added
- marquee widget: the divider characters (default: +++) are configurable
- add ejs syntax to template editor
- try to fix marquee widget.
- try to fix the wrong NoSave dialog
- rework setting objects and states
- improve logic adding rssfeed in configuration dialog
- fix wrong icon for marquee widget
- define default template for rssfeed widget
- deprecate existing and replace with new version of widgets to improve naming of the attributes in case of translation
- widget rss marquee: replace duration attribute with speed attribute and improved the calculation algorithm. now same number is same speed regardless of the length of the titles
- fix bug saving last request in adapter configuration / improve debug messages
- update package.json and install new tools for stream encoding/decoding detection
- implement encoding detection and stream encoding
- change the ejs lib with a real browserified lib
- new widget as a guest, because it is not directly related to the rssfeed functionality, but reuse the same code base. maybe later i transfer it to an own adapter. the new widget can take a json datapoint and you can visualize the data with the ejs template system.
- now you can download the adapter configuration in the admin dialog. upload is not possible due to security restrictions in modern browsers.
- improve admin layout
- implement a forceRefresh button
- fix bug a bug in marquee widget. not all styles should applied to the span tag.
- apply widget styles also to the inner span element, because they had not any effect on the marquee.
- renew the package-lock.json
- add categories to save feeds in subfolders
- improve mechanism to write only updated feeds to datapoint. the feed has new data if comparision of articles in title and description is different.
- improve lasrequest logic of the adapter
- fix problem with datapoint naming
- test with encapsulation of ejs.js, because of error in some browsers
- add attribute duration for widget marquee to control animation duration
- new widget marquee for article titles
- add filter function for articles. the filter searches in title,description and categories, several filter criteria can be seperated by semicolon
- some adjustments in readme, io-package
- add addveyor build
- added widgets meta helper and article helper
- initial release
MIT License
Copyright (c) 2021-2024 oweitman oweitman@gmx.de
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.