I’m currently trying to consume an RSS from other sites. The problem is, the rss is in a .php format. (But it’s actually XML, if you view the source)
I’m trying to do it with
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using System.Xml;
@{
//Get the XML from remote URL
XmlDocument xml = new XmlDocument();
//URL currently hardcoded - but you could use a macro param to pass in URL
xml.Load("http://magister.jteti.ugm.ac.id/rss/penelitian.php");
//Select the nodes we want to loop through
XmlNodeList nodes = xml.SelectNodes("//item");
//Traverse the entire XML nodes.
foreach (XmlNode node in nodes)
{
//Get the value from the <title> node
var title = node.SelectSingleNode("title").InnerText;
//Get the value from the <description> node
var description = node.SelectSingleNode("description").InnerText;
<div>
<h4>@title</h4>
<p>@description</p>
</div>
}
}
But it gives me errors.
However, I’ve tried to change the rss url to other file (WriteTheWeb) which is in .xml format and it works fine
Is it possible to consume the RSS if the provided file is in .php format? If yes, what is the possible way to do that? Thanks!
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/79881-consuming-rss-from-a-file-with-a-php-format