Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
blocks:app-note:rss-feed [2024-03-14 09:52] mattias [Installation] |
blocks:app-note:rss-feed [2024-03-14 13:07] mattias [Installation] |
||
---|---|---|---|
Line 6: | Line 6: | ||
====Installation==== | ====Installation==== | ||
- | * Make sure you have the latest script dependencies from https:// | + | * Make sure you have the latest script dependencies from https:// |
- | * Enable the script by copy the RSS.ts and RSS.js from the script/ | + | * Enable the script by copying |
* 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 16: | Line 16: | ||
* Test by open the block in for editing and use the Edit/Show editor preview feature. | * Test by open the block in for editing and use the Edit/Show editor preview feature. | ||
- | You should expect something like this: | + | You should expect something like this in the preview: |
{{: | {{: | ||
+ | :!: Please note, if working with feeds on spots, it is the spot that downloads any images, not the server, hence the spot must be able to access any images. | ||
Line 42: | Line 43: | ||
====Configure the script==== | ====Configure the script==== | ||
===Configuration file=== | ===Configuration file=== | ||
- | This feedscript can use a configuration file // | + | This feedscript can use an optional |
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 < | ||
Line 74: | Line 75: | ||
- | ===Configure with task=== | + | ===Configure |
- | As an option we can configure feeds in runtime using a callable on the script as in this example: | + | Feeds can be configured |
{{: | {{: | ||
- | The options are basically the same but will only be added if a task has been setup to be triggered at startup | + | The options are basically the same as with the config file method |
- | If using task to configure feeds one may want to remove the config file. | + | If using task to configure feeds one may want to remove the config file if present. |
===Reinitialize the script=== | ===Reinitialize the script=== | ||
- | The feed script exposes a second callable that merely | + | The feed script exposes a second callable that merely |
====Styling==== | ====Styling==== | ||
- | In the example block we use a CSS trick to be able to add ellipsis [...] to indicate that we cannot show all text available from the feed. It is a bit tricky to use because one must also limit the text-block manually in the way that it is just capable to show as many lines as specified in the css, else the line with the ellipsis will appear on the correct line but lines can still appear after the ellipsis. | + | In the example block we use a CSS trick to be able to add ellipsis [...] to indicate that we cannot show the full text available from the feed items description. It is a bit tricky to use because one must also limit the text-block manually in the way that it is just capable to show as many lines as specified in the css rule , else the line with the ellipsis will appear on the correct line but lines can still appear after the ellipsis. |
- | The ellipsis css rule: | + | The ellipsis css rule used here: |
< | < | ||
.rss .multi-line-ellipsis { | .rss .multi-line-ellipsis { | ||
Line 97: | Line 98: | ||
} | } | ||
</ | </ | ||
+ |