Comment out this old code so it doesn't throw errors all the time

This commit is contained in:
Sebastiaan Janssen
2016-07-22 12:19:55 +02:00
parent 90d0ab7df1
commit 1ba26a4dd1
@@ -1,34 +1,34 @@
@using System.Configuration
@{
var blogsXmlFile = Server.MapPath("~/App_Data/communityblogs.xml");
var random = Guid.NewGuid();
// var blogsXmlFile = Server.MapPath("~/App_Data/communityblogs.xml");
var yahooPipesId = ConfigurationManager.AppSettings["YahooPipesId"];
// var random = Guid.NewGuid();
var url = string.Format("http://pipes.yahoo.com/pipes/pipe.run?_id={0}&_render=rss&rnd={1}", yahooPipesId, random);
// var yahooPipesId = ConfigurationManager.AppSettings["YahooPipesId"];
if(File.GetLastWriteTime(blogsXmlFile) < DateTime.Now.AddMinutes(-60))
{
string html = "";
// var url = string.Format("http://pipes.yahoo.com/pipes/pipe.run?_id={0}&_render=rss&rnd={1}", yahooPipesId, random);
using(WebClient client = new WebClient())
{
html = client.DownloadString(url);
}
// if(File.GetLastWriteTime(blogsXmlFile) < DateTime.Now.AddMinutes(-60))
// {
// string html = "";
html = html.Replace(string.Format("http://pipes.yahoo.com/pipes/pipe.info?_id={0}", yahooPipesId), "http://our.umbraco.org/rss/communityblogs/");
html = html.Replace(string.Format("http://pipes.yahoo.com/pipes/pipe.run?_id={0}&amp;_render=rss&amp;page=2", yahooPipesId), "http://our.umbraco.org/rss/communityblogs/");
using(StreamWriter writer = new StreamWriter(blogsXmlFile, false))
{
writer.WriteLine(html);
}
}
// using(WebClient client = new WebClient())
// {
// html = client.DownloadString(url);
// }
string blogs = File.ReadAllText(blogsXmlFile);
Response.ContentType = "application/xml";
Response.Write(blogs);
// html = html.Replace(string.Format("http://pipes.yahoo.com/pipes/pipe.info?_id={0}", yahooPipesId), "http://our.umbraco.org/rss/communityblogs/");
// html = html.Replace(string.Format("http://pipes.yahoo.com/pipes/pipe.run?_id={0}&amp;_render=rss&amp;page=2", yahooPipesId), "http://our.umbraco.org/rss/communityblogs/");
// using(StreamWriter writer = new StreamWriter(blogsXmlFile, false))
// {
// writer.WriteLine(html);
// }
// }
// string blogs = File.ReadAllText(blogsXmlFile);
// Response.ContentType = "application/xml";
//Response.Write(blogs);
}