Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
blocks:app-note:rss-feed [2024-03-14 13:06] mattias [Installation] |
blocks:app-note:rss-feed [2024-03-14 13:10] mattias |
||
---|---|---|---|
Line 2: | Line 2: | ||
This application note assumes previous experience with blocks, it exemplifies how to use a feed script to parse an RSS feed and use child replication in blocks to publish the content on a spot. | This application note assumes previous experience with blocks, it exemplifies how to use a feed script to parse an RSS feed and use child replication in blocks to publish the content on a spot. | ||
- | [[https:// | + | [[https:// |
====Installation==== | ====Installation==== | ||
Line 10: | Line 10: | ||
* Restart blocks. This will enable the script and the script will write an example configuration file in scripts/ | * Restart blocks. This will enable the script and the script will write an example configuration file in scripts/ | ||
* Rename the example file Rss.config.example.json to Rss.config.json (this file it written when the script is used) | * Rename the example file Rss.config.example.json to Rss.config.json (this file it written when the script is used) | ||
- | * Create a task with a do statement bound the scripts | + | * Create a task with a do statement bound the scripts Script.feed.RSS.reInitialize |
* Run the task to restart the script and use the sample settings. | * Run the task to restart the script and use the sample settings. | ||
* Download the example block from here: {{ : | * Download the example block from here: {{ : | ||
Line 43: | Line 43: | ||
====Configure the script==== | ====Configure the script==== | ||
===Configuration file=== | ===Configuration file=== | ||
- | This feedscript can use an optional configuration file // | + | This feedscript can use an optional configuration file // |
In the example configuration we can see an entry where a preferred image size has been indicated. This setting only works for feeds that contain what's in RSS called a < | In the example configuration we can see an entry where a preferred image size has been indicated. This setting only works for feeds that contain what's in RSS called a < | ||
- | Use the //maxAge// to control for how long we want to show the article in the feed, and use the maxLength | + | Use the //maxAge// to control for how long we want to show the article in the feed, and use the maxLength |
Exampel configuration: | Exampel configuration: | ||
Line 81: | Line 81: | ||
{{: | {{: | ||
- | The options are basically the same as with the config file method but feeds will only be added if a config task has been setup to be triggered at startup. | + | The options are basically the same as with the config file method, but feeds will only be added if a config task has been setup to be triggered at startup. |
- | If using task to configure feeds one may want to remove the config file if present. | + | If using the task to configure feeds one may want to remove the config file if present. |
===Reinitialize the script=== | ===Reinitialize the script=== | ||
Line 89: | Line 89: | ||
====Styling==== | ====Styling==== | ||
- | In the example block we use a CSS trick to be able to add ellipsis | + | In the example block we use a CSS trick to be able to add ellipses |
The ellipsis css rule used here: | The ellipsis css rule used here: | ||
< | < |