0

RSS/XML as Live text Advance

I am trying to get an old hd 1022 unit to parse an RSS feed.

I can get the desired data parsed based down to item numbers with a script on the feed into the live text control panel.

But it stays on the first item, is there a way to advance the item numbers based on a time limit in the scirpt?

or do I have to make as many slides as there are channel items (not the sub item numbers I am parsing to).

Or is there a way to expand the actual RSS option to parse more than description and title so I can use the time advance option under the text parameters?

Also there is another item I am currently not looking at (guid) that I would like to use to trigger the background to change to an image on the BrightSign unit. I was thinking the MRSS may work but again the data parsing options seem limited.

 

I was thinking I may be able to use the user variables for an action triggered from the guid number to change the background or am i off base with how that concept works?

 

I am a content producer not a coder so it's a steep learning curve.

 

I will provide an example of the XML and the current script I am using in a follow up post.

 

thanks,

9 comments

  • 0
    Avatar
    Hunts

    Here is what I was parsing the live text with:

    Sub hcrss4(xmlFileName$ as String, itemsByIndex as object, itemsByTitle as Object, userVariables As Object)

    xml = CreateObject("roXMLElement")
    if not xml.Parse(ReadAsciiFile(xmlFileName$)) then
    print "xml read failed"
    else
    if type(xml.channel.item) = "roXMLList" then
    index% = 0
    for each itemXML in xml.channel.item
    itemsByIndex.push(itemXML.title.GetText())
    itemsByIndex.push(itemXML.pubdate.GetText())
    itemsByIndex.push(itemXML.description.GetText())
    itemsByIndex.push(itemXML.location.GetText())
    index% = index%+1
    next
    endif
    endif

    DeleteFile(xmlfilename$)
    end Sub

     

    and Here is the RSS:

     

    https://www.hillsboroughcounty.org/apis/v1/rss/calendar
  • 0
    Avatar
    Brandon

    I'm not clear on what's not working how you want.  Defining your URL as a Text Data Feed and displaying that as an RSS feed in the Live Text state works for me - it automatically advances every 5 seconds (the default time to display each line).

    Can you describe more about how you want the background to change?
    The simple method would be to use an MRSS feed with the background image as the image for each story, then display that in the Live Text state as the Media item for the MRSS feed, positioned behind the text items.

    Since your parser is pushing the elements in-order into the indexed array (the index% = 0 and index% = index% + 1 lines are unnecessary since the index% variable isn't being used for anything), you could use a user variable as the Item index for a Live Text Data item.  Then you could use an Event Handler or other state in a different zone to change the variable which would change what's displayed.


    Assuming the ItemNumber variable starts at 3 and increments by 4 (because you have 4 items being pushed for each story in your parser, and the description is the third item, so it's index 3, 7, 11, etc) every 5 seconds, this would show the same Description text in the top RSS : Description section as in the selected item.

    Note that if you use a standard RSS feed, the Description elements are arranged in order at the beginning of the feed, at least in my tests.

     

    BrightAuthor parsers are a bit more than just BrightScript, it's really BrightScript with objects the BrightAuthor autorun has defined.

    It's a bit more like working with JavaScript and jQuery.

    Even if you know JavaScript, if you open a page that's using jQuery, the jQuery library items would look foreign if you're not aware of their functions.

    In addition to the itemsByIndex structure, which is just an array, there is also an itemsByTitle structure which is an associative array consisting of key and value pairs.  The key is the title, the value is the description.

    Since it's an associative array, you cannot have more than once instance of the same key, so you should check for that situation and decide.

    That'll let you display Live Text data items by name rather than just index, though that may arguably be more difficult to deal with.

    If you need more guidance, our Training group may be able to assist you, or point you to a partner who can help.

  • 0
    Avatar
    Hunts

    The feed does work as an RSS and does advance, I want to display the other info I am parsing from the feed as well (the pubdate and the location) I want them to advance as well.

     

    I can only get the other (date and location) data to display if I use live text data (not RSS mode). Then I don't have the advance option. I want to show this:

     

    and have it all update.

     

    There is another Item in the channel item I was not parsing in that script that is <calendar> I was hoping to use that as a trigger for the background change.

    I figured an MRSS feed mode would work for the background, but again I cannot put the other data up with that either.

    Is a way to create two new text cells, (in addition to the standard MRSS) to pull the other parsed data based (location and pubdate) on the title pulled into the MRSS mode feed? SO they would parse the same feed and run the script on it to pull the location and pubdate based on the title populated in the rss feed? or is that only based on specific text. Basically can you put a wild card in the live text data feed as the title, to pull and update the other data i want to pull. 

    Like I said I am not really a javascript or coder person of any type. So I apprecitae you bearing with me.

    I wasn't clear on how the variables options really worked and what I could pull out of the feed to benefit me.

    Also, is there an emulator you can run, so you don't have to be on the system with the brightsign unit to build and test?

  • 0
    Avatar
    Hunts

    Basically what I thought I may be able to do was build 50 slides (as that is the limit of my XML list) and set them for a 10 sec play back and then parse using the script I had (with he addition of calendar to trigger it to pull the background from the card). 

     

    Then I would just build live text based on the index numbers to pull my other data. 1 would be title, 2 would be date, 3 description, and 4 location. Then I was going to just change the index numbers on all fifty slides. After i built fist as template, I could copy, paste and just update numbers.

     

    I know there is an easier way, just hard for me to wrap my head around.

  • 0
    Avatar
    Brandon

    With your parser applied, the indexed elements of the feed would look like

    1. First Feed Item Title
    2. First Feed Item PubDate
    3. First Feed Item Description
    4. First Feed Item Location
    5. Second Feed Item Title
    6. Second Feed Item PubDate
    7. Second Feed Item Description
    8. Second Feed Item Location
    9. Third Feed Item Title
    10. Third Feed Item PubDate
    11. Third Feed Item Description
    12. Third Feed Item Location

    and so forth.

    ItemNumber is a user variable (File>Presentation Properties, User Variables) and in most places you can substitute a user variable by referencing it as $$name$$
    In this case the first Description is the third element, so the default value of ItemNumber is set to 3.

    It's not connected to the feed in any way.  It's strictly being used as a counter for the index.  In the Live Text Item index, $$ItemNumber$$ will be replaced with the value of the variable ItemNumber.

    In a different Image zone I have an Event Handler with a Timeout event that transitions back to itself (Timeout events only fire once, and Time/Clock events cannot be set to less than 1 minute interval) every 5 seconds.  It also has Other>Increment Variable [ItemNumber] commands on it to increment the ItemNumber variable four times because there are four indexed items per story.  So ItemNumber goes 3, 7, 11, 15, etc.

    There's one key difference between Live Text data and RSS display - RSS display will strip out escaped symbols (&amp; etc), HTML tags and linebreaks.  Live Text data, on the other hand, is "raw" - so you would need to filter those things out in your parser.

    For example, there's a description in your feed that is
    The purpose of the DM/DWBE &amp; SBE (Disadvantaged Minority/Disadvantaged Women Business Enterprise and Small Business Enterprise) Advisory Committee is to provide the feedback of Minority..."

    In the RSS Description section, it appears as
    The purpose of the DM/DWBE  SBE (Disadvantaged Minority/Disadvantaged Women Business Enterprise and Small Business Enterprise) Advisory Committee is to provide the feedback of Minority...

    But in the Live Text data (indexed items) it appears as
    The purpose of the DM/DWBE &amp; SBE (Disadvantaged Minority/Disadvantaged Women Business Enterprise and Small Business Enterprise) Advisory Committee is to provide the feedback of Minority...

    Because Live Text data doesn't do additional parsing/filtering on the element.

     

    Another description contains linebreaks:
    The details
    This 2 hour training session aims to give both seasoned vendors and new suppliers a better understanding of how to navigate and submit bids via the iSupplier Portal.

    This informative...

    In the RSS Description section it shows as much text as will appear on the single line
    The details  This 2 hour training session aims to give both seasoned vendors and new suppliers a better understanding of how to navigate and submit bids via the iSupplier Portal.  This informative...

    Whereas in the Live Text data section it appears only as
    The details
    as the rest of the text is after the linebreak.

     

    All the above said, if you don't have a bunch of time or ambition to play around with things until it works, it would be best to work with our Training group to get comfortable with BrightScript and parsers, or engage with a partner that can implement either a suitable parser or something in HTML/Javascript to show the information you want.

    Using parsers can be quite tricky and frustrating since a syntax error in the parser can put the player into a reboot loop, which can result in hours of frustration, especially since you have to test live on a player - there is no simulation environment.

    One safety net when working with presentations that may cause crashes is to use a "stub" presentation that runs Switch Presentations to the actual presentation you're testing after few seconds (or on-demand via UDP, etc).  When you publish, publish the "stub" presentation, not the actual presentation.  If the presentation you're working on crashes, the player will reboot and run the stub presentation again instead of going straight to the crashing presentation, giving you the opportunity to publish an updated version without having to try to "catch" the player pre-crash (which is nearly impossible for feeds or parsers that crash) or reapply setup files to clear the schedule.

  • 0
    Avatar
    Brandon

    You could build slides for each story/item as you propose, the trick there is knowing how many stories/items there are, so you don't go running through 5 stories, then 25 blank slides.

    You could put an additional item at the end of the feed to populate a Networked Variable with the number of stories in the feed (not counting itself), then use that along with an index variable and Conditional Targets to go through the Live Text states and loop back to the beginning when appropriate.  I know a few customers have done this.
    For example, the last item in the feed could be
    <item>
     <title>StoryCount</title>
     <description>10</description>
    </item>

    In Presentation Properties, User Variables you'd have a Networked variable named StoryCount (it must match the title) set to the RSS feed.  It's value will be set to whatever the corresponding item's description in the feed is, in this case 10.

    Then your Live Text elements would proceed forward, incrementing an index variable and checking whether to move to the next Live Text state or reset the index variable and return back to the beginning.

    Again, if you want to go this route, this is something our Training group or a partner could assist with.

    Alternatively there are probably third-party CMS systems that do what you want better/easier than doing it in BrightAuthor.
    They're also found on our Partner Page.

    _________________________________________________________________________

    Friendly reminder, the community forum is intended for user-to-user discussion.  It is not regularly monitored. For troubleshooting problems and to ensure a timely answer from a BrightSign representative, please submit a support ticket.

  • 0
    Avatar
    Hunts

    OK, Thanks Brandon, I was just reading about the event handler in an audio only zone to handle triggers in another thread.

    I don't have to worry about slides running out; there are like 400 items. I just want to get a live self updating feed of the info that will switch calendar background based on parks & Rec, Public Meeetings, Commission meetings etc. They all have the same layout, so I just need to get the rss feed to trigger the background change. The program will loop anyway, and I only need the RSS to update daily.

    Speaking of looping, yes I think I got the boot loop action on the device. Quite frustrating - since there is no real feedback from the unit - especially since i have to physically go to another room to look at any lights on the device.

    As far as the text stuff, I can play with that if I get to see my data, lol. The current system I am using for our stuff in broadcast is using excel to parse the feed and the that provides a database for a character generator I that I can advance. So I have most of the stuff I need to figure out the text corrections I think; I have time to mess with that. To be honest I think the ones I would have to worry about that with is the title and description anyway, so I should be able to run them as a straight RSS, and run a feed with the parser as live text to push the date and location. Then use another event handler to advance those updates the advance on those based on index count from first.

    But that may be what I move forward with on based on your links

    I did see the webinar training, and think that may be a really good option for me, that way I can get my head around everything. BUT thanks to you I think I can get it functional even if it's not the most efficient way. Then maybe update with improvements and training after I know what I want to cover, and what questions to ask. But I will say the 2 day deal with the unit included seemed like a bargain. Is there a schedule of the training events posted anywhere? and who do I contact about setting either of those up? Do you know if they do Orlando or Tampa?

    Also do any of your devices publish a feed to the web that I could push into another signage system through URL? We have a system already in place for our building, but I work for communications, and would like to be able to provide a feed to facilities for the other system. Or would I need an encoding unit at that point?

    I realize it has to be hosted somewhere.

    Thanks you again,

    Scott

  • 0
    Avatar
    Brandon

    Hi Scott,

    Where something tells you to put an Event Handler in a spare Audio zone, unless you're using an HDx10 unit (where there may be good reason), I highly recommend putting it in an Image zone instead.  The player only has 3 audio decoders, so using an Audio zone will consume one of the decoders unnecessarily.
    VideoOrImages, Video and Audio zones consume one audio decoder.
    Enhanced Audio zones consume two audio decoders.

    For your Excel stuff, once you have a search-and-replace "map" in place you can use a Macro to automate that process.

    There's also this Excel add-in which will give you a "plain" XML output from a spreadsheet that doesn't include all the extra workbook/sheet stuff that Excel's normal XML output includes.
    https://www.codeproject.com/articles/296288/excel-add-in-for-exporting-excel-data-to-xml

    Though you already seem to have a process that gives you RSS-friendly output, so it may be moot.

     

    The best way to handle routing the player's output to another system would be to split the video output if the other system has a video input, or to encode the video output to a stream.

    If you have an XD-level or higher (XD, 4K, XT) level player you can use the Media Server plug-in to encode the player's display output
    But there are limitations - there's no audio, and on Series 4 players, only one video player will be included - so if two videos are playing simultaneously, you'll only see one in the encoded stream, so for the least headache it would be best to use an external encoder (which could be an XT1144 running the Streaming Server module.

  • 0
    Avatar
    Katherine Price

    Brandon – you mentioned a training group in several of your responses. What is this? Is there an actual resource for getting help on BrightScript?

Please sign in to leave a comment.