RSS 7 January 2019 OSU CSE 1 R eally S imple S yndication A - - PowerPoint PPT Presentation

rss
SMART_READER_LITE
LIVE PREVIEW

RSS 7 January 2019 OSU CSE 1 R eally S imple S yndication A - - PowerPoint PPT Presentation

RSS 7 January 2019 OSU CSE 1 R eally S imple S yndication A textual format used on the web for news feeds or web feeds is RSS Uses XML to represent information that is frequently updated (e.g., news, weather, sports


slide-1
SLIDE 1

RSS

7 January 2019 OSU CSE 1

slide-2
SLIDE 2

Really Simple Syndication

  • A textual format used on the web for “news

feeds” or “web feeds” is RSS

– Uses XML to represent information that is frequently updated (e.g., news, weather, sports scores, blogs), generally in summary form with links to originals – Became a de facto standard in the early 2000s

  • Actually, two standards; we will use RSS 2.0, a.k.a.

RSS 2.*

7 January 2019 OSU CSE 2

slide-3
SLIDE 3

Relationship of RSS to XML

  • An RSS 2.0 feed is well-formed XML
  • An RSS 2.0 feed meets additional

specifications beyond being XML: certain tags, certain required/optional attributes, certain required/optional elements, etc.

7 January 2019 OSU CSE 3

slide-4
SLIDE 4

Example RSS Feed

<rss version="2.0"> <channel> <title>Yahoo! News</title> <link>http://news.yahoo.com</link> <description>The latest news and headlines from Yahoo! News. </description> <item> <title>Apple seeks to stop…</title> <link>http://news.yahoo.com/...</link> <description>Apple Inc will seek a...</description> <pubDate>Mon, 27 Aug 2012 14:40:49</pubDate> <source url="http://www.reuters.com">Reuters</source> </item> ... </channel> </rss>

7 January 2019 OSU CSE 4

slide-5
SLIDE 5

Example RSS Feed

<rss version="2.0"> <channel> <title>Yahoo! News</title> <link>http://news.yahoo.com</link> <description>The latest news and headlines from Yahoo! News. </description> <item> <title>Apple seeks to stop…</title> <link>http://news.yahoo.com/...</link> <description>Apple Inc will seek a...</description> <pubDate>Mon, 27 Aug 2012 14:40:49</pubDate> <source url="http://www.reuters.com">Reuters</source> </item> ... </channel> </rss>

7 January 2019 OSU CSE 5

The top-level element is rss, and it has a required version attribute whose value must be "2.0".

slide-6
SLIDE 6

Example RSS Feed

<rss version="2.0"> <channel> <title>Yahoo! News</title> <link>http://news.yahoo.com</link> <description>The latest news and headlines from Yahoo! News. </description> <item> <title>Apple seeks to stop…</title> <link>http://news.yahoo.com/...</link> <description>Apple Inc will seek a...</description> <pubDate>Mon, 27 Aug 2012 14:40:49</pubDate> <source url="http://www.reuters.com">Reuters</source> </item> ... </channel> </rss>

7 January 2019 OSU CSE 6

There is exactly one required channel element inside the rss element.

slide-7
SLIDE 7

Example RSS Feed

<rss version="2.0"> <channel> <title>Yahoo! News</title> <link>http://news.yahoo.com</link> <description>The latest news and headlines from Yahoo! News. </description> <item> <title>Apple seeks to stop…</title> <link>http://news.yahoo.com/...</link> <description>Apple Inc will seek a...</description> <pubDate>Mon, 27 Aug 2012 14:40:49</pubDate> <source url="http://www.reuters.com">Reuters</source> </item> ... </channel> </rss>

7 January 2019 OSU CSE 7

These three elements are required, but may appear in any order.

slide-8
SLIDE 8

Example RSS Feed

<rss version="2.0"> <channel> <title>Yahoo! News</title> <link>http://news.yahoo.com</link> <description>The latest news and headlines from Yahoo! News. </description> <item> <title>Apple seeks to stop…</title> <link>http://news.yahoo.com/...</link> <description>Apple Inc will seek a...</description> <pubDate>Mon, 27 Aug 2012 14:40:49</pubDate> <source url="http://www.reuters.com">Reuters</source> </item> ... </channel> </rss>

7 January 2019 OSU CSE 8

There can be zero or more item elements within channel; each has at least a title or description element within it, but these may appear in any order.

slide-9
SLIDE 9

Example XMLTree Created

7 January 2019 OSU CSE 9

<rss> version → 2.0 <channel> <item> <title> <link> <description> <item> <title> <link> <description> <pubDate> <source> url → http://www.reuters.com <link> http://news.yahoo.com Apple seeks to stop... http:// news.yahoo.com/... Reuters Mon, 27 Aug 2012 14:40:49 Apple Inc will seek a...

REQUIRED

<title> AT LEAST ONE REQUIRED <item> REQUIRED, IF PARENT PRESENT

. . .

No order guaranteed among children No order guaranteed among children

<link> <title> <description> <channel> <rss> <item> <item> <title> <link> <description> <pubDate> <source> Yahoo! News The latest news and headlines from Yahoo! News. NOT REQUIRED

slide-10
SLIDE 10

Summary of XMLTree Features

  • Properties of the XMLTree from an RSS 2.0 feed:

– The root node is an rss node with a version attribute whose value is "2.0" – There is one channel node as a child of the root – The channel node has certain required child nodes: one title, one link, and one description, in no particular

  • rder; it can also have zero or more item child nodes plus other
  • ptional children

– No particular order is required among the children of an item node, but for each item node at least one of its children must be a title or description node

7 January 2019 OSU CSE 10

slide-11
SLIDE 11

Resources

  • Wikipedia: RSS

– http://en.wikipedia.org/wiki/RSS

  • Wikipedia: Web Feed

– http://en.wikipedia.org/wiki/Web_feed

  • Wikipedia: Web Syndication

– http://en.wikipedia.org/wiki/Web_syndication

  • RSS 2.0 Specification

– http://www.rssboard.org/rss-specification

7 January 2019 OSU CSE 11