Created
May 7, 2011 03:21
-
-
Save arooni/960169 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 '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