source: other-projects/FileTransfer-WebSocketPair/Themes/themebuilder/bin/phantomjs-1.9.2-windows/examples/imagebin.coffee@ 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: 590 bytes
Line 
1# Upload an image to imagebin.org
2
3page = require('webpage').create()
4system = require 'system'
5
6if system.args.length isnt 2
7 console.log 'Usage: imagebin.coffee filename'
8 phantom.exit 1
9else
10 fname = system.args[1]
11 page.open 'http://imagebin.org/index.php?page=add', ->
12 page.uploadFile 'input[name=image]', fname
13 page.evaluate ->
14 document.querySelector('input[name=nickname]').value = 'phantom'
15 document.querySelector('input[name=disclaimer_agree]').click()
16 document.querySelector('form').submit()
17
18 window.setTimeout ->
19 phantom.exit()
20 , 3000
Note: See TracBrowser for help on using the repository browser.