Skip to content

Instantly share code, notes, and snippets.

@arooni
Created May 7, 2011 03:21
Show Gist options
  • Save arooni/960169 to your computer and use it in GitHub Desktop.
Save arooni/960169 to your computer and use it in GitHub Desktop.
require 'simple-rss'
class Parser
puts "parser"
class RssParser
puts "rss_parser"
def self.perform(rss_url)
begin
puts "called right method"
@rss = SimpleRss.parse open(rss_url)
end
end
end
class HtmlParser
def self.perform(params)
end
end
end
# and trying to call it (from another file)
RAILS_ENV = "development"
require "#{File.dirname(__FILE__)}/../config/environment"
require "../lib/parser.rb"
RssParser.perform("http://seattle.craigslist.org/search/?areaID=2&subAreaID=&query=vstrom&catAbb=sss&format=rss")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment