JSignage:RSSTutorial1

From SpinetiX Support Wiki

Jump to: navigation, search

Description

Simple text ticker

  • There are three main ways to display information from an RSS feed:
    1. the text ticker
    2. the text bar
    3. the slideshows
  • We will start by building a simple text ticker with the headlines.

Source code

var uri = 'http://download.spinetix.com/content/jSignage/tutorial/media/science.rss';

$.get( uri, function( rssFeed ) {
  // Parse the feed into an array of news items. Each one is an object with a title and a description property.
  // You can supply your own custom parser here if the data source is not RSS formatted.
  var rss = $.parseRSS( rssFeed );

  $.textTicker({
    top: '80%',
    height: '15%',
    frame: { backColor: '#0000FF', backOpacity: 0.5 },
    data: rss,
    spacing: 50,
    fill: 'white',
    renderToText: function() {
      return this.title;
    },
    repeatCount: 'indefinite'
  }).addTo('svg');
}, 'text' );

Preview

This page was last modified on 9 August 2017, at 17:21.