Sha256: f304ca1e6442ac7790fa1914c0c71e156ac681082af6630cd19fe2b309e3c51f

Contents?: true

Size: 731 Bytes

Versions: 17

Compression:

Stored size: 731 Bytes

Contents

// Upload an image to imagebin.org

var page = require('webpage').create(),
    system = require('system'),
    fname;

if (system.args.length !== 2) {
    console.log('Usage: imagebin.js filename');
    phantom.exit(1);
} else {
    fname = system.args[1];
    page.open("http://imagebin.org/index.php?page=add", function () {
        page.uploadFile('input[name=image]', fname);
        page.evaluate(function () {
            document.querySelector('input[name=nickname]').value = 'phantom';
            document.querySelector('input[name=disclaimer_agree]').click()
            document.querySelector('form').submit();
        });
        window.setTimeout(function () {
            phantom.exit();
        }, 3000);
    });
}

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
hooch-0.4.2 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/imagebin.js
hooch-0.4.1 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/imagebin.js
hooch-0.4.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/imagebin.js
hooch-0.3.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/imagebin.js
hooch-0.2.1 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/imagebin.js
hooch-0.2.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/imagebin.js
hooch-0.1.0 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/imagebin.js
hooch-0.0.8 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/imagebin.js
hooch-0.0.7 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/imagebin.js
hooch-0.0.6 jasmine/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/examples/imagebin.js
entangled-0.0.16 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/imagebin.js
entangled-0.0.15 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/imagebin.js
entangled-0.0.14 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/imagebin.js
entangled-0.0.13 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/imagebin.js
entangled-0.0.12 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/imagebin.js
entangled-0.0.11 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/imagebin.js
entangled-0.0.10 spec/dummy/public/node_modules/phantomjs/lib/phantom/examples/imagebin.js