The other day Jay was looking for something to do with his spare moments in between finalising Kudos Analytics Cloud and Kudos Boards Mobile (come on Jay you don't really have spare time;) and he made an awesome tweak to our internal deployment of IBM Connections. I thought it was worth sharing so here it is:
There's no mechanism in Connections by default to notify people of new posts in the News Feed. Forcing users to refresh the page, or click on 'Discover' / 'I'm Following' to find out if something new has happened.
A couple of hours of coding and testing later, it actually worked as planned and is now implemented in our production environment (feedback welcome).
What does it do?
A - Shows a button with 'X New Posts' at the top of the news feed (screenshot below)
B- Updates the page title, which lets you see if there are any updates without switching to the tab. (Also makes the tab glow if it is pinned - as seen on Facebook, Instagram, etc.)
The script first checks to see if it's in Homepage on load. You don't want to make a request every X seconds from every page in connections.
It then periodically polls the RSS feed for the current stream to retrieve any entries since the time the page was loaded. (Thanks to Mr. Andrew "API" Welch for his input here)
If it finds any new entries, it shows a bar at the top indicating the number of new updates and, my favourite part, updates the document.title allowing you to see if there are any updates without the need to actually switch to the tab.
You might need to refresh your homepage for it to take effect. And you might have to wait till there are some new posts as well :)
Code to implement this:
- Put the activity-stream-notifier.jsp file in the same folder as the customised header.jsp.
- Add the following line at the end of your header.jsp: --%><%@ include file="./activity-stream-notifier.jsp" %><%--
The results are as per the below screenshot:
Well I think that is pretty neat. Hope you can make use of it!