source: other-projects/FileTransfer-WebSocketPair/Themes/themebuilder/bin/phantomjs-1.9.2-windows/examples/imagebin.js@ 31525

Last change on this file since 31525 was 31525, checked in by ak19, 7 years ago

Nathan provided more stuff: Themes folder contains Sencha's Themebuilder which generates GXT Themes. It includes the .theme and generated .jar files for the project theme.

File size: 731 bytes
Line 
1// Upload an image to imagebin.org
2
3var page = require('webpage').create(),
4 system = require('system'),
5 fname;
6
7if (system.args.length !== 2) {
8 console.log('Usage: imagebin.js filename');
9 phantom.exit(1);
10} else {
11 fname = system.args[1];
12 page.open("http://imagebin.org/index.php?page=add", function () {
13 page.uploadFile('input[name=image]', fname);
14 page.evaluate(function () {
15 document.querySelector('input[name=nickname]').value = 'phantom';
16 document.querySelector('input[name=disclaimer_agree]').click()
17 document.querySelector('form').submit();
18 });
19 window.setTimeout(function () {
20 phantom.exit();
21 }, 3000);
22 });
23}
Note: See TracBrowser for help on using the repository browser.