Home > rack-uri-loader

rack-uri-loader

Rack-uri-loader is a project mainly written in RUBY and JAVASCRIPT, it's free.

allow Rails app to load an external webpage into Rack, the better to further mess with it

This Rack middleware (rack-uri-loader.rb) is intended to serve an external Web resource as though it were local, allowing further transmogrification.

If you set your rails app to serve a view as text rather than as html,

render :text => "http://www.yahoo.com", :content_type => "text/plain"

then this middleware assumes you are giving it a URL. The middleware fetches the URL and serves up the resource in that view of your application.

(techiferous's rack-plastic, http://github.com/techiferous/rack-plastic, is a complementary middleware which you could use to facilitate further Nokogiri manipulation of the page to be rendered. It was part of the inspiration for this middleware.)

Previous:Subterfuge