Created
March 9, 2013 18:20
-
-
Save cyberoctopi/5125128 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 'nokogiri' | |
| require 'open-uri' | |
| require 'celluloid' | |
| # collects any feeds given to be persisted | |
| # == Parameters | |
| # | |
| # [+FeedFetcher+::++] | |
| module FeedFetcher | |
| extend ActiveSupport::Concern | |
| include Celluloid | |
| attr_reader :url | |
| def initialize(url) | |
| @url = url | |
| end | |
| def fetch_feed(url) | |
| doc = Nokogiri::XML(open(url)) | |
| @title = doc.xpath("//title") | |
| @link = doc.xpath("//link") | |
| @description = doc.xpath("//description") | |
| t.each do |p| | |
| p "Link -- #{p}" | |
| end | |
| def persist_feed | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment