Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
b33a766b7a |
21
app.js
21
app.js
|
@ -1,7 +1,8 @@
|
||||||
var url = require('url'),
|
var url = require('url'),
|
||||||
querystring = require('querystring'),
|
querystring = require('querystring'),
|
||||||
http = require('http'),
|
http = require('http'),
|
||||||
scraper = require('scraper');
|
scraper = require('scraper'),
|
||||||
|
refreshinterval = 10; // in seconds
|
||||||
|
|
||||||
var hotspots = {
|
var hotspots = {
|
||||||
cartel: {
|
cartel: {
|
||||||
|
@ -104,6 +105,20 @@ function mergeObjects (obj1, obj2) {
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Cool! I'll check the wifi every 10 seconds, just keep me running...");
|
// process command line arguments
|
||||||
setInterval(checkForRedirect, 10000);
|
process.argv.forEach(function (val, index, array) {
|
||||||
|
if(val == "-h" || val == "--help")
|
||||||
|
{
|
||||||
|
console.log("To change refresh interval: -t [number of seconds]\r\n\r\n");
|
||||||
|
}
|
||||||
|
if(val == "-t"){
|
||||||
|
if(process.argv[index+1] > 0) {
|
||||||
|
refreshinterval = process.argv[index+1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log("Cool! I'll check the wifi every "+refreshinterval+" seconds, just keep me running...");
|
||||||
|
setInterval(checkForRedirect, refreshinterval*1000);
|
||||||
checkForRedirect();
|
checkForRedirect();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user