There is an excellent bookmarklet script that accepts an HTML document and, using javascript, removes the main content of the article (e.g. Instapaper, but better).
I want to find out the most efficient way to use the same server side javascript script with Rails 3.
Is it possible? It would be ideal to be able to request the URL from the server (in Rails), and then parse the response using javascript and return the processed text (and then be saved in db).
I thought just adapting the script in Ruby, but it seems silly, especially since jQuery and javascript themselves have a bunch of built-in functions for parsing the DOM. On the other hand, the script uses DOM constructs from the browser, so this might require a server browser?
Any suggestions?
source
share