Display an RSS text ticker
From SpinetiX Support Wiki
Contents
Introduction
This tutorial explains how to add a text ticker displaying news from the Internet, syndicated via RSS, to an existing project (in this case, the one obtained after following "My first Elementi project" tutorial).
For this, we are going to use the "RSS Text Ticker" widget from the Elementi Library and change its data source from the default one pointing to the SpinetiX server (i.e. displaying the "Lorem ipsum ..." text) to a real RSS feed source from a news provider. In this case, the Science section of Google News.
You can download the project resulted after following this tutorial from the link below, but note that the video file was not included in the 7z archive available for download.
Video
For full screen, see this video on Vimeo.Tutorial
- Difficulty: Easy.
- Total duration: 5-10 minutes.
- Requirements:
Getting started
To get started, follow "My first Elementi project" tutorial. Once done, make a copy of that project, rename the copy to "RSS ticker" and then open it.
- Open the layout "First Layout" in the Browse panel (double click on the "First Layout" folder)
- Open the layout master file "index.svg" in the Preview panel (Double-click on the "index.svg" file).
Next, let's import the RSS Text Ticker widget into the current project. For that, follow these steps:
- Click on the "Library" tab within the browse panel. This opens the Elementi Library.
- Open the "RSS" folder and find the "Text Ticker.svg" widget.
- For Elementi 3.X, open the "Feeds" folder and find the "RSS Text Ticker.svg" widget (it should be the last one).
- Drag & drop the widget from the browse panel onto the Preview panel or Edit panel. A new media layer is added on top of the other layers.
- Go back to the project.
Note that the widget file was automatically copied into the current project upon import.
Cosmetic work
Next, let's do a little bit of cosmetic work to arrange things nicely within the layout.
- Position the RSS ticker layer to the bottom of the layout.
- Click on the "Align" button on the toolbar and select "Align Left".
- Click again on the "Align" button on the toolbar and select "Align Bottom".
- Resize the layer into a band on the bottom of the screen (right about the height of the clock).
- Lock the layer by clicking on the "Lock" icon within the edit panel. This ensures that the RSS layer is not modified by mistake afterwards within the preview panel.
- Add a semitransparent background to the layer.
- Click on (the "Layer Properties" button). This opens the Layer Properties dialog.
- Go to the "Box Format" tab.
- Select the Mat option, set its opacity to 0.6 and its color to white.
- Click on the OK button to apply the new properties of the layer.
- Reposition the clock
- Within the edit panel, move the clock layer on top of all the other layers using drag & drop (or the right-click menu).
- Unlock the clock layer.
- Within the preview panel, move the clock a little bit higher so it won't be overlapped by the ticker.
- Lock the clock layer again.
RSS feed source
Next, let's change the RSS data source from the default one pointing to the SpinetiX server (i.e. displaying the "Lorem ipsum ..." text) to a real RSS feed source from a news provider. In this case, the Science section of Google News. For that, follow these steps:
- Double-click on the "RSS Text Ticker.svg" layer within the edit panel. This opens the widget within the main layout context (i.e. without closing index.svg document).
- Click twice on the "Data source" property. This opens the "Data Feed Properties" dialog.
- Enter the address of the news data - for instance https://news.google.com/news?topic=snc&output=rss
- Change the refresh period to one hour (1h). This ensures that the RSS data feed is updated from the Google server every hour.
- Optionally, limit the number of items to display to the first 10 entries.
- Click on the "Test..." button to verify the results.
- Click on the "OK" button to save the changes to the data source.
RSS feed layout
Optionally, we could modify the data layout to include some text between each news item to separate them visually.
For that, follow these steps:
- Click twice on the "Text template" property. This opens the "Edit Text" dialog.
- After the default "[[title]]" (which is a placeholder for the title of the news), add a separator, something like " ------ provided by Google News ------".
- Select the separator text and make it italic.
- Click on the "OK" button to save the changes to the text template.
Final steps
- Click on the "Leave" button from the toolbar to go back to the layout master file (index.svg).
- Click on the "Save" button to save the changes.
- Optionally, publish the project to one or more HMP devices as described on "Publishing from Elementi" tutorial.
See also
The next tutorials to study after the one presented on this page are: