Skip to content

Instantly share code, notes, and snippets.

@mubbashir
Created October 13, 2011 08:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mubbashir/1283694 to your computer and use it in GitHub Desktop.
Save mubbashir/1283694 to your computer and use it in GitHub Desktop.
rss_infor.rb
require 'rss/2.0'
require 'open-uri'
def get_feed_result (url)
feed_url = url
open(feed_url) do |http|
response = http.read
result = RSS::Parser.parse(response, false)
end
end
result = get_feed_result("http://www.developsense.com/blog/feed/")
puts result.items[1]
puts "Author: #{result.items[1].author}"
=begin
Out Put:
<item>
<title>The Cooking Detector</title>
<link>http://www.developsense.com/blog/2011/09/the-cooking-detector/</link>
<description>A heuristic is a fallible method for solving a problem or making a decision. &amp;#8220;Heuristic&amp;#8221; as an adjective means &amp;#8220;something that helps us to learn&amp;#8221;. In testing, an oracle is a heuristic principle or mechanism by which we recognize a problem. Some years ago, during a lunch break from the Rapid Software Testing class, a [...]</description>
<category>Oracles</category>
<category>Testing vs. Checking</category>
<comments>http://www.developsense.com/blog/2011/09/the-cooking-detector/#comments</comments>
<pubDate>Fri, 23 Sep 2011 10:12:37 +0500</pubDate>
<guid isPermaLink="false">http://www.developsense.com/blog/?p=984</guid>
</item>
Author:
=end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment