Changeset 15602 for lang/csharp

Show
Ignore:
Timestamp:
07/10/08 12:03:19 (5 months ago)
Author:
poolmmjp
Message:

WassrのRSSは、絵文字もユーザ投稿の文字もhtmlエスケープを同じ回数しかやってなかったので、ユーザ投稿の方を1回多くエスケープしてるxmlを使うように変更。

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/csharp/MMMMB/MMMMB/MiniBlogs/Wassr.cs

    r15407 r15602  
    5151            // xml ���Ă���            WebClient client = new WebClient(); 
    5252            client.Headers.Add("Authorization", "Basic " + Convert.ToBase64String(Encoding.ASCII.GetBytes(username + ":" + password))); 
    53             string xmlString = Encoding.UTF8.GetString(client.DownloadData("http://api.wassr.jp/statuses/friends_timeline.rss")); 
     53            string xmlString = Encoding.UTF8.GetString(client.DownloadData("http://api.wassr.jp/statuses/friends_timeline.xml")); 
    5454 
    5555            // �p�[�X����            XmlDocument xml = new XmlDocument(); 
    5656            xml.LoadXml(xmlString); 
    5757 
    58             // ���O�� 
    59             XmlNamespaceManager ns = new XmlNamespaceManager(xml.NameTable); 
    60             ns.AddNamespace("dcterms", "http://purl.org/rss/1.0/modules/dcterms/"); 
    61             ns.AddNamespace("content", "http://purl.org/rss/1.0/modules/content/"); 
    62  
    6358            // �A�C�e���Ń��[�v 
    64             XmlNodeList nodeList = xml.SelectNodes("/rss/channel/item"); 
     59            XmlNodeList nodeList = xml.SelectNodes("/statuses/status"); 
    6560            foreach (XmlNode node in nodeList) 
    6661            { 
     
    6964                string user = Regex.Replace(e.Permalink.ToString(), ".*/user/([^/]+)/statuses/.*", "$1"); 
    7065                e.Name = user; //HttpUtility.HtmlEncode(node.SelectSingleNode("author").InnerText); 
    71                 e.Content = node.SelectSingleNode("content:encoded", ns).InnerText; 
    72                 e.Date = DateTime.Parse(node.SelectSingleNode("dcterms:modified", ns).InnerText); 
     66                e.Content = node.SelectSingleNode("html").InnerText; 
     67                e.Date = DateTime.FromFileTime(long.Parse(node.SelectSingleNode("epoch").InnerText)); 
    7368                e.Image = new Uri("http://wassr.jp/user/" + user + "/profile_img.png.32"); 
    7469                entryList.Add(e);