Changeset 13978 for lang/csharp

Show
Ignore:
Timestamp:
06/15/08 08:06:48 (5 months ago)
Author:
poolmmjp
Message:

FriendFeedとJaikuに関して、他のサービスから流し込んでるデータがわかるようにアイコンを表示するようにした。

Location:
lang/csharp/MMMMB/MMMMB/MiniBlogs
Files:
2 modified

Legend:

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

    r13604 r13978  
    6060            foreach (XmlNode node in nodeList) 
    6161            { 
     62                string icon = node.SelectSingleNode("ff:service/ff:iconUrl", ns).InnerText; 
     63                string link = node.SelectSingleNode("link", ns).InnerText; 
     64 
    6265                Entry e = new Entry(); 
    6366                e.Permalink = new Uri("http://friendfeed.com/e/" + node.SelectSingleNode("ff:id", ns).InnerText); 
    6467                e.Name = HttpUtility.HtmlEncode(node.SelectSingleNode("ff:user/ff:nickname", ns).InnerText); 
    65                 e.Content = HttpUtility.HtmlEncode(node.SelectSingleNode("title").InnerText); 
     68                e.Content = 
     69                    "<a href=\"" + link + "\"><img src=\"" + icon + "\" alt=\"" + link + "\" /></a>" + 
     70                    HttpUtility.HtmlEncode(node.SelectSingleNode("title").InnerText); 
    6671                e.Date = DateTime.Parse(node.SelectSingleNode("pubDate").InnerText); 
    6772                e.Image = new Uri(node.SelectSingleNode("ff:user/ff:profileUrl", ns).InnerText + "/picture?size=medium&v=1"); 
  • lang/csharp/MMMMB/MMMMB/MiniBlogs/Jaiku.cs

    r10019 r13978  
    5555 
    5656            // �A�C�e���Ń��[�v 
     57            Regex r = new Regex("<img src=\\\"(http://jaiku.com/images/icons/.+?)\\\" class=\\\"icon\\\" alt=\\\".+?\\\" />"); 
    5758            XmlNodeList nodeList = xml.SelectNodes("/rss/channel/item"); 
    5859            foreach (XmlNode node in nodeList) 
    5960            { 
     61                string icon = null; 
     62                Match m = r.Match(node.SelectSingleNode("description").InnerText); 
     63                if (m.Success) icon = m.Groups[1].Value; 
     64                string link = node.SelectSingleNode("link").InnerText; 
     65 
    6066                Entry e = new Entry(); 
    6167                e.Permalink = new Uri(node.SelectSingleNode("guid").InnerText); 
    6268                e.Name = HttpUtility.HtmlEncode(node.SelectSingleNode("jaiku:user", ns).Attributes["nick"].InnerText); 
    63                 e.Content = HttpUtility.HtmlEncode(node.SelectSingleNode("title").InnerText); 
     69                e.Content = 
     70                    (icon != null ? "<a href=\"" + link + "\"><img src=\"" + icon + "\" alt=\"" + link + "\" /></a>" : "") + 
     71                    HttpUtility.HtmlEncode(node.SelectSingleNode("title").InnerText); 
    6472                e.Date = DateTime.Parse(node.SelectSingleNode("pubDate").InnerText); 
    6573                e.Image = new Uri(node.SelectSingleNode("jaiku:user", ns).Attributes["avatar"].InnerText);