CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting RSS
CIT 383: Administrative Scripting Topics 1.Web Feeds 2.Aggregators 3.RSS 4.Atom 5.Feeds in Ruby
CIT 383: Administrative Scripting Web Feeds A web feed is a data format used for providing users with frequently updated information, like weather, news, comments. Content providers syndicate a web feed by providing it via a URL on their web site. Readers subscribe to a web feed to get updates. Software like RSS Bandit or Google Reader aggregate multiple web feeds in a single interface so user does not have to visit sites to check for updates manually.
CIT 383: Administrative Scripting What data is available via feeds? Blogs Blog comments Tagged blog entries Music News Pictures (from Flickr) Social networking sites Transport schedules (Google Transit) Videos Weather
CIT 383: Administrative Scripting Feeds vs Web Feeds User pulls content from provider. Provider doesn’t know user . Unsubscribe by configuring client. Provider pushes content to user. Provider has user e- mail address. Unsubscribe by contacting provider.
CIT 383: Administrative Scripting Aggregators
CIT 383: Administrative Scripting Aggregators Browser Firefox (live bookmarks) Firefox Sage add-on IE 7 Opera Standalone Akregator BottomFeeder Liferea RSS Bandit Online AmphetaDesk Bloglines Fastladder Google Reader Indirect iGoogle MyYahoo sidebars
CIT 383: Administrative Scripting Web Feed Formats Web feeds include both content and metadata Content: Title, link, full or summarized text Metadata: Author, publication date XML-data formats Atom RSS
CIT 383: Administrative Scripting RSS Variants RSS-DEV Working Group RDF Site Summary 0.90 from Netscape RDF Site Summary 1.0 Harvard’s Berkman Center Rich Site Summary 0.91 from Netscape Really Simple Syndication 2.0
CIT 383: Administrative Scripting RSS 1.0 Example
CIT 383: Administrative Scripting Atom Alternative to RSS, published as RFC Features: Requires title, unique ID, and last updated time. Payload container specifies content type Plain text Escaped or well-formed HTML Base64-encoded binary data Separate summary and content elements. Standardizes feed autodiscovery.
CIT 383: Administrative Scripting Atom Example
CIT 383: Administrative Scripting Ruby Feeds RSS Part of Ruby core library. Parses and writes RSS. FeedTools Available as a gem. Parses Atom and RSS. Can convert between Atom and RSS versions. Rails Can write Atom and RSS feeds.
CIT 383: Administrative Scripting FeedTools require ‘feed_tools’ url = ‘ feed = FeedTools::Feed.open(url) feed.entries.each_with_index do |entry,i| puts “#{i} #{entry.title}” end
CIT 383: Administrative ScriptingSlide #15 References 1.Michael Fitzgerald, Learning Ruby, O’Reilly, David Flanagan and Yukihiro Matsumoto, The Ruby Programming Language, O’Reilly, Hal Fulton, The Ruby Way, 2 nd edition, Addison- Wesley, Robert C. Martin, Clean Code, Prentice Hall, Dave Thomas with Chad Fowler and Andy Hunt, Programming Ruby, 2 nd edition, Pragmatic Programmers, 2005.