Hi guys - hoping someone can point me in the right direction. I need to consume the contents of an RSS feed into the content of a page in a way that it is indexable by the search.
I've had a hunt around and although there seem to be lots of packages historically which did this, I can't find anything useful for v8, or actually anyone else who's had to solve this for a while.
Anyone tackled a similar problem? Thanks v much in advance.
This shouldn't be version dependent(ish), this a rough shell to render an XML feed of any kind with a macro, you could probably adapt it slightly to use a regular partial.
@using System;
@using System.IO;
@using System.Xml.XPath;
@using System.Xml;
@using umbraco.MacroEngines;
@inherits umbraco.MacroEngines.DynamicNodeContext
@{
//Request Query String if needed
int archiveYear = Request.QueryString["archiveYear"].AsInt();
//Fetch RSS XML
XmlTextReader feedUrl = new XmlTextReader("url to your rss feed");
//Create new XML document
XmlDocument doc = new XmlDocument();
//Load in our remote XML into our XML document
doc.Load(feedUrl);
//Select our nodes we want with some xPath
XmlNodeList feedItems = doc.SelectNodes("//node to render");
}
<ul>
@{
//For each item node we can then ouput what we want
foreach (XmlNode node in feedItems)
{
<h1>render stuff here</h1>
}
}
</ul>
Thanks Amir, that's really helpful and I'll keep it on file.
Reading this I've realised that the challenge that I have (and sorry I didn't make this clearer), is that I need the content to be indexable, so if I render it out on the template the search won't know about it.
I've read CMSImport might be able to help, but it doesn't seem to be supported in V8 as far as I can see.
You could just import your rss feed items into a document, that is how we deal with the products in our shop (the products come from a crm system) and create documents of type product when they are imported. (I have a manual job to refresh them, but you would probably want to automate that part perhaps.
You should then be able to deal with them as you do any other document type in Umbraco
We definitely have used CMS import to import RSS feeds on a schedule in the past. It looks like there was a release for v8 though I'm not seeing a download button or link to our. anywhere: https://soetemansoftware.nl/news/cmsimport-v4-released
Thanks Amir, I had a play with CMSImport last night and although it's not going to work how I planned, I can certainly get it to work. Thanks for your help ! :)
Consuming RSS feed in Umbraco 8
Hi guys - hoping someone can point me in the right direction. I need to consume the contents of an RSS feed into the content of a page in a way that it is indexable by the search.
I've had a hunt around and although there seem to be lots of packages historically which did this, I can't find anything useful for v8, or actually anyone else who's had to solve this for a while.
Anyone tackled a similar problem? Thanks v much in advance.
This shouldn't be version dependent(ish), this a rough shell to render an XML feed of any kind with a macro, you could probably adapt it slightly to use a regular partial.
Thanks Amir, that's really helpful and I'll keep it on file.
Reading this I've realised that the challenge that I have (and sorry I didn't make this clearer), is that I need the content to be indexable, so if I render it out on the template the search won't know about it.
I've read CMSImport might be able to help, but it doesn't seem to be supported in V8 as far as I can see.
You could just import your rss feed items into a document, that is how we deal with the products in our shop (the products come from a crm system) and create documents of type product when they are imported. (I have a manual job to refresh them, but you would probably want to automate that part perhaps.
You should then be able to deal with them as you do any other document type in Umbraco
We definitely have used CMS import to import RSS feeds on a schedule in the past. It looks like there was a release for v8 though I'm not seeing a download button or link to our. anywhere: https://soetemansoftware.nl/news/cmsimport-v4-released
Apparently can't see today, here's the download for the trial and the RSS provider: https://soetemansoftware.nl/cmsimport/downloads
Thanks Amir, I had a play with CMSImport last night and although it's not going to work how I planned, I can certainly get it to work. Thanks for your help ! :)
is working on a reply...