Skip to content

Instantly share code, notes, and snippets.

@radiospiel
Created March 18, 2013 18:31
Show Gist options
  • Save radiospiel/5189562 to your computer and use it in GitHub Desktop.
Save radiospiel/5189562 to your computer and use it in GitHub Desktop.
class Movie < ActiveRecord::Base
end
module Crawler
extend self
def run
html = Net::HTTP.get "..."
doc = Nokogiri.HTML(html)
doc.css(".movies").each do |movie|
Movie.create! :name => "Name"
Theater.create! :name => "Name"
...
end
end
end
class Movie
extend Crawler
Movie.run
end
@jensitus
Copy link

I always get an "uninitialized constant Movie" Error ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment