Skip to content

Instantly share code, notes, and snippets.

@cyberoctopi
Created March 9, 2013 18:20
Show Gist options
  • Select an option

  • Save cyberoctopi/5125128 to your computer and use it in GitHub Desktop.

Select an option

Save cyberoctopi/5125128 to your computer and use it in GitHub Desktop.
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