Screenshot App, twss.js, WebGL Tunnel Tutorial

2012-01-13 00:00:00 +0000 by Alex R. Young

Screenshot App

Screenshot App (License: MIT) by TJ Holowaychuk is an Express app that uses PhantomJS to generate screenshots of web pages. It's a small web service with a simple API that'll return a PNG when called with a URL:

curl -# http://localhost:3000/example.com > example.com.png

This is a nice little example of an Express app. Like TJ's other public apps, this one is structured around a lightweight app.js file, and then the HTTP methods are split into files in routes/. TJ defines the Express app object as a global, which means it's visible inside the routes modules. There's a lot to learn here if you're an eager Express developer.


Earlier this week a reader sent in twss.js (npm: twss, License: MIT) by Daniel Rapp, a classifier for Node that determines if a string can be replied with "that's what she said". I actually took a look at how it works, and rather than being a simple joke module, the author has actually attempted to build a K-fold cross-validation classifier. What's even more hilarious is the module currently has 457 GitHub watchers.

The module includes data, so it'll classify things out of the box:

twss.is("You're not going fast enough!");   // true

If you're interested in classifiers, there are a few for Node -- we've featured brain (npm: brain, License: MIT) by Heather Arthur before.

WebGL Tunnel Tutorial

I recently mentioned a WebGL tunnel effect created by Jerome Etienne. He's now published his tutorial that explains how the demo works, in Tunnel Effect for Your Demo. By "demo" the title is referring to demoscene demos.

Amazingly, the source for the effect is only 20 lines.