Monday, May 11, 2015

Displaying Sharepoint (or other authenticated) RSS feeds in Xibo

I'm a big fan of Xibo, the Open Source Digital Signage platform.  We've been able to achieve with this what could've cost tens of thousands of dollars to achieve with a commercial system.

Xibo is a client-server based system for running "Digital Signage" (big LCD screens displaying information) in an organisation.  It's centralised and flexible enough to allow multiple screens with the same or different layouts, and it supports a variety of content types.

One type of content supported in Xibo is RSS tickers.  Information from an internal or external RSS feed can be scrolled vertically or horizontally across a display layout.  This was a particularly interesting feature for us, as we have a lot of information stored in Microsoft Sharepoint, much of which is available as an RSS feed.  The problem was that Sharepoint isn't usually a public website and requires authentication to access it and the RSS feeds.  Xibo doesn't support authenticating to a website for RSS content, so we've come up with a simple workaround.

NOTE - This works with sites that use authentication methods like basic auth and NTLM auth.  Any site that requires a forms-based login (where the login box is part of the webpage itself), won't work.  Also, I believe curl can be made to work with Kerberos authentication but have no experience with it.

The easy solution is to have the Xibo server run a cron job that pulls down the RSS feed to it's own webserver directory, effectively republishing the RSS in a location that doesn't require authentication.  We did this using wget, and then later using curl, we run either of these commands as a cron job every 5 minutes:

wget --http-user=user --http-password=password -O /srv/www/htdocs/rssfeed.xml http://sharepoint.domain.com/_layouts/listfeed.aspx?List={0C3893F7-DA14-4755-9FCC-5522532C9DBC}

OR

curl --anyauth --user user:password http://sharepoint.domain.com/_layouts/15/listfeed.aspx?List=%7BEF86A7FD-BED2-481A-8EE8-5F7D298AD644%7D >/srv/www/htdocs/rssfeed.xml

In this example, either wget or curl login to Sharepoint and grab the RSS xml file and dump it in the root of the webserver directory.  In our case this happens on the Xibo server, but any webserver is good.  We then point the Xibo layout at the RSS URL on the Xibo server.

The reason we've used curl and wget at one time or another is about compatibility.  Some versions of wget have limited support for authentication schemes like NTLM, if that causes a problem for you, try curl.



18 comments:

dean said...

i cant seam to get this to work, it creates the xml file but its blank, any ideas?

System Administrivia said...

I my experience this usually that indicates a failure to access the feed, is there any error output from wget or curl?

Have you tried both wget and curl? Also are you able to access the feed in a browser on your Xibo box (lynx for example if it's command line only)?

dean said...
This comment has been removed by the author.
dean said...
This comment has been removed by the author.
dean said...

ok so i got that part to run and the program runs but it doesnt export anything i think its down to http being used where as the site uses https any ideas

System Administrivia said...

Hi Dean,

You don't really say whether you're having this problem with wget or curl, so it's hard to know what might be going on. I've certainly had a similar problem using wget because it didn't support the authentication method, so I had to switch to curl.
I'd be interested to hear which you're using and if there's any error output, either on the console or in any logs.

Thanks.

dean said...

its through curl. can i email you direct?

System Administrivia said...

Hi Dean,

Do you know what sort of authentication method the site you're accessing is using? At least, do you logon through the webpage itself or is it a standard browser authentication window?
Also, what version of Sharepoint?

Thanks.

dean said...

https we login through via mail.office365.com then sites > team site.

System Administrivia said...

Ah, right so that's a forms based login (or claims based maybe), this will only work with http authentication dialogs like you get with basic auth, ntlm auth and so on.
This Xibo hack was primarily designed to work with Sharepoint on-prem, I don't use Sharepoint Online (yet) so I don't have much I can contribute on that, sorry.

dean said...

ah right, i guess thats why its not working then :(

Unknown said...

Great article!
1. Can you share your Cronjob details and where you place the cronjob?

2. And how and which RSS feed link do I use for Xibo layout (media RSS)
I wasn't successful to get this working.
Can you give a step by step instructions? Many thanks

System Administrivia said...

Sure, I'll help where I can.

First thing's first though. What version of Sharepoint (this wont work with Sharepoint Online as far as I know) are you running, and what type of authentication is it using (ie. forms based, basic, integrated windows etc.)?

Thanks.

Euan said...

If acceptable you can turn on anonymous access just for the list you're pulling the feed from. Curl will then work even for a 2013 site with claims based authentication.

https://support.office.com/en-gb/article/Enable-anonymous-access-3647cdd5-1ab8-48cf-b4ee-d1b652bbabdd

System Administrivia said...

Hey, thanks for the tip Euan. If the feed is able to be public, that's great, Xibo should be able to get it directly then.

Euan said...

The feed I get from Sharepoint seems to just dump all my fields into the description element.

For example, I have a field in my library called "Article Headline" and one called "Article Image". Both end up inside the description element.

Has anyone had to deal with this? When using a Xibo Ticker, I end up with the entire contents of the description field. Any way to separate these out into individual fields I can then reference in my ticker?

System Administrivia said...

I've never seen that before.

Is it a particularly customised list, and does it appear like that in the RAW xml? You might want to examine this list compared to another Sharepoint list (maybe one that's more standard). I've used Sharepoint RSS feeds in three different versions of Sharepoint and with several lists, but I've never seen it do that. I usually only use a title and a description, but they do work at least.

L8r.

Euan said...

Yeah it's a custom content type. What I ended up doing was pulling the resultant XML into BeautifulSoup and extracting fields straight into Xibo DB.