/* * This work is licensed under the Creative Commons Attribution 2.5 License. * To view a copy of this license, visit http://creativecommons.org/licenses/by/2.5/ * or send a letter to Creative Commons, 543 Howard Street, 5th Floor, * San Francisco, California, 94105, USA. * * Original developer: David Betz * */ using System; using System.Web; using System.Web.Profile; using System.Web.SessionState; using System.Web.UI; using FeedBuilder; public partial class LoadFeed : Page { public Int32 Id { get { Int32 id = 0; if (Request.QueryString["id"] != null) { if (Int32.TryParse(Request.QueryString["id"], out id)) { return id; } } return 0; } } public String EntryTitle { get { if (Request.QueryString["title"] != null) { return Request.QueryString["title"]; } return String.Empty; } } public Guid SecretId { get { if (Request.QueryString["secretId"] != null) { Guid secureId = new Guid(); try { secureId = new Guid(Request.QueryString["secretId"]); } catch { throw new ArgumentException("Invalid SecretId"); } return secureId; } return new Guid("77D808EC-C070-49F4-A521-8CEF6FCA980F"); } } protected void Page_Load(Object sender, EventArgs e) { Response.ContentType = "text/xml"; Uri link = Request.Url; if (this.SecretId.ToString().ToUpper() != "77D808EC-C070-49F4-A521-8CEF6FCA980F") { Response.Write(FeedGenerator.GetRssFeedText(this.SecretId, link)); return; } if (this.Id > 0) { Response.Write(FeedGenerator.GetRssFeedText(this.Id, link)); return; } if (!String.IsNullOrEmpty(this.EntryTitle)) { Response.Write(FeedGenerator.GetRssFeedText(this.EntryTitle, link)); return; } throw new ArgumentException("An Id, Title, or SecretId must be provided."); } }