Skip to content

Instantly share code, notes, and snippets.

@balexand
Created April 23, 2012 17:02
Show Gist options
  • Select an option

  • Save balexand/2472303 to your computer and use it in GitHub Desktop.

Select an option

Save balexand/2472303 to your computer and use it in GitHub Desktop.
screenshot.coffee
# install phantomjs using Homebrew (http://mxcl.github.com/homebrew/)
# by running `brew install phantomjs` then run this script with `phantomjs screenshot.coffee`
page = require('webpage').create()
page.viewportSize = { width: 768, height: 600 }
page.open 'http://bridgidgallagher.com/blog', (status) ->
console.log status
window.setTimeout ->
console.log "render"
page.render("screenshot.png")
phantom.exit()
, 2000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment