Changeset 15602 for lang/csharp
- Timestamp:
- 07/10/08 12:03:19 (5 months ago)
- Files:
-
- 1 modified
-
lang/csharp/MMMMB/MMMMB/MiniBlogs/Wassr.cs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/csharp/MMMMB/MMMMB/MiniBlogs/Wassr.cs
r15407 r15602 51 51 // xml ���Ă��� WebClient client = new WebClient(); 52 52 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")); 54 54 55 55 // �p�[�X���� XmlDocument xml = new XmlDocument(); 56 56 xml.LoadXml(xmlString); 57 57 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 63 58 // �A�C�e���Ń��[�v 64 XmlNodeList nodeList = xml.SelectNodes("/ rss/channel/item");59 XmlNodeList nodeList = xml.SelectNodes("/statuses/status"); 65 60 foreach (XmlNode node in nodeList) 66 61 { … … 69 64 string user = Regex.Replace(e.Permalink.ToString(), ".*/user/([^/]+)/statuses/.*", "$1"); 70 65 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)); 73 68 e.Image = new Uri("http://wassr.jp/user/" + user + "/profile_img.png.32"); 74 69 entryList.Add(e);
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)