Download presentation
Presentation is loading. Please wait.
1
Intelligent Systems Lab Pusan National University 2007 컴퓨터공학실험 (I) 12 주 실습강의 RSS Reader
2
Intelligent Systems Lab 2 What is RSS ? RSS (Really Simple Syndication) Web contents syndication format To share their contents with other applications in a standard way No one standard (0.91, 1.0, 2.0, ATOM)
3
Intelligent Systems Lab 3 What is RSS ?
4
Intelligent Systems Lab 4 Why RSS ? Content Provider vs Content User Easy Save Times No Spam Easy to implement, manipulation Access point for web sites Personalize
5
Intelligent Systems Lab 5 Where is RSS ? Get RSS feeds
6
Intelligent Systems Lab 6 RSS 2.0 Specification RSS is a dialect of XML. All RSS files must conform to the XML 1.0 specification, as published on the World Wide Web Consortium (W3C) website. At the top level, a RSS document is a element, with a mandatory attribute called version, that specifies the version of RSS that the document conforms to. Subordinate to the element is a single element, which contains information about the channel (metadata) and its contents. The element usually contains one or more elements. Each element defines an article or “story” in the RSS feed.
7
Intelligent Systems Lab 7 Required channel elements ElementDescriptionExample titleThe name of the channel. the applied laboratory class for Thursday link The URL to the HTML website corresponding to the channel. http://ai.ce.pusan.ac.kr/thursday descriptionPhrase or sentence describing the channel. The latest news from Thursday Applied Lab Web site.
8
Intelligent Systems Lab 8 Optional channel elements language, category, docs, rating copyrightpubDate, lastBuildDate generator, managingEditor, webMaster docs skipHours, skipDays image, cloud, ttl, textInput //These elements have sub-elements
9
Intelligent Systems Lab 9 Item elements ElementDescriptionExample titlethe title of the itemthe final exam for applied lab. linkthe URL of the item http://ai.ce.pusan.ac.kr/thursday/pr ivate/final/ descriptionthe item synopsis This document contains the sample final exam questions. authorEmail address of the authorthursday@ai.ce.pusan.ac.kr etc … category, comments, enclosure, guid, pubDate, source All elements of an item are optional, however at least one of title or description must be present.
10
Intelligent Systems Lab 10 RSS 2.0 Sample http://cyber.law.harvard.edu/rss/examples/rss2sample.xml
11
Intelligent Systems Lab 11 실습과제 - RSS Reader 실습과제 Layout 실습대상 RSS feed –http://cyber.law.harvard.edu/rss/examples/rss2sample.xmlhttp://cyber.law.harvard.edu/rss/examples/rss2sample.xml
12
Intelligent Systems Lab 12 실습과제 - RSS Reader 실습과제 실행결과
13
Intelligent Systems Lab 13 Load remote xml file Import following namespaces –using System.IO; –using System.Net; Using a Uniform Resource Identifier(URI) to identify the requested Internet resource and communications protocol for the request and response. Using HttpWebRequest class, which contains a request for the resource; and HttpWebResponse class, which provide a container for the incoming response.
14
Intelligent Systems Lab 14 Load remote xml file private void LoadFromUrl(string Url) { HttpWebRequest request; string responseText = ""; request = (HttpWebRequest)WebRequest.Create(Url); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream stream = response.GetResponseStream(); StreamReader reader = new StreamReader(stream, System.Text.Encoding.GetEncoding(949)); responseText = reader.ReadToEnd(); response.Close(); reader.Close(); Document.LoadXml(responseText); // XmlDocument }
15
Intelligent Systems Lab 15 Class Architecture Reader Class Channel Class Items Collection Item Class
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.