After a long absence I have come back to the Newsfeeds project. I don’t have an excuse, only reasons (I have devoted a lot of effort to other parts of the DNN project). I'm very sorry I can't pick up on the forum posts. I’m not very good at this. I’m still on the lookout for someone to help out with iwonder who has been doing a fantastic job on this until now. I have kept an eye out on those forums though and decided that the module needed 2 important changes:
1. Feed preprocessing
Most error reports in the forums are because the feeds that are drawn in do not conform to strict standards. I've frankly been shocked at how some major news organizations can syndicate their site's content in non compliant feeds. Unfortunately v 4.x of the Newsfeeds module is very sensitive to this. The reason is that the RssToolkit code we're using to merge (aggregate) feeds is very sensitive to this. I believe that in the long run we're probably going to get rid of this code again as it brought us as much pain as joy. But for now I’m sticking with it.
The fix for the immediate issue (the sensitivity to feed standard compliance) was to allow the user to preprocess the incoming feed before it is being fed to the aggregator. So you can throw an xsl file at the incoming xml to make it exactly RSS 2 compliant. Below is the full edit screen for a feed now.
You’ll see the feed and cache time (individual feeds can be cached differently from the aggregate). Then you’re offered a choice of transformations. The default means the module works as before. Selecting one of the others forces the incoming XML to go through that XSL. Note that the current cache is shown in case you are wondering what is coming in.
But it doesn’t stop there. In fact I've taken it even a step further. You can also specify a type for the preprocessor which, when implementing the internal IPreProcessor interface, can work through the incoming XML as well to rework it. The Interface is trivial:
Public Interface IPreProcessor
Function Process(ByVal xml As String) As String
The module will feed it raw XML and expects raw XML in return. What you do in between is up to you. You specify the transformation as an “Other transformation” and entering the type reference in the text box:
Included is a Twitter preprocessor (DotNetNuke.Modules.News.PreProcessing.TwitterPreProcessor, DotNetNuke.Modules.News) which will turn all urls into proper urls and create urls for people and hash tags. The resulting feed would look like this:
Note that this is aggregated! So bringing multiple Twitter feeds together is now a singe.
This solution should make it very flexible to handle incoming data. There is one snag: if you have a non-conformant feed, you'll need to determine the cause and write the XSL yourself. So if you have no clue about XML/XSL and the feed doesn't work, there's not much you can do. But actually, that used to be the case in previous versions of the module as well.
2. Background loading
In v 4.0 I introduced the Ajax post loading. The reasoning was that if the module would have to wait for a feed to be retrieved then the complete page load would stall until the feed was in. This was the case in previous versions and it could be very irritating to have to wait to see your web page if you had a couple of Newsfeeds modules on there. The Ajax solution was to let the page load and then call back to get the content after the page had already rendered. But not everyone is very happy with this. It can cause some adjustments of the page as the feeds come in. So the first step was to add a setting to switch this off again. The Module Settings now look like this:
So you can switch off the Ajax post load. As you can see you can now also select “background download”. The new version installs a scheduled task in DNN. What the switch does is to add this module’s feeds to the scheduled task for downloading at the given interval. Of course this is subject to what all things dependent in scheduled tasks rely on: that DNN is running. So if DNN goes into idle mode (i.e. it’s been shut down by IIS for lack of activity) then nothing happens. But every time the scheduled task runs it checks to see if any feeds need refreshing and attempts to refresh them.
The current code is checked in and has been packaged. You’ll find it here in CodePlex:
The forum is here:
Feel free to play around with it. Note that with beta releases there is no guarantee for a smooth upgrade (technically speaking: we keep the version nr the same, so any changes to the SQL script for that version would not be run if you upload a next version over the beta). So you’re advised not to use it in production unless you really know what you’re doing and what risks you’re taking. If you want to report any issues, make sure to mention it is Beta (1) so we all know the context. And if you can the DNN version as well in case we need to reproduce it. Note I am still strapped for time, so if I didn’t reply to your post, I’m sorry.