Sha256: eddb77dec95c512e5e5914fe88acb044972456aea91e68cd40c297b9c423ca49

Contents?: true

Size: 524 Bytes

Versions: 2

Compression:

Stored size: 524 Bytes

Contents

page = require('webpage').create()
address = phantom.args[0]

if phantom.args.length is 0
    console.log 'Usage: netlog.coffee <some URL>'
    phantom.exit()
else
    page.onResourceRequested = (req) ->
        console.log 'requested ' + JSON.stringify(req, undefined, 4)

    page.onResourceReceived = (res) ->
        console.log 'received ' + JSON.stringify(res, undefined, 4)

    page.open address, (status) ->
        if status isnt 'success'
            console.log 'FAIL to load the address'
        phantom.exit()

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
phantomjs.rb-0.0.2 vendor/phantomjs-1.4.1_OSX/examples/netlog.coffee
phantomjs.rb-0.0.1 vendor/phantomjs-1.4.1_OSX/examples/netlog.coffee