1 / 15

CIT 383: Administrative Scripting

Learn about web feeds and how they provide users with frequently updated information like news, weather, and more. Explore different web feed formats and aggregators, and discover how to use Ruby to work with RSS and Atom feeds.

Download Presentation

CIT 383: Administrative Scripting

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. RSS CIT 383: Administrative Scripting CIT 383: Administrative Scripting

  2. CIT 383: Administrative Scripting Topics • Web Feeds • Aggregators • RSS • Atom • Feeds in Ruby

  3. 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.

  4. 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

  5. CIT 383: Administrative Scripting Web Feeds User pulls content from provider. Provider doesn’t know user e-mail. Unsubscribe by configuring client. E-mail Provider pushes content to user. Provider has user e-mail address. Unsubscribe by contacting provider. Feeds vs E-mail

  6. CIT 383: Administrative Scripting Aggregators

  7. CIT 383: Administrative Scripting 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 Aggregators

  8. 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

  9. 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

  10. CIT 383: Administrative Scripting RSS 1.0 Example

  11. CIT 383: Administrative Scripting Atom Alternative to RSS, published as RFC 4287. 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.

  12. CIT 383: Administrative Scripting Atom Example

  13. 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.

  14. CIT 383: Administrative Scripting FeedTools require ‘feed_tools’ url = ‘http://www.pragprog.com/podcasts/feed.rss’ feed = FeedTools::Feed.open(url) feed.entries.each_with_index do |entry,i| puts “#{i} #{entry.title}” end

  15. CIT 383: Administrative Scripting References • Michael Fitzgerald, Learning Ruby, O’Reilly, 2008. • David Flanagan and Yukihiro Matsumoto, The Ruby Programming Language, O’Reilly, 2008. • Hal Fulton, The Ruby Way, 2nd edition, Addison-Wesley, 2007. • Robert C. Martin, Clean Code, Prentice Hall, 2008. • Dave Thomas with Chad Fowler and Andy Hunt, Programming Ruby, 2nd edition, Pragmatic Programmers, 2005.

More Related