2 using System.Collections.Generic;
6 using System.Text.RegularExpressions;
8 namespace Azyobuzi.HatenaDiaryClient.Models.Hatena
10 public class FotolifeEntry
12 public string Title { set; get; }
13 public string PageUri { set; get; }
14 public string Id { set; get; }
15 public DateTime Issued { set; get; }
16 public string Folder { set; get; }
17 public string ImageUri { set; get; }
18 public string ThumbnailUri { set; get; }
19 public string HatenaSyntax { set; get; }
21 public FotolifeEntry() { }
22 public FotolifeEntry(XElement xml, bool isRdf)
30 this.Title = xml.Element(XmlNamespaces.Atom02Spec + "title").Value;
31 this.PageUri = xml.Elements(XmlNamespaces.Atom02Spec + "link")
32 .Where(_ => _.Attribute("rel").Value == "alternate")
33 .Select(_ => _.Attribute("href").Value)
35 this.Id = Regex.Match(this.PageUri, @"\d+$").ToString();
36 this.Issued = DateTime.Parse(xml.Element(XmlNamespaces.Atom02Spec + "issued").Value);
37 this.Folder = xml.Element(XmlNamespaces.DublinCore + "subject").Value;
38 this.ImageUri = xml.Element(XmlNamespaces.HatenaNs + "imageurl").Value;
39 this.ThumbnailUri = xml.Element(XmlNamespaces.HatenaNs + "imageurlsmall").Value;
40 this.HatenaSyntax = xml.Element(XmlNamespaces.HatenaNs + "syntax").Value;