Method: Atom::Link#fetch
- Defined in:
- lib/atom.rb
#fetch ⇒ Object
This will fetch the URL referenced by the link.
If the URL contains a valid feed, a Feed will be returned, otherwise, the body of the response will be returned.
TODO: Handle redirects.
714 715 716 717 718 719 720 721 722 |
# File 'lib/atom.rb', line 714 def fetch content = Net::HTTP.get_response(URI.parse(self.href)).body begin Atom::Feed.load_feed(content) rescue ArgumentError, ParseError => ae content end end |