Last active
August 30, 2017 08:03
-
-
Save gbraad/927860c0c7be21df14de to your computer and use it in GitHub Desktop.
Fling website to MatchStick or flingd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env coffee | |
request = require "request" | |
HOST = process.argv[3] || "localhost" | |
URL = "http://" + HOST + ":9431/apps/" | |
APP_ID = "~browser" | |
APP_URL = URL + APP_ID | |
OPEN_URL = process.argv[2] || "http://gbraad.nl" | |
cmd = | |
type: "launch" | |
app_info: | |
url: OPEN_URL, | |
useIpc: false, | |
maxInactive: 0 | |
option = | |
url: APP_URL | |
method: "POST" | |
json: cmd | |
request option, (error, response, body) => | |
console.log "POST #{APP_URL}" | |
if error? | |
console.log "error!!! #{error}" | |
else | |
console.log body |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var request = require("request"); | |
var HOST = process.argv[3] || "localhost"; | |
var URL = "http://" + HOST + ":9431/apps/"; | |
var APP_ID = "~browser"; | |
var APP_URL = URL + APP_ID; | |
var OPEN_URL = process.argv[2] || "http://gbraad.nl"; | |
var cmd = { | |
type: "launch", | |
app_info: { | |
url: OPEN_URL, | |
useIpc: false, | |
maxInactive: 0 | |
} | |
}; | |
var option = { | |
url: APP_URL, | |
method: "POST", | |
json: cmd | |
}; | |
request(option, function(error, response, body) { | |
console.log("POST " + APP_URL) | |
if(error) | |
console.log("error!!! " + error) | |
else | |
console.log(body) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment