private static XElement ParseDescription(XElement xElement, RssItem newItem, XElement subElement)
{
subElement = xElement.Element("description");
if (subElement != null)
{
newItem.Description = subElement.Value;
int indexOfComment = newItem.Description.IndexOf("<!--");
if (indexOfComment != -1)
{
string commentSection = newItem.Description.Substring(indexOfComment);
int indexOfLinkStart = commentSection.IndexOf("/><a href=\"http://www.gluevault.com/system/files/");
if (indexOfLinkStart != -1)
{
indexOfLinkStart = indexOfLinkStart + "/><a href=\"".Length;
string stringContainingFileAtStart = commentSection.Substring(indexOfLinkStart);
int endOfFile = stringContainingFileAtStart.IndexOf("\"");
string file = stringContainingFileAtStart.Substring(0, endOfFile);
newItem.DirectLink = file;
}
}
}
return subElement;
}