Hernán Lucas P. <[email protected]> wrote: > I'm kinda newbie in RoR yet and I'm having a hard time trying to figure > out how should I implement this. I'm writing an application to store and > display information about insects and their distribution. Currently I > have almost all functionality implemented, except for a **very** > important one: The application must be capable of "crawling" itself and > generate a zip archive for download. Actually, crawling itself isn't > accurate enough, since the views must be sightly different (e.g. don't > provide functionality not available without Internet connection, > indicate in the title that the page is an offline copy, etc). > > The question is: Do you have any suggestions as to how I should > implement this?
My suggestion is I hope simple. Use wget to crawl/mirror the site, using a query string parameter to indicate you want the "offline" views -- you still need to implement them if they are different enough -- by checking that the special parameter is set; you should be able to set it just once for the session, and have wget use cookies to maintain the session info. Another alternative instead of the query string parm could be using the user agent string wget sends, and always deliver the "offline" version to that UA string. The mirroring will pull all the urls that are included under the main one. If your assets are not under that main url, this won't work. You can tell wget to pull from elsewhere, but it can easily get out of hand. Hope this helps. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/51bfd4c9.a870320a.0dab.5746%40mx.google.com. For more options, visit https://groups.google.com/groups/opt_out.

