I launch my Facebook status feed through Yahoo channels and display it / embed it on the page of my own website.
The XML feed contains the date. I want to format the date, but don’t know how to do it. The XML part is the output of the date ... <pubDate>Thu, 14 Jul 2011 20:38:07 +0100</pubDate>and I would like it to display something like 07/14/2011.
Any help is greatly appreciated.
I have C # code ...
protected void Page_Load(object sender, EventArgs e)
{
WebRequest MyRssRequest = WebRequest.Create("http://pipes.yahoo.com/pipes/pipe.run?FacebookRssUrl=http%3A%2F%2Fwww.facebook.com%2Ffeeds%2Fpage.php%3Fid%3D456456456456456%26format%3Drss20&_id=456456456456456456464&_render=rss");
WebResponse MyRssResponse = MyRssRequest.GetResponse();
Stream MyRssStream = MyRssResponse.GetResponseStream();
XmlDocument MyRssDocument = new XmlDocument();
MyRssDocument.Load(MyRssStream);
XmlNodeList MyRssList = MyRssDocument.SelectNodes("rss/channel/item");
string sTitle = "";
string sLink = "";
string sDescription = "";
for (int i = 0; i < 3; i++)
{
XmlNode MyRssDetail;
MyRssDetail = MyRssList.Item(i).SelectSingleNode("title");
if (MyRssDetail != null)
sTitle = MyRssDetail.InnerText;
else
sTitle = "";
MyRssDetail = MyRssList.Item(i).SelectSingleNode("link");
if (MyRssDetail != null)
sLink = MyRssDetail.InnerText;
else
sLink = "";
MyRssDetail = MyRssList.Item(i).SelectSingleNode("pubDate");
if (MyRssDetail != null)
sDescription = MyRssDetail.InnerText;
else
{
sDescription = "";
}
HtmlTableCell block = new HtmlTableCell();
block.InnerHtml = "<span style='font-weight:bold'><a href='" + sLink + "' target='new'>"+ sTitle + "</a></span>";
HtmlTableRow row = new HtmlTableRow();
row.Cells.Add(block);
tbl_Feed_Reader.Rows.Add(row);
HtmlTableCell block_description = new HtmlTableCell();
block_description.InnerHtml = "<p align='justify'>" + sDescription + "</p>";
HtmlTableRow row2 = new HtmlTableRow();
row2.Cells.Add(block_description);
tbl_Feed_Reader.Rows.Add(row2);
}
}
user141621
source
share