- Put into controller? You can put your code into a controller, which means its sync, and user, have to wait until parsing is completed.
- Works in controllers? Yes.
- Require Nokogiri? Yes.
- Rake tasks? Probably no.
You may want to checkout things like Resque.