using System;
-using System.Collections.Generic;
using System.Linq;
-using System.Text;
using System.Text.RegularExpressions;
using System.Xml.Linq;
this.HatenaSyntax = xml.Elements(XmlNamespaces.HatenaNs + "syntax")
.Select(_ => _.Value)
.SingleOrDefault();
- this.DateId = Regex.Match(this.BlogPage, @"\d+/\d+$").ToString();
+ this.DateId = Regex.Match(
+ xml.Elements(XmlNamespaces.Atom + "link")
+ .Where(_ => _.Attribute("rel").Value == "edit")
+ .Select(_ => _.Attribute("href").Value)
+ .First(),
+ @"(\d+/\d+|\d+)$"
+ ).ToString();
}
}
}