Created
October 13, 2011 08:06
-
-
Save mubbashir/1283694 to your computer and use it in GitHub Desktop.
rss_infor.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. &#8220;Heuristic&#8221; as an adjective means &#8220;something that helps us to learn&#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