News for hackers. Stuff that matters.

Ask HN: What Technology does Optimizely use?

I was playing with Optimizely's experiment creator today and I really want to know how they grab any website and then allow the user to interact with it.

I want to do something similar, but instead of editing the code, I want to allow the user to select a region of the page and take a screenshot of it.

If someone can comment on how they do that, I would really appreciate it.

( 9 comments | 15 points | on HN )
Re:Ask HN: What Technology does Optimizely use? by antimatter15 on Sunday December 05, 2010 @07:16PM (#1973238)
There's a proxy that attaches JS to a frame. It needs to be proxied to bypass the same origin js limitations. Another way you could take would be to make a browser extension.

I used a similar technique in http://wikify.antimatter15.com/server/proxy?http://optimizel...

source code: http://code.google.com/p/wikify/source/browse/trunk/appengin...

Re:Ask HN: What Technology does Optimizely use? by dawie on Sunday December 05, 2010 @08:17PM (#1973387)
How can I contact you? You can also drop me an email at tabtrickapp at google's email service
Re:Ask HN: What Technology does Optimizely use? by bretthopper on Sunday December 05, 2010 @06:44PM (#1973139)
After a quick glance, they load the page in an iFrame and inject their CSS + JS into it.

Any of changes you make will be "compiled" into a JS file which you then include on your page. Whatever edits you made will only be reflected client side on load.

Generating a screenshot is a completely different process than editing a website so I'm not sure Optimizely's tech is that useful to you.

Re:Ask HN: What Technology does Optimizely use? by antimatter15 on Sunday December 05, 2010 @07:18PM (#1973245)
It's not possible to take a screenshot with unprivledged javascript (there's a method to draw a window into a canvas for privledge js in firefox and a screenshot api for chrome and safari). The only way would be to use a browser extension unless you wanted to use implement your own rendering engine (perhaps based on getComputedStyle) in canvas (that would be cool though!).
Re:Ask HN: What Technology does Optimizely use? by dawie on Sunday December 05, 2010 @05:45PM (#1972971)
Re:Ask HN: What Technology does Optimizely use? by trizk on Sunday December 05, 2010 @07:13PM (#1973227)
Check out "wkhtmltopdf", I think it has a library to take a screenshot.
Re:Ask HN: What Technology does Optimizely use? by dawie on Sunday December 05, 2010 @09:41PM (#1973598)
I am more interested in getting an existing website to display inside my own, than doing screenshots. There are services and APIs out there that does screenshots quite well.
Re:Ask HN: What Technology does Optimizely use? by excid3 on Sunday December 05, 2010 @07:04PM (#1973199)
Building a browser extension wold probably make the most sense for taking a screenshot of a full page or portion of it.