As Nicholas says, RSS is simple enough and you can create an RSS feed
easily.
It should be a XML response to an HTTP request and I format only the last 10
entries in my feeds and expect the RSS reader to cache the entries it has
seen. If you turn the RSS reader off for a period of time longer than the
distribution rate you're probably not going to be vastly interested in the
"news" anyway.
After my signature is a listing for a simple RSS feed provider that I use on
one of my sites... It's quick and dirty but it seems to work fine.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
/// <summary>
/// Summary description for rss.
/// </summary>
public class rss : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
protected override void Render(HtmlTextWriter writer)
{
this.Response.ContentType="application/xml";
OleDbConnection cnx=new
OleDbConnection(Constants.NEWSConnectionString(Server));
OleDbCommand cmd=new OleDbCommand(@"SELECT TOP 10 newsitems.newsitemid,
newsitems.date, newsitems.title, newsitems.description
FROM newsitems
ORDER BY newsitems.date DESC;
",cnx);
cnx.Open();
OleDbDataReader rdr=cmd.ExecuteReader();
writer.WriteLine("<?xml version=\"1.0\"?>");
writer.WriteLine("<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS
0.91//EN\" \"
http://my.netscape.com/publish/formats/rss-0.91.dtd\">");
writer.WriteLine(" <rss version=\"0.91\">");
writer.WriteLine(" <channel>");
writer.WriteLine(" <!-- Channel Information -->");
writer.WriteLine(" <title>Your newsfeed title goes here</title>");
writer.WriteLine(" <link>
http://www.yourlink.com</link>");
writer.WriteLine(" <description>This is some blurb</description>");
writer.WriteLine(" <language>en-us</language>");
if(rdr.HasRows)
{
while(rdr.Read())
{
writer.WriteLine(" <!-- Item details -->");
writer.WriteLine(" <item>");
writer.WriteLine(string.Format("
<title>{0}</title>",rdr["title"].ToString()));
writer.WriteLine(string.Format("
<description>{0}</description>",rdr["description"].ToString()));
writer.WriteLine(string.Format("
<link>{0}?item={1}</link>",Constants.NewsContentUrl,
rdr["newsitemid"].ToString()));
writer.WriteLine(" </item>");
writer.WriteLine(" <!-- End Item details -->");
}
}
writer.WriteLine(" </channel>");
writer.WriteLine(" </rss>");
writer.Flush();
}