Control a headless browser console right from your terminal
CoffeeScript
Latest commit 55d7758 Jul 19, 2012 @gr2m minor readme fix
Failed to load latest commit information.
.gitignore initial commit Jul 19, 2012
CAKEFILE 1,2,3 ... Jul 19, 2012
README.md minor readme fix Jul 19, 2012
phantomjs_console.coffee added screencast Jul 19, 2012

README.md

PhantomJS Console

Control a headless browser console right from your terminal

Phantom Console Screencast

Dependencies

PhantomJS, the headless browser

got brew? lucky you:

$ brew update && brew install phantomjs

other systems: it's simple, too

1, 2 ... done

$ cake -l http://google.com console

Put your commands in the following file:
$EDITOR .command.js

Exit with ^ + C

 > console.log(location)
http://www.google.de/

Usage

# open command file
$ $EDITOR .command.js 

# start console
$ phantomjs phantomjs_console.coffee http://google.com

You can also use cake to open the command file and to start the console. This will let you run coffeescript commands.

$ cake -l http://google.com console

Every time you hit save in your editor, the command will be executed within the scope of the passed location (a url or a local path)

How does it work?

PhantomJS executes phantomjs_console.coffee, wich is continuously watching for changes of the .command.js file. When ever a change appears, it loads and deletes its contents and executes it as command within the scope of the passed location.

That's it. Feedback most welcome