initial commit

This commit is contained in:
Martin Donnelly 2015-08-04 15:07:01 +01:00
parent c8a28cc5c3
commit 0051330918
35 changed files with 3080 additions and 0 deletions

38
app.js Normal file
View File

@ -0,0 +1,38 @@
/*var app = require('express').createServer();
app.get('/', function(req, res) {
res.send('Hello from <a href="http://appfog.com">AppFog.com</a>');
});
app.listen(process.env.VCAP_APP_PORT || 3000);*/
var express = require('express'), path = require('path'), http = require('http');
var app = express();
app.configure(function() {
app.set('port', process.env.VCAP_APP_PORT || 3000);
app.use(express.logger('dev'));
/* 'default', 'short', 'tiny', 'dev' */
app.use(express.methodOverride());
app.use(express.bodyParser());
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
next();
});
app.use(app.router);
app.use(express.static(path.join(__dirname, 'www')));
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});
/**
* Routing handlers
*/
/**
* create the server
*/
http.createServer(app).listen(app.get('port'), function() {
console.log("Express server listening on port " + app.get('port'));
});

2
app/Robots.txt Normal file
View File

@ -0,0 +1,2 @@
User-Agent: *
Disallow: /

301
app/app.js Normal file
View File

@ -0,0 +1,301 @@
(function () {
var lastGBP = 0.0,
lastUSD = 0.0,
_fasttimer, _slowTimer, myBTC =3.49524333;
var lows = {
gbp: 0,
usd: 0
},
highs = {
gbp: 0,
usd: 0
};
var list = [{
title: '101B ends',
y: 2013,
m: 9,
d: 24,
add: 1001
},
{
title: 'Ends',
y: 2015,
m: 4,
d: 10
}];
var addDays = function (myDate, days) {
return new Date(myDate.getTime() + days * 24 * 60 * 60 * 1000);
};
var getDays = function (startdate, enddate) {
var r, s, e;
s = startdate.getTime();
e = enddate.getTime();
r = (e - s) / (24 * 60 * 60 * 1000);
return r;
};
var tick = function () {
var today = new Date();
var start101 = new Date();
var end101 = new Date();
var endContract = new Date();
var third = new Date();
start101.setFullYear(2013, 9, 24);
end101 = addDays(start101, 1001);
endContract.setFullYear(2015, 4, 10);
third.setFullYear(2013, 7, 25);
$('#one').text('101B ends: ' + Math.ceil(getDays(today,
end101)) + " days / " + Math.ceil(getDays(today,
end101) / 7) + " weeks");
$('#two').text('Ends: ' + Math.ceil(getDays(today,
endContract)) + " days / " + Math.ceil(getDays(today,
endContract) / 7) + " weeks");
$('#three').hide();
};
var get_weather = function () {
navigator.geolocation.getCurrentPosition(show_weather);
};
var show_weather = function (position) {
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
// let's show a map or do something interesting!
$.ajax({
type: 'GET',
url: 'https://api.forecast.io/forecast/0657dc0d81c037cbc89ca88e383b6bbf/' + latitude.toString() + ',' + longitude.toString(),
data: '',
dataType: 'jsonp',
timeout: 10000,
context: $('body'),
contentType: ('application/json'),
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'PUT, GET, POST, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type'
},
success: function (data) {
// console.log(data);
var calc = ((5.0 / 9.0 * (data.currently.temperature - 32)));
$('#weather').html(data.currently.summary + " " + parseInt(calc) + '&deg;c&nbsp;' + '<em>' + data.daily.summary + '</em>');
},
error: function (xhr, type) {
console.log("ajax error");
console.log(xhr);
console.log(type);
}
});
};
var updateBTC = function (g, u) {
var title, total, elm = $('#btc');
if (lastGBP !== 0) {
elm.removeClass();
if (g > lastGBP) {
elm.addClass('up');
} else if (g < lastGBP) {
elm.addClass('down');
}
} else {
lows.gbp = g;
lows.usd = u;
highs.gbp = g;
highs.usd = u;
}
lastGBP = g;
lastUSD = u;
if (g < lows.gbp) lows.gbp = g;
if (u < lows.usd) lows.usd = u;
if (highs.gbp < g) highs.gbp = g;
if (highs.usd < u) highs.usd = u;
total = myBTC * g;
title = "High: $" + parseFloat(highs.usd.toFixed(2)) + " / Low $" + parseFloat(lows.usd.toFixed(2));
elm.html("&#36;" + parseFloat(u.toFixed(2)) + " / &pound;" + parseFloat(g.toFixed(2)) + " (&pound;" + parseFloat(total.toFixed(2)) + ")");
elm.prop('title', title);
};
var updateFX = function (data) {
var title, total, elm = $('#fx');
//title = "High: $" + parseFloat(highs.usd.toFixed(2)) + " / Low $" + parseFloat(lows.usd.toFixed(2));
elm.html("&pound;1 = &#36;" + parseFloat(data.gpbe.toFixed(2)) + " = " + parseFloat(data.sekex.toFixed(2)) + " SEK");
// elm.prop('title', title);
};
var btcValue = function () {
var url = '/btc';
$.ajax({
type: 'GET',
url: url,
data: '',
dataType: 'json',
timeout: 10000,
//contentType: ('application/json'),
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'PUT, GET, POST, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type'
},
success: function (data) {
// console.log(data);
var gbp = data.bpi.GBP.rate_float,
usd = data.bpi.USD.rate_float;
updateBTC(gbp, usd);
},
error: function (xhr, type) {
console.log("ajax error");
console.log(xhr);
console.log(type);
}
});
};
var getFX = function () {
var url = '/fx';
$.ajax({
type: 'GET',
url: url,
data: '',
dataType: 'json',
timeout: 10000,
//contentType: ('application/json'),
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'PUT, GET, POST, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type'
},
success: function (data) {
//console.log(data);
var gpbex = (1 / data.rates.GBP);
var sekex = (gpbex * data.rates.SEK);
var fxdata = {
usd: 1,
gbp: data.rates.GBP,
sek: data.rates.SEK,
gpbe: gpbex,
sekex: sekex
};
// console.log(fxdata);
//var fxdata = data.bpi.GBP.rate_float, usd = data.bpi.USD.rate_float;
updateFX(fxdata);
},
error: function (xhr, type) {
console.log("ajax error");
console.log(xhr);
console.log(type);
}
});
};
var getDBEGLQ = function () {
var url = '/dbeglq';
$.ajax({
type: 'GET',
url: url,
data: '',
dataType: 'json',
timeout: 10000,
//contentType: ('application/json'),
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'PUT, GET, POST, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type'
},
success: function (data) {
console.log(data);
updateTrain('dbeglq',data);
//updateFX(fxdata);
},
error: function (xhr, type) {
console.log("ajax error");
console.log(xhr);
console.log(type);
}
});
};
var updateTrain = function (n, obj) {
var elm = $('#'+n);
var output, status;
output = (obj.eta == "On Time") ? obj.eta : obj.sta;
status = (obj.eta == "On Time") ? 'delayed' : 'ontime';
elm.html(output);
elm.prop('class', status);
};
tick();
get_weather();
btcValue();
getFX();
getDBEGLQ();
// start 15 minute timer
_fastTimer = setInterval(function () {
btcValue();
getDBEGLQ();
}, (60000));
_slowTimer = setInterval(function () {
getFX();
get_weather();
}, (60000 * 15));
})();
var popitout = function (url) {
newwindow = window.open(url, 'name', 'height=600,width=570');
if (window.focus) {
newwindow.focus()
}
return false;
};
var popitoutSmall = function (url) {
newwindow = window.open(url, 'name', 'height=400,width=520');
if (window.focus) {
newwindow.focus()
}
return false;
};

2
app/app.min.js vendored Normal file
View File

@ -0,0 +1,2 @@
!function(){var e,t=0,o=0,n=3.49524333,a={gbp:0,usd:0},s={gbp:0,usd:0},r=function(e,t){return new Date(e.getTime()+24*t*60*60*1e3)},c=function(e,t){var o,n,a;return n=e.getTime(),a=t.getTime(),o=(a-n)/864e5},l=function(){var e=new Date,t=new Date,o=new Date,n=new Date,a=new Date;t.setFullYear(2013,9,24),o=r(t,1001),n.setFullYear(2015,4,10),a.setFullYear(2013,7,25),$("#one").text("101B ends: "+Math.ceil(c(e,o))+" days / "+Math.ceil(c(e,o)/7)+" weeks"),$("#two").text("Ends: "+Math.ceil(c(e,n))+" days / "+Math.ceil(c(e,n)/7)+" weeks"),$("#three").hide()},p=function(){navigator.geolocation.getCurrentPosition(i)},i=function(e){var t=e.coords.latitude,o=e.coords.longitude;$.ajax({type:"GET",url:"https://api.forecast.io/forecast/0657dc0d81c037cbc89ca88e383b6bbf/"+t.toString()+","+o.toString(),data:"",dataType:"jsonp",timeout:1e4,context:$("body"),contentType:"application/json",headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"PUT, GET, POST, DELETE, OPTIONS","Access-Control-Allow-Headers":"Content-Type"},success:function(e){var t=5/9*(e.currently.temperature-32);$("#weather").html(e.currently.summary+" "+parseInt(t)+"&deg;c&nbsp;<em>"+e.daily.summary+"</em>")},error:function(e,t){console.log("ajax error"),console.log(e),console.log(t)}})},u=function(e,r){var c,l,p=$("#btc");0!==t?(p.removeClass(),e>t?p.addClass("up"):t>e&&p.addClass("down")):(a.gbp=e,a.usd=r,s.gbp=e,s.usd=r),t=e,o=r,e<a.gbp&&(a.gbp=e),r<a.usd&&(a.usd=r),s.gbp<e&&(s.gbp=e),s.usd<r&&(s.usd=r),l=n*e,c="High: $"+parseFloat(s.usd.toFixed(2))+" / Low $"+parseFloat(a.usd.toFixed(2)),p.html("&#36;"+parseFloat(r.toFixed(2))+" / &pound;"+parseFloat(e.toFixed(2))+" (&pound;"+parseFloat(l.toFixed(2))+")"),p.prop("title",c)},d=function(e){var t=$("#fx");t.html("&pound;1 = &#36;"+parseFloat(e.gpbe.toFixed(2))+" = "+parseFloat(e.sekex.toFixed(2))+" SEK")},h=function(){var e="/btc";$.ajax({type:"GET",url:e,data:"",dataType:"json",timeout:1e4,headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"PUT, GET, POST, DELETE, OPTIONS","Access-Control-Allow-Headers":"Content-Type"},success:function(e){var t=e.bpi.GBP.rate_float,o=e.bpi.USD.rate_float;u(t,o)},error:function(e,t){console.log("ajax error"),console.log(e),console.log(t)}})},g=function(){var e="/fx";$.ajax({type:"GET",url:e,data:"",dataType:"json",timeout:1e4,headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"PUT, GET, POST, DELETE, OPTIONS","Access-Control-Allow-Headers":"Content-Type"},success:function(e){var t=1/e.rates.GBP,o=t*e.rates.SEK,n={usd:1,gbp:e.rates.GBP,sek:e.rates.SEK,gpbe:t,sekex:o};d(n)},error:function(e,t){console.log("ajax error"),console.log(e),console.log(t)}})},f=function(){var e="/dbeglq";$.ajax({type:"GET",url:e,data:"",dataType:"json",timeout:1e4,headers:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"PUT, GET, POST, DELETE, OPTIONS","Access-Control-Allow-Headers":"Content-Type"},success:function(e){console.log(e),b("dbeglq",e)},error:function(e,t){console.log("ajax error"),console.log(e),console.log(t)}})},b=function(e,t){var o,n,a=$("#"+e);o="On Time"==t.eta?t.eta:t.sta,n="On Time"==t.eta?"delayed":"ontime",a.html(o),a.prop("class",n)};l(),p(),h(),g(),f(),_fastTimer=setInterval(function(){h(),f()},6e4),e=setInterval(function(){g(),p()},9e5)}();var popitout=function(e){return newwindow=window.open(e,"name","height=600,width=570"),window.focus&&newwindow.focus(),!1},popitoutSmall=function(e){return newwindow=window.open(e,"name","height=400,width=520"),window.focus&&newwindow.focus(),!1};
//# sourceMappingURL=app.min.js.map

1
app/app.min.js.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["app.js"],"names":["_slowTimer","lastGBP","lastUSD","myBTC","lows","gbp","usd","highs","addDays","myDate","days","Date","getTime","getDays","startdate","enddate","r","s","e","tick","today","start101","end101","endContract","third","setFullYear","$","text","Math","ceil","hide","get_weather","navigator","geolocation","getCurrentPosition","show_weather","position","latitude","coords","longitude","ajax","type","url","toString","data","dataType","timeout","context","contentType","headers","Access-Control-Allow-Origin","Access-Control-Allow-Methods","Access-Control-Allow-Headers","success","calc","currently","temperature","html","summary","parseInt","daily","error","xhr","console","log","updateBTC","g","u","title","total","elm","removeClass","addClass","parseFloat","toFixed","prop","updateFX","gpbe","sekex","btcValue","bpi","GBP","rate_float","USD","getFX","gpbex","rates","SEK","fxdata","sek","getDBEGLQ","updateTrain","n","obj","output","status","eta","sta","_fastTimer","setInterval","popitout","newwindow","window","open","focus","popitoutSmall"],"mappings":"CAAA,WAEI,GAEgBA,GAFZC,EAAU,EACVC,EAAU,EACcC,EAAO,WAC/BC,GACIC,IAAK,EACLC,IAAK,GAETC,GACIF,IAAK,EACLC,IAAK,GAiBTE,EAAU,SAAUC,EAAQC,GAC5B,MAAO,IAAIC,MAAKF,EAAOG,UAAmB,GAAPF,EAAY,GAAK,GAAK,MAGzDG,EAAU,SAAUC,EAAWC,GAC/B,GAAIC,GAAGC,EAAGC,CAIV,OAHAD,GAAIH,EAAUF,UACdM,EAAIH,EAAQH,UACZI,GAAKE,EAAID,GAAK,OAGdE,EAAO,WACP,GAAIC,GAAQ,GAAIT,MACZU,EAAW,GAAIV,MACfW,EAAS,GAAIX,MACbY,EAAc,GAAIZ,MAClBa,EAAQ,GAAIb,KAChBU,GAASI,YAAY,KAAM,EAAG,IAC9BH,EAASd,EAAQa,EAAU,MAC3BE,EAAYE,YAAY,KAAM,EAAG,IACjCD,EAAMC,YAAY,KAAM,EAAG,IAC3BC,EAAE,QAAQC,KAAK,cAAgBC,KAAKC,KAAKhB,EAAQO,EAC7CE,IAAW,WAAaM,KAAKC,KAAKhB,EAAQO,EAC1CE,GAAU,GAAK,UACnBI,EAAE,QAAQC,KAAK,SAAWC,KAAKC,KAAKhB,EAAQO,EACxCG,IAAgB,WAAaK,KAAKC,KAAKhB,EAAQO,EAC/CG,GAAe,GAAK,UACxBG,EAAE,UAAUI,QAGZC,EAAc,WACdC,UAAUC,YAAYC,mBAAmBC,IAEzCA,EAAe,SAAUC,GACzB,GAAIC,GAAWD,EAASE,OAAOD,SAC3BE,EAAYH,EAASE,OAAOC,SAEhCb,GAAEc,MACEC,KAAM,MACNC,IAAK,qEAAuEL,EAASM,WAAa,IAAMJ,EAAUI,WAClHC,KAAM,GACNC,SAAU,QACVC,QAAS,IACTC,QAASrB,EAAE,QACXsB,YAAa,mBACbC,SACIC,8BAA+B,IAC/BC,+BAAgC,kCAChCC,+BAAgC,gBAGpCC,QAAS,SAAUT,GAGf,GAAIU,GAAS,EAAM,GAAOV,EAAKW,UAAUC,YAAc,GACvD9B,GAAE,YAAY+B,KAAKb,EAAKW,UAAUG,QAAU,IAAMC,SAASL,GAAQ,mBAA0BV,EAAKgB,MAAMF,QAAU,UAGtHG,MAAO,SAAUC,EAAKrB,GAClBsB,QAAQC,IAAI,cACZD,QAAQC,IAAIF,GACZC,QAAQC,IAAIvB,OAKpBwB,EAAY,SAAUC,EAAGC,GACzB,GAAIC,GAAOC,EAAOC,EAAM5C,EAAE,OACV,KAAZzB,GAEAqE,EAAIC,cACAL,EAAIjE,EACJqE,EAAIE,SAAS,MACFvE,EAAJiE,GACPI,EAAIE,SAAS,UAIjBpE,EAAKC,IAAM6D,EACX9D,EAAKE,IAAM6D,EAEX5D,EAAMF,IAAM6D,EACZ3D,EAAMD,IAAM6D,GAGhBlE,EAAUiE,EACVhE,EAAUiE,EAEND,EAAI9D,EAAKC,MAAKD,EAAKC,IAAM6D,GACzBC,EAAI/D,EAAKE,MAAKF,EAAKE,IAAM6D,GAEzB5D,EAAMF,IAAM6D,IAAG3D,EAAMF,IAAM6D,GAC3B3D,EAAMD,IAAM6D,IAAG5D,EAAMD,IAAM6D,GAE/BE,EAAQlE,EAAQ+D,EAEhBE,EAAQ,UAAYK,WAAWlE,EAAMD,IAAIoE,QAAQ,IAAM,WAAaD,WAAWrE,EAAKE,IAAIoE,QAAQ,IAChGJ,EAAIb,KAAK,QAAUgB,WAAWN,EAAEO,QAAQ,IAAM,aAAeD,WAAWP,EAAEQ,QAAQ,IAAM,YAAcD,WAAWJ,EAAMK,QAAQ,IAAM,KAErIJ,EAAIK,KAAK,QAASP,IAIlBQ,EAAW,SAAUhC,GACrB,GAAkB0B,GAAM5C,EAAE,MAE1B4C,GAAIb,KAAK,mBAAqBgB,WAAW7B,EAAKiC,KAAKH,QAAQ,IAAM,MAAQD,WAAW7B,EAAKkC,MAAMJ,QAAQ,IAAM,SAM7GK,EAAW,WACX,GAAIrC,GAAM,MAEVhB,GAAEc,MACEC,KAAM,MACNC,IAAKA,EACLE,KAAM,GACNC,SAAU,OAEVC,QAAS,IAGTG,SACIC,8BAA+B,IAC/BC,+BAAgC,kCAChCC,+BAAgC,gBAGpCC,QAAS,SAAUT,GAEf,GAAIvC,GAAMuC,EAAKoC,IAAIC,IAAIC,WACnB5E,EAAMsC,EAAKoC,IAAIG,IAAID,UAEvBjB,GAAU5D,EAAKC,IAEnBuD,MAAO,SAAUC,EAAKrB,GAClBsB,QAAQC,IAAI,cACZD,QAAQC,IAAIF,GACZC,QAAQC,IAAIvB,OAMpB2C,EAAQ,WACR,GAAI1C,GAAM,KAEVhB,GAAEc,MACEC,KAAM,MACNC,IAAKA,EACLE,KAAM,GACNC,SAAU,OAEVC,QAAS,IAGTG,SACIC,8BAA+B,IAC/BC,+BAAgC,kCAChCC,+BAAgC,gBAGpCC,QAAS,SAAUT,GAEf,GAAIyC,GAAS,EAAIzC,EAAK0C,MAAML,IACxBH,EAASO,EAAQzC,EAAK0C,MAAMC,IAC5BC,GACAlF,IAAK,EACLD,IAAKuC,EAAK0C,MAAML,IAChBQ,IAAK7C,EAAK0C,MAAMC,IAChBV,KAAMQ,EACNP,MAAOA,EAKXF,GAASY,IAEb3B,MAAO,SAAUC,EAAKrB,GAClBsB,QAAQC,IAAI,cACZD,QAAQC,IAAIF,GACZC,QAAQC,IAAIvB,OAMpBiD,EAAY,WAEZ,GAAIhD,GAAM,SAEVhB,GAAEc,MACEC,KAAM,MACNC,IAAKA,EACLE,KAAM,GACNC,SAAU,OAEVC,QAAS,IAGTG,SACIC,8BAA+B,IAC/BC,+BAAgC,kCAChCC,+BAAgC,gBAGpCC,QAAS,SAAUT,GACfmB,QAAQC,IAAIpB,GAEZ+C,EAAY,SAAS/C,IAGzBiB,MAAO,SAAUC,EAAKrB,GAClBsB,QAAQC,IAAI,cACZD,QAAQC,IAAIF,GACZC,QAAQC,IAAIvB,OAKpBkD,EAAc,SAAUC,EAAGC,GAC3B,GAEIC,GAAQC,EAFPzB,EAAM5C,EAAE,IAAIkE,EAKjBE,GAAqB,WAAXD,EAAIG,IAAoBH,EAAIG,IAAMH,EAAII,IAChDF,EAAqB,WAAXF,EAAIG,IAAoB,UAAY,SAE9C1B,EAAIb,KAAKqC,GAETxB,EAAIK,KAAK,QAASoB,GAItB5E,KACAY,IACAgD,IACAK,IACAM,IAIAQ,WAAaC,YAAY,WACrBpB,IACAW,KACD,KAEH1F,EAAamG,YAAY,WAErBf,IACArD,KACD,OAIP,IAAIqE,UAAW,SAAU1D,GAKrB,MAJA2D,WAAYC,OAAOC,KAAK7D,EAAK,OAAQ,wBACjC4D,OAAOE,OACPH,UAAUG,SAEP,GAGPC,cAAgB,SAAU/D,GAK1B,MAJA2D,WAAYC,OAAOC,KAAK7D,EAAK,OAAQ,wBACjC4D,OAAOE,OACPH,UAAUG,SAEP"}

7
app/coins.js Normal file
View File

@ -0,0 +1,7 @@
/**
* Created by martind on 14/11/14.
*/
var coins = {
bought:
}

BIN
app/gfx/popout.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

12
app/index.html Normal file
View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>Silvrtree</title>
<meta charset="UTF-8">
<meta name="description" content="" />
<meta name="keywords" content="" />
</head>
<body>
silvrtree
</body>
</html>

505
app/libs/ejs.js Normal file
View File

@ -0,0 +1,505 @@
(function(){
var rsplit = function(string, regex) {
var result = regex.exec(string),retArr = new Array(), first_idx, last_idx, first_bit;
while (result != null)
{
first_idx = result.index; last_idx = regex.lastIndex;
if ((first_idx) != 0)
{
first_bit = string.substring(0,first_idx);
retArr.push(string.substring(0,first_idx));
string = string.slice(first_idx);
}
retArr.push(result[0]);
string = string.slice(result[0].length);
result = regex.exec(string);
}
if (! string == '')
{
retArr.push(string);
}
return retArr;
},
chop = function(string){
return string.substr(0, string.length - 1);
},
extend = function(d, s){
for(var n in s){
if(s.hasOwnProperty(n)) d[n] = s[n]
}
}
EJS = function( options ){
options = typeof options == "string" ? {view: options} : options
this.set_options(options);
if(options.precompiled){
this.template = {};
this.template.process = options.precompiled;
EJS.update(this.name, this);
return;
}
if(options.element)
{
if(typeof options.element == 'string'){
var name = options.element
options.element = document.getElementById( options.element )
if(options.element == null) throw name+'does not exist!'
}
if(options.element.value){
this.text = options.element.value
}else{
this.text = options.element.innerHTML
}
this.name = options.element.id
this.type = '['
}else if(options.url){
options.url = EJS.endExt(options.url, this.extMatch);
this.name = this.name ? this.name : options.url;
var url = options.url
//options.view = options.absolute_url || options.view || options.;
var template = EJS.get(this.name /*url*/, this.cache);
if (template) return template;
if (template == EJS.INVALID_PATH) return null;
try{
this.text = EJS.request( url+(this.cache ? '' : '?'+Math.random() ));
}catch(e){}
if(this.text == null){
throw( {type: 'EJS', message: 'There is no template at '+url} );
}
//this.name = url;
}
var template = new EJS.Compiler(this.text, this.type);
template.compile(options, this.name);
EJS.update(this.name, this);
this.template = template;
};
/* @Prototype*/
EJS.prototype = {
/**
* Renders an object with extra view helpers attached to the view.
* @param {Object} object data to be rendered
* @param {Object} extra_helpers an object with additonal view helpers
* @return {String} returns the result of the string
*/
render : function(object, extra_helpers){
object = object || {};
this._extra_helpers = extra_helpers;
var v = new EJS.Helpers(object, extra_helpers || {});
return this.template.process.call(object, object,v);
},
update : function(element, options){
if(typeof element == 'string'){
element = document.getElementById(element)
}
if(options == null){
_template = this;
return function(object){
EJS.prototype.update.call(_template, element, object)
}
}
if(typeof options == 'string'){
params = {}
params.url = options
_template = this;
params.onComplete = function(request){
var object = eval( request.responseText )
EJS.prototype.update.call(_template, element, object)
}
EJS.ajax_request(params)
}else
{
element.innerHTML = this.render(options)
}
},
out : function(){
return this.template.out;
},
/**
* Sets options on this view to be rendered with.
* @param {Object} options
*/
set_options : function(options){
this.type = options.type || EJS.type;
this.cache = options.cache != null ? options.cache : EJS.cache;
this.text = options.text || null;
this.name = options.name || null;
this.ext = options.ext || EJS.ext;
this.extMatch = new RegExp(this.ext.replace(/\./, '\.'));
}
};
EJS.endExt = function(path, match){
if(!path) return null;
match.lastIndex = 0
return path+ (match.test(path) ? '' : this.ext )
}
/* @Static*/
EJS.Scanner = function(source, left, right) {
extend(this,
{left_delimiter: left +'%',
right_delimiter: '%'+right,
double_left: left+'%%',
double_right: '%%'+right,
left_equal: left+'%=',
left_comment: left+'%#'})
this.SplitRegexp = left=='[' ? /(\[%%)|(%%\])|(\[%=)|(\[%#)|(\[%)|(%\]\n)|(%\])|(\n)/ : new RegExp('('+this.double_left+')|(%%'+this.double_right+')|('+this.left_equal+')|('+this.left_comment+')|('+this.left_delimiter+')|('+this.right_delimiter+'\n)|('+this.right_delimiter+')|(\n)') ;
this.source = source;
this.stag = null;
this.lines = 0;
};
EJS.Scanner.to_text = function(input){
if(input == null || input === undefined)
return '';
if(input instanceof Date)
return input.toDateString();
if(input.toString)
return input.toString();
return '';
};
EJS.Scanner.prototype = {
scan: function(block) {
scanline = this.scanline;
regex = this.SplitRegexp;
if (! this.source == '')
{
var source_split = rsplit(this.source, /\n/);
for(var i=0; i<source_split.length; i++) {
var item = source_split[i];
this.scanline(item, regex, block);
}
}
},
scanline: function(line, regex, block) {
this.lines++;
var line_split = rsplit(line, regex);
for(var i=0; i<line_split.length; i++) {
var token = line_split[i];
if (token != null) {
try{
block(token, this);
}catch(e){
throw {type: 'EJS.Scanner', line: this.lines};
}
}
}
}
};
EJS.Buffer = function(pre_cmd, post_cmd) {
this.line = new Array();
this.script = "";
this.pre_cmd = pre_cmd;
this.post_cmd = post_cmd;
for (var i=0; i<this.pre_cmd.length; i++)
{
this.push(pre_cmd[i]);
}
};
EJS.Buffer.prototype = {
push: function(cmd) {
this.line.push(cmd);
},
cr: function() {
this.script = this.script + this.line.join('; ');
this.line = new Array();
this.script = this.script + "\n";
},
close: function() {
if (this.line.length > 0)
{
for (var i=0; i<this.post_cmd.length; i++){
this.push(pre_cmd[i]);
}
this.script = this.script + this.line.join('; ');
line = null;
}
}
};
EJS.Compiler = function(source, left) {
this.pre_cmd = ['var ___ViewO = [];'];
this.post_cmd = new Array();
this.source = ' ';
if (source != null)
{
if (typeof source == 'string')
{
source = source.replace(/\r\n/g, "\n");
source = source.replace(/\r/g, "\n");
this.source = source;
}else if (source.innerHTML){
this.source = source.innerHTML;
}
if (typeof this.source != 'string'){
this.source = "";
}
}
left = left || '<';
var right = '>';
switch(left) {
case '[':
right = ']';
break;
case '<':
break;
default:
throw left+' is not a supported deliminator';
break;
}
this.scanner = new EJS.Scanner(this.source, left, right);
this.out = '';
};
EJS.Compiler.prototype = {
compile: function(options, name) {
options = options || {};
this.out = '';
var put_cmd = "___ViewO.push(";
var insert_cmd = put_cmd;
var buff = new EJS.Buffer(this.pre_cmd, this.post_cmd);
var content = '';
var clean = function(content)
{
content = content.replace(/\\/g, '\\\\');
content = content.replace(/\n/g, '\\n');
content = content.replace(/"/g, '\\"');
return content;
};
this.scanner.scan(function(token, scanner) {
if (scanner.stag == null)
{
switch(token) {
case '\n':
content = content + "\n";
buff.push(put_cmd + '"' + clean(content) + '");');
buff.cr();
content = '';
break;
case scanner.left_delimiter:
case scanner.left_equal:
case scanner.left_comment:
scanner.stag = token;
if (content.length > 0)
{
buff.push(put_cmd + '"' + clean(content) + '")');
}
content = '';
break;
case scanner.double_left:
content = content + scanner.left_delimiter;
break;
default:
content = content + token;
break;
}
}
else {
switch(token) {
case scanner.right_delimiter:
switch(scanner.stag) {
case scanner.left_delimiter:
if (content[content.length - 1] == '\n')
{
content = chop(content);
buff.push(content);
buff.cr();
}
else {
buff.push(content);
}
break;
case scanner.left_equal:
buff.push(insert_cmd + "(EJS.Scanner.to_text(" + content + ")))");
break;
}
scanner.stag = null;
content = '';
break;
case scanner.double_right:
content = content + scanner.right_delimiter;
break;
default:
content = content + token;
break;
}
}
});
if (content.length > 0)
{
// Chould be content.dump in Ruby
buff.push(put_cmd + '"' + clean(content) + '")');
}
buff.close();
this.out = buff.script + ";";
var to_be_evaled = '/*'+name+'*/this.process = function(_CONTEXT,_VIEW) { try { with(_VIEW) { with (_CONTEXT) {'+this.out+" return ___ViewO.join('');}}}catch(e){e.lineNumber=null;throw e;}};";
try{
eval(to_be_evaled);
}catch(e){
if(typeof JSLINT != 'undefined'){
JSLINT(this.out);
for(var i = 0; i < JSLINT.errors.length; i++){
var error = JSLINT.errors[i];
if(error.reason != "Unnecessary semicolon."){
error.line++;
var e = new Error();
e.lineNumber = error.line;
e.message = error.reason;
if(options.view)
e.fileName = options.view;
throw e;
}
}
}else{
throw e;
}
}
}
};
//type, cache, folder
/**
* Sets default options for all views
* @param {Object} options Set view with the following options
* <table class="options">
<tbody><tr><th>Option</th><th>Default</th><th>Description</th></tr>
<tr>
<td>type</td>
<td>'<'</td>
<td>type of magic tags. Options are '&lt;' or '['
</td>
</tr>
<tr>
<td>cache</td>
<td>true in production mode, false in other modes</td>
<td>true to cache template.
</td>
</tr>
</tbody></table>
*
*/
EJS.config = function(options){
EJS.cache = options.cache != null ? options.cache : EJS.cache;
EJS.type = options.type != null ? options.type : EJS.type;
EJS.ext = options.ext != null ? options.ext : EJS.ext;
var templates_directory = EJS.templates_directory || {}; //nice and private container
EJS.templates_directory = templates_directory;
EJS.get = function(path, cache){
if(cache == false) return null;
if(templates_directory[path]) return templates_directory[path];
return null;
};
EJS.update = function(path, template) {
if(path == null) return;
templates_directory[path] = template ;
};
EJS.INVALID_PATH = -1;
};
EJS.config( {cache: true, type: '<', ext: '.ejs' } );
/**
* @constructor
* By adding functions to EJS.Helpers.prototype, those functions will be available in the
* views.
* @init Creates a view helper. This function is called internally. You should never call it.
* @param {Object} data The data passed to the view. Helpers have access to it through this._data
*/
EJS.Helpers = function(data, extras){
this._data = data;
this._extras = extras;
extend(this, extras );
};
/* @prototype*/
EJS.Helpers.prototype = {
/**
* Renders a new view. If data is passed in, uses that to render the view.
* @param {Object} options standard options passed to a new view.
* @param {optional:Object} data
* @return {String}
*/
view: function(options, data, helpers){
if(!helpers) helpers = this._extras
if(!data) data = this._data;
return new EJS(options).render(data, helpers);
},
/**
* For a given value, tries to create a human representation.
* @param {Object} input the value being converted.
* @param {Object} null_text what text should be present if input == null or undefined, defaults to ''
* @return {String}
*/
to_text: function(input, null_text) {
if(input == null || input === undefined) return null_text || '';
if(input instanceof Date) return input.toDateString();
if(input.toString) return input.toString().replace(/\n/g, '<br />').replace(/''/g, "'");
return '';
}
};
EJS.newRequest = function(){
var factories = [function() { return new ActiveXObject("Msxml2.XMLHTTP"); },function() { return new XMLHttpRequest(); },function() { return new ActiveXObject("Microsoft.XMLHTTP"); }];
for(var i = 0; i < factories.length; i++) {
try {
var request = factories[i]();
if (request != null) return request;
}
catch(e) { continue;}
}
}
EJS.request = function(path){
var request = new EJS.newRequest()
request.open("GET", path, false);
try{request.send(null);}
catch(e){return null;}
if ( request.status == 404 || request.status == 2 ||(request.status == 0 && request.responseText == '') ) return null;
return request.responseText
}
EJS.ajax_request = function(params){
params.method = ( params.method ? params.method : 'GET')
var request = new EJS.newRequest();
request.onreadystatechange = function(){
if(request.readyState == 4){
if(request.status == 200){
params.onComplete(request)
}else
{
params.onComplete(request)
}
}
}
request.open(params.method, params.url)
request.send(null)
}
})();

File diff suppressed because one or more lines are too long

200
app/libs/view.js Normal file
View File

@ -0,0 +1,200 @@
EJS.Helpers.prototype.date_tag = function(name, value , html_options) {
if(! (value instanceof Date))
value = new Date()
var month_names = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var years = [], months = [], days =[];
var year = value.getFullYear();
var month = value.getMonth();
var day = value.getDate();
for(var y = year - 15; y < year+15 ; y++)
{
years.push({value: y, text: y})
}
for(var m = 0; m < 12; m++)
{
months.push({value: (m), text: month_names[m]})
}
for(var d = 0; d < 31; d++)
{
days.push({value: (d+1), text: (d+1)})
}
var year_select = this.select_tag(name+'[year]', year, years, {id: name+'[year]'} )
var month_select = this.select_tag(name+'[month]', month, months, {id: name+'[month]'})
var day_select = this.select_tag(name+'[day]', day, days, {id: name+'[day]'})
return year_select+month_select+day_select;
}
EJS.Helpers.prototype.form_tag = function(action, html_options) {
html_options = html_options || {};
html_options.action = action
if(html_options.multipart == true) {
html_options.method = 'post';
html_options.enctype = 'multipart/form-data';
}
return this.start_tag_for('form', html_options)
}
EJS.Helpers.prototype.form_tag_end = function() { return this.tag_end('form'); }
EJS.Helpers.prototype.hidden_field_tag = function(name, value, html_options) {
return this.input_field_tag(name, value, 'hidden', html_options);
}
EJS.Helpers.prototype.input_field_tag = function(name, value , inputType, html_options) {
html_options = html_options || {};
html_options.id = html_options.id || name;
html_options.value = value || '';
html_options.type = inputType || 'text';
html_options.name = name;
return this.single_tag_for('input', html_options)
}
EJS.Helpers.prototype.is_current_page = function(url) {
return (window.location.href == url || window.location.pathname == url ? true : false);
}
EJS.Helpers.prototype.link_to = function(name, url, html_options) {
if(!name) var name = 'null';
if(!html_options) var html_options = {}
if(html_options.confirm){
html_options.onclick =
" var ret_confirm = confirm(\""+html_options.confirm+"\"); if(!ret_confirm){ return false;} "
html_options.confirm = null;
}
html_options.href=url
return this.start_tag_for('a', html_options)+name+ this.tag_end('a');
}
EJS.Helpers.prototype.submit_link_to = function(name, url, html_options){
if(!name) var name = 'null';
if(!html_options) var html_options = {}
html_options.onclick = html_options.onclick || '' ;
if(html_options.confirm){
html_options.onclick =
" var ret_confirm = confirm(\""+html_options.confirm+"\"); if(!ret_confirm){ return false;} "
html_options.confirm = null;
}
html_options.value = name;
html_options.type = 'submit'
html_options.onclick=html_options.onclick+
(url ? this.url_for(url) : '')+'return false;';
//html_options.href='#'+(options ? Routes.url_for(options) : '')
return this.start_tag_for('input', html_options)
}
EJS.Helpers.prototype.link_to_if = function(condition, name, url, html_options, post, block) {
return this.link_to_unless((condition == false), name, url, html_options, post, block);
}
EJS.Helpers.prototype.link_to_unless = function(condition, name, url, html_options, block) {
html_options = html_options || {};
if(condition) {
if(block && typeof block == 'function') {
return block(name, url, html_options, block);
} else {
return name;
}
} else
return this.link_to(name, url, html_options);
}
EJS.Helpers.prototype.link_to_unless_current = function(name, url, html_options, block) {
html_options = html_options || {};
return this.link_to_unless(this.is_current_page(url), name, url, html_options, block)
}
EJS.Helpers.prototype.password_field_tag = function(name, value, html_options) { return this.input_field_tag(name, value, 'password', html_options); }
EJS.Helpers.prototype.select_tag = function(name, value, choices, html_options) {
html_options = html_options || {};
html_options.id = html_options.id || name;
html_options.value = value;
html_options.name = name;
var txt = ''
txt += this.start_tag_for('select', html_options)
for(var i = 0; i < choices.length; i++)
{
var choice = choices[i];
var optionOptions = {value: choice.value}
if(choice.value == value)
optionOptions.selected ='selected'
txt += this.start_tag_for('option', optionOptions )+choice.text+this.tag_end('option')
}
txt += this.tag_end('select');
return txt;
}
EJS.Helpers.prototype.single_tag_for = function(tag, html_options) { return this.tag(tag, html_options, '/>');}
EJS.Helpers.prototype.start_tag_for = function(tag, html_options) { return this.tag(tag, html_options); }
EJS.Helpers.prototype.submit_tag = function(name, html_options) {
html_options = html_options || {};
//html_options.name = html_options.id || 'commit';
html_options.type = html_options.type || 'submit';
html_options.value = name || 'Submit';
return this.single_tag_for('input', html_options);
}
EJS.Helpers.prototype.tag = function(tag, html_options, end) {
if(!end) var end = '>'
var txt = ' '
for(var attr in html_options) {
if(html_options[attr] != null)
var value = html_options[attr].toString();
else
var value=''
if(attr == "Class") // special case because "class" is a reserved word in IE
attr = "class";
if( value.indexOf("'") != -1 )
txt += attr+'=\"'+value+'\" '
else
txt += attr+"='"+value+"' "
}
return '<'+tag+txt+end;
}
EJS.Helpers.prototype.tag_end = function(tag) { return '</'+tag+'>'; }
EJS.Helpers.prototype.text_area_tag = function(name, value, html_options) {
html_options = html_options || {};
html_options.id = html_options.id || name;
html_options.name = html_options.name || name;
value = value || ''
if(html_options.size) {
html_options.cols = html_options.size.split('x')[0]
html_options.rows = html_options.size.split('x')[1];
delete html_options.size
}
html_options.cols = html_options.cols || 50;
html_options.rows = html_options.rows || 4;
return this.start_tag_for('textarea', html_options)+value+this.tag_end('textarea')
}
EJS.Helpers.prototype.text_tag = EJS.Helpers.prototype.text_area_tag
EJS.Helpers.prototype.text_field_tag = function(name, value, html_options) { return this.input_field_tag(name, value, 'text', html_options); }
EJS.Helpers.prototype.url_for = function(url) {
return 'window.location="'+url+'";'
}
EJS.Helpers.prototype.img_tag = function(image_location, alt, options){
options = options || {};
options.src = image_location
options.alt = alt
return this.single_tag_for('img', options)
}

184
app/lot.csv Normal file
View File

@ -0,0 +1,184 @@
14-Nov-2014,36,32,38,48,17,8,5
11-Nov-2014,46,14,36,2,21,11,7
07-Nov-2014,32,13,38,46,25,10,1
04-Nov-2014,1,13,6,26,17,3,5
31-Oct-2014,10,41,13,20,33,9,3
28-Oct-2014,45,17,40,10,15,1,2
24-Oct-2014,42,20,3,30,9,6,1
21-Oct-2014,40,33,27,20,21,3,10
17-Oct-2014,49,13,48,1,40,8,10
14-Oct-2014,15,23,32,4,5,7,3
10-Oct-2014,29,42,47,45,6,9,10
07-Oct-2014,38,30,21,9,28,8,1
03-Oct-2014,13,23,50,48,4,10,5
30-Sep-2014,33,13,15,3,42,5,7
26-Sep-2014,46,35,47,13,27,1,2
23-Sep-2014,13,35,14,29,12,1,7
19-Sep-2014,6,34,8,38,48,9,3
16-Sep-2014,4,30,35,50,29,4,2
12-Sep-2014,31,9,33,26,13,7,11
09-Sep-2014,15,35,19,8,24,10,8
05-Sep-2014,18,50,23,46,1,9,3
02-Sep-2014,39,45,25,31,5,8,1
29-Aug-2014,32,38,26,9,2,3,6
26-Aug-2014,36,48,45,10,22,11,4
22-Aug-2014,29,17,49,35,4,1,2
19-Aug-2014,11,34,47,4,7,7,8
15-Aug-2014,4,21,30,5,23,10,8
12-Aug-2014,22,19,7,16,33,5,2
08-Aug-2014,29,21,35,46,43,1,9
05-Aug-2014,5,21,42,7,19,11,5
01-Aug-2014,50,44,46,48,24,10,5
29-Jul-2014,40,23,35,10,43,9,3
25-Jul-2014,10,24,9,12,43,5,9
22-Jul-2014,1,43,50,45,24,5,8
18-Jul-2014,1,41,43,11,29,3,11
15-Jul-2014,18,27,15,34,20,1,3
11-Jul-2014,38,35,5,49,22,7,4
08-Jul-2014,24,18,22,8,27,11,4
04-Jul-2014,47,18,43,39,4,6,2
01-Jul-2014,39,25,18,22,27,5,10
27-Jun-2014,39,34,45,33,31,2,10
24-Jun-2014,20,1,7,21,48,4,7
20-Jun-2014,5,38,49,15,25,1,2
17-Jun-2014,48,13,37,40,11,8,9
13-Jun-2014,16,22,28,46,18,11,9
10-Jun-2014,12,18,21,33,32,1,11
06-Jun-2014,34,40,25,7,49,9,11
03-Jun-2014,2,39,32,15,44,5,10
30-May-2014,27,41,24,45,5,7,6
27-May-2014,16,13,26,25,7,1,6
23-May-2014,31,3,47,8,34,11,9
'20-May-2014', 5, 33, 36, 38, 47, 4, 9
'16-May-2014', 23, 26, 29, 37, 40, 3, 4
'13-May-2014', 4, 13, 30, 34, 47, 2, 6
'09-May-2014', 3, 21, 26, 28, 45, 7, 10
'06-May-2014', 5, 19, 24, 31, 37, 1, 9
'02-May-2014', 4, 30, 31, 38, 42, 2, 11
'29-Apr-2014', 18, 23, 26, 35, 44, 3, 11
'25-Apr-2014', 13, 21, 24, 44, 49, 1, 9
'22-Apr-2014', 13, 15, 20, 24, 46, 1, 8
'18-Apr-2014', 21, 24, 31, 39, 47, 3, 7
'15-Apr-2014', 3, 14, 26, 47, 50, 7, 11
'11-Apr-2014', 8, 12, 19, 30, 33, 4, 11
'08-Apr-2014', 11, 18, 29, 42, 49, 4, 11
'04-Apr-2014', 6, 10, 28, 45, 50, 10, 11
'01-Apr-2014', 16, 18, 26, 38, 44, 8, 10
'28-Mar-2014', 3, 4, 19, 28, 43, 3, 7
'25-Mar-2014', 7, 20, 26, 28, 50, 2, 8
'21-Mar-2014', 7, 30, 37, 39, 42, 5, 7
'18-Mar-2014', 8, 27, 34, 36, 39, 5, 10
'14-Mar-2014', 6, 24, 25, 27, 30, 5, 9
'11-Mar-2014', 1, 4, 23, 33, 44, 7, 8
'07-Mar-2014', 5, 10, 38, 40, 41, 1, 8
'04-Mar-2014', 3, 5, 22, 27, 44, 1, 6
'28-Feb-2014', 12, 32, 38, 43, 44, 2, 7
'25-Feb-2014', 21, 25, 28, 35, 42, 4, 6
'21-Feb-2014', 13, 17, 28, 30, 32, 5, 7
'18-Feb-2014', 23, 26, 36, 37, 49, 6, 7
'14-Feb-2014', 19, 39, 4, 2, 6, 2, 7
'11-Feb-2014', 47, 25, 8, 17, 41, 1, 2
'07-Feb-2014', 17, 19, 47, 3, 46, 9, 10
'04-Feb-2014', 37, 1, 33, 21, 38, 8, 4
'31-Jan-2014', 10, 15, 31, 8, 16, 8, 9
'28-Jan-2014', 18, 23, 48, 20, 42, 2, 9
'24-Jan-2014', 19, 41, 35, 34, 5, 1, 5
'21-Jan-2014', 4, 42, 35, 48, 12, 5, 8
'17-Jan-2014', 26, 19, 33, 42, 32, 10, 4
'14-Jan-2014', 25, 18, 20, 26, 37, 11, 10
'10-Jan-2014', 1, 27, 2, 11, 29, 10, 1
'07-Jan-2014', 2, 45, 20, 27, 33, 6, 10
'03-Jan-2014', 3, 44, 27, 38, 31, 3, 8
'31-Dec-2013', 29, 45, 24, 20, 13, 7, 3
'27-Dec-2013', 1, 22, 6, 13, 28, 10, 5
'24-Dec-2013', 5, 31, 43, 50, 19, 6, 2
'20-Dec-2013', 13, 22, 17, 43, 12, 10, 3
'17-Dec-2013', 41, 6, 8, 37, 27, 7, 10
'13-Dec-2013', 24, 22, 23, 1, 31, 6, 11
'10-Dec-2013', 49, 50, 24, 6, 35, 7, 1
'06-Dec-2013', 18, 31, 36, 2, 1, 7, 10
'03-Dec-2013', 32, 6, 29, 15, 13, 2, 9
'29-Nov-2013', 2, 7, 10, 23, 43, 4, 7
'26-Nov-2013', 19, 23, 27, 42, 44, 3, 5
'22-Nov-2013', 13, 25, 26, 40, 50, 8, 9
'19-Nov-2013', 14, 15, 19, 36, 45, 1, 10
'15-Nov-2013', 3, 13, 15, 29, 42, 1, 4
'12-Nov-2013', 14, 29, 37, 40, 48, 2, 11
'08-Nov-2013', 20, 28, 35, 42, 43, 8, 10
'05-Nov-2013', 6, 12, 13, 35, 38, 2, 3
'01-Nov-2013', 7, 19, 29, 30, 33, 3, 8
'29-Oct-2013', 9, 10, 30, 32, 37, 2, 6
'25-Oct-2013', 2, 3, 10, 31, 38, 6, 10
'22-Oct-2013', 29, 33, 39, 41, 44, 9, 11
'18-Oct-2013', 5, 25, 36, 46, 47, 2, 6
'15-Sep-2013', 18, 27, 39, 43, 47, 4, 7
'11-Oct-2013', 6, 12, 17, 23, 43, 5, 9
'08-Oct-2013', 23, 24, 26, 33, 42, 3, 5
'04-Oct-2013', 6, 20, 24, 35, 50, 5, 10
'01-Oct-2013', 19, 23, 25, 44, 48, 8, 9
'27-Sep-2013', 11, 15, 38, 41, 43, 2, 6
'24-Sep-2013', 10, 20, 26, 28, 43, 9, 11
'20-Sep-2013', 5, 11, 35, 38, 45, 2, 3
'17-Sep-2013', 13, 17, 21, 42, 44, 9, 11
'13-Sep-2013', 4, 6, 14, 27, 33, 5, 10
'10-Sep-2013', 7, 11, 14, 28, 30, 2, 10
'06-Sep-2013', 11, 23, 25, 32, 37, 4, 7
'03-Sep-2013', 5, 9, 16, 18, 42, 7, 9
'30-Aug-2013', 2, 17, 25, 36, 45, 5, 9
'27-Aug-2013', 7, 30, 38, 40, 43, 2, 6
'23-Aug-2013', 1, 6, 26, 30, 37, 5, 8
'20-Aug-2013', 5, 11, 42, 49, 50, 8, 11
'16-Aug-2013', 20, 24, 27, 37, 39, 5, 10
'13-Aug-2013', 5, 17, 20, 47, 50, 1, 4
'09-Aug-2013', 4, 7, 9, 23, 24, 8, 9
'06-Aug-2013', 17, 47, 16, 49, 31, 3, 11
'02-Aug-2013', 42, 36, 48, 37, 21, 7, 4
'30-Jul-2013', 3, 14, 4, 11, 43, 1, 6
'26-Jul-2013', 23, 38, 29, 12, 49, 4, 3
'23-Jul-2013', 19, 14, 44, 16, 15, 4, 5
'19-Jul-2013', 24, 35, 13, 26, 16, 5, 2
'16-Jul-2013', 50, 34, 47, 19, 23, 4, 6
'12-Jul-2013', 26, 42, 33, 18, 32, 3, 2
'09-Jul-2013', 18, 16, 38, 49, 31, 10, 4
'05-Jul-2013', 28, 4, 33, 12, 15, 1, 10
'02-Jul-2013', 14, 13, 11, 28, 30, 4, 5
'28-Jun-2013', 15, 1, 47, 28, 35, 7, 1
'25-Jun-2013', 4, 13, 35, 27, 5, 2, 1
'21-Jun-2013', 30, 11, 36, 45, 10, 1, 2
'18-Jun-2013', 24, 33, 17, 41, 44, 11, 1
'14-Jun-2013', 41, 25, 48, 10, 47, 6, 10
'11-Jun-2013', 7, 9, 25, 5, 41, 5, 1
'07-Jun-2013', 14, 26, 45, 50, 7, 2, 7
'04-Jun-2013', 34, 33, 40, 31, 37, 6, 1
'31-May-2013', 29, 43, 28, 34, 27, 10, 5
'28-May-2013', 34, 38, 13, 8, 26, 3, 11
'24-May-2013', 22, 17, 40, 7, 27, 2, 3
'21-May-2013', 29, 19, 8, 28, 7, 9, 5
'17-May-2013', 25, 24, 50, 6, 20, 9, 10
'14-May-2013', 24, 7, 8, 36, 27, 11, 5
'10-May-2013', 48, 35, 45, 1, 32, 4, 11
'07-May-2013', 43, 27, 13, 28, 42, 4, 6
'03-May-2013', 5, 49, 34, 3, 40, 2, 3
'30-Apr-2013', 13, 50, 40, 43, 36, 9, 5
'26-Apr-2013', 40, 38, 16, 24, 11, 2, 5
'23-Apr-2013', 50, 4, 1, 7, 10, 4, 11
'19-Apr-2013', 1, 46, 8, 42, 48, 4, 7
'16-Apr-2013', 33, 50, 22, 1, 11, 4, 6
'12-Apr-2013', 28, 45, 15, 5, 10, 3, 9
'09-Apr-2013', 15, 44, 48, 38, 35, 10, 5
'05-Apr-2013', 32, 1, 17, 39, 11, 7, 2
'02-Apr-2013', 17, 12, 41, 29, 25, 1, 4
'29-Mar-2013', 44, 30, 46, 43, 13, 9, 5
'26-Mar-2013', 44, 30, 26, 42, 4, 6, 11
'22-Mar-2013', 27, 32, 12, 34, 49, 9, 8
'19-Mar-2013', 44, 32, 19, 37, 35, 9, 1
'15-Mar-2013', 24, 14, 39, 4, 21, 10, 3
'12-Mar-2013', 50, 4, 10, 2, 22, 5, 8
'08-Mar-2013', 20, 42, 23, 28, 3, 8, 11
'05-Mar-2013', 33, 31, 19, 8, 39, 7, 2
'01-Mar-2013', 1, 11, 36, 29, 42, 4, 5
'26-Feb-2013', 12, 13, 17, 3, 30, 6, 2
'22-Feb-2013', 15, 37, 36, 16, 28, 2, 11
'19-Feb-2013', 28, 30, 44, 12, 15, 9, 8
'15-Feb-2013', 2, 4, 42, 28, 22, 4, 9
'12-Feb-2013', 28, 25, 5, 11, 16, 7, 9
1 14-Nov-2014 36 32 38 48 17 8 5
2 11-Nov-2014 46 14 36 2 21 11 7
3 07-Nov-2014 32 13 38 46 25 10 1
4 04-Nov-2014 1 13 6 26 17 3 5
5 31-Oct-2014 10 41 13 20 33 9 3
6 28-Oct-2014 45 17 40 10 15 1 2
7 24-Oct-2014 42 20 3 30 9 6 1
8 21-Oct-2014 40 33 27 20 21 3 10
9 17-Oct-2014 49 13 48 1 40 8 10
10 14-Oct-2014 15 23 32 4 5 7 3
11 10-Oct-2014 29 42 47 45 6 9 10
12 07-Oct-2014 38 30 21 9 28 8 1
13 03-Oct-2014 13 23 50 48 4 10 5
14 30-Sep-2014 33 13 15 3 42 5 7
15 26-Sep-2014 46 35 47 13 27 1 2
16 23-Sep-2014 13 35 14 29 12 1 7
17 19-Sep-2014 6 34 8 38 48 9 3
18 16-Sep-2014 4 30 35 50 29 4 2
19 12-Sep-2014 31 9 33 26 13 7 11
20 09-Sep-2014 15 35 19 8 24 10 8
21 05-Sep-2014 18 50 23 46 1 9 3
22 02-Sep-2014 39 45 25 31 5 8 1
23 29-Aug-2014 32 38 26 9 2 3 6
24 26-Aug-2014 36 48 45 10 22 11 4
25 22-Aug-2014 29 17 49 35 4 1 2
26 19-Aug-2014 11 34 47 4 7 7 8
27 15-Aug-2014 4 21 30 5 23 10 8
28 12-Aug-2014 22 19 7 16 33 5 2
29 08-Aug-2014 29 21 35 46 43 1 9
30 05-Aug-2014 5 21 42 7 19 11 5
31 01-Aug-2014 50 44 46 48 24 10 5
32 29-Jul-2014 40 23 35 10 43 9 3
33 25-Jul-2014 10 24 9 12 43 5 9
34 22-Jul-2014 1 43 50 45 24 5 8
35 18-Jul-2014 1 41 43 11 29 3 11
36 15-Jul-2014 18 27 15 34 20 1 3
37 11-Jul-2014 38 35 5 49 22 7 4
38 08-Jul-2014 24 18 22 8 27 11 4
39 04-Jul-2014 47 18 43 39 4 6 2
40 01-Jul-2014 39 25 18 22 27 5 10
41 27-Jun-2014 39 34 45 33 31 2 10
42 24-Jun-2014 20 1 7 21 48 4 7
43 20-Jun-2014 5 38 49 15 25 1 2
44 17-Jun-2014 48 13 37 40 11 8 9
45 13-Jun-2014 16 22 28 46 18 11 9
46 10-Jun-2014 12 18 21 33 32 1 11
47 06-Jun-2014 34 40 25 7 49 9 11
48 03-Jun-2014 2 39 32 15 44 5 10
49 30-May-2014 27 41 24 45 5 7 6
50 27-May-2014 16 13 26 25 7 1 6
51 23-May-2014 31 3 47 8 34 11 9
52 '20-May-2014' 5 33 36 38 47 4 9
53 '16-May-2014' 23 26 29 37 40 3 4
54 '13-May-2014' 4 13 30 34 47 2 6
55 '09-May-2014' 3 21 26 28 45 7 10
56 '06-May-2014' 5 19 24 31 37 1 9
57 '02-May-2014' 4 30 31 38 42 2 11
58 '29-Apr-2014' 18 23 26 35 44 3 11
59 '25-Apr-2014' 13 21 24 44 49 1 9
60 '22-Apr-2014' 13 15 20 24 46 1 8
61 '18-Apr-2014' 21 24 31 39 47 3 7
62 '15-Apr-2014' 3 14 26 47 50 7 11
63 '11-Apr-2014' 8 12 19 30 33 4 11
64 '08-Apr-2014' 11 18 29 42 49 4 11
65 '04-Apr-2014' 6 10 28 45 50 10 11
66 '01-Apr-2014' 16 18 26 38 44 8 10
67 '28-Mar-2014' 3 4 19 28 43 3 7
68 '25-Mar-2014' 7 20 26 28 50 2 8
69 '21-Mar-2014' 7 30 37 39 42 5 7
70 '18-Mar-2014' 8 27 34 36 39 5 10
71 '14-Mar-2014' 6 24 25 27 30 5 9
72 '11-Mar-2014' 1 4 23 33 44 7 8
73 '07-Mar-2014' 5 10 38 40 41 1 8
74 '04-Mar-2014' 3 5 22 27 44 1 6
75 '28-Feb-2014' 12 32 38 43 44 2 7
76 '25-Feb-2014' 21 25 28 35 42 4 6
77 '21-Feb-2014' 13 17 28 30 32 5 7
78 '18-Feb-2014' 23 26 36 37 49 6 7
79 '14-Feb-2014' 19 39 4 2 6 2 7
80 '11-Feb-2014' 47 25 8 17 41 1 2
81 '07-Feb-2014' 17 19 47 3 46 9 10
82 '04-Feb-2014' 37 1 33 21 38 8 4
83 '31-Jan-2014' 10 15 31 8 16 8 9
84 '28-Jan-2014' 18 23 48 20 42 2 9
85 '24-Jan-2014' 19 41 35 34 5 1 5
86 '21-Jan-2014' 4 42 35 48 12 5 8
87 '17-Jan-2014' 26 19 33 42 32 10 4
88 '14-Jan-2014' 25 18 20 26 37 11 10
89 '10-Jan-2014' 1 27 2 11 29 10 1
90 '07-Jan-2014' 2 45 20 27 33 6 10
91 '03-Jan-2014' 3 44 27 38 31 3 8
92 '31-Dec-2013' 29 45 24 20 13 7 3
93 '27-Dec-2013' 1 22 6 13 28 10 5
94 '24-Dec-2013' 5 31 43 50 19 6 2
95 '20-Dec-2013' 13 22 17 43 12 10 3
96 '17-Dec-2013' 41 6 8 37 27 7 10
97 '13-Dec-2013' 24 22 23 1 31 6 11
98 '10-Dec-2013' 49 50 24 6 35 7 1
99 '06-Dec-2013' 18 31 36 2 1 7 10
100 '03-Dec-2013' 32 6 29 15 13 2 9
101 '29-Nov-2013' 2 7 10 23 43 4 7
102 '26-Nov-2013' 19 23 27 42 44 3 5
103 '22-Nov-2013' 13 25 26 40 50 8 9
104 '19-Nov-2013' 14 15 19 36 45 1 10
105 '15-Nov-2013' 3 13 15 29 42 1 4
106 '12-Nov-2013' 14 29 37 40 48 2 11
107 '08-Nov-2013' 20 28 35 42 43 8 10
108 '05-Nov-2013' 6 12 13 35 38 2 3
109 '01-Nov-2013' 7 19 29 30 33 3 8
110 '29-Oct-2013' 9 10 30 32 37 2 6
111 '25-Oct-2013' 2 3 10 31 38 6 10
112 '22-Oct-2013' 29 33 39 41 44 9 11
113 '18-Oct-2013' 5 25 36 46 47 2 6
114 '15-Sep-2013' 18 27 39 43 47 4 7
115 '11-Oct-2013' 6 12 17 23 43 5 9
116 '08-Oct-2013' 23 24 26 33 42 3 5
117 '04-Oct-2013' 6 20 24 35 50 5 10
118 '01-Oct-2013' 19 23 25 44 48 8 9
119 '27-Sep-2013' 11 15 38 41 43 2 6
120 '24-Sep-2013' 10 20 26 28 43 9 11
121 '20-Sep-2013' 5 11 35 38 45 2 3
122 '17-Sep-2013' 13 17 21 42 44 9 11
123 '13-Sep-2013' 4 6 14 27 33 5 10
124 '10-Sep-2013' 7 11 14 28 30 2 10
125 '06-Sep-2013' 11 23 25 32 37 4 7
126 '03-Sep-2013' 5 9 16 18 42 7 9
127 '30-Aug-2013' 2 17 25 36 45 5 9
128 '27-Aug-2013' 7 30 38 40 43 2 6
129 '23-Aug-2013' 1 6 26 30 37 5 8
130 '20-Aug-2013' 5 11 42 49 50 8 11
131 '16-Aug-2013' 20 24 27 37 39 5 10
132 '13-Aug-2013' 5 17 20 47 50 1 4
133 '09-Aug-2013' 4 7 9 23 24 8 9
134 '06-Aug-2013' 17 47 16 49 31 3 11
135 '02-Aug-2013' 42 36 48 37 21 7 4
136 '30-Jul-2013' 3 14 4 11 43 1 6
137 '26-Jul-2013' 23 38 29 12 49 4 3
138 '23-Jul-2013' 19 14 44 16 15 4 5
139 '19-Jul-2013' 24 35 13 26 16 5 2
140 '16-Jul-2013' 50 34 47 19 23 4 6
141 '12-Jul-2013' 26 42 33 18 32 3 2
142 '09-Jul-2013' 18 16 38 49 31 10 4
143 '05-Jul-2013' 28 4 33 12 15 1 10
144 '02-Jul-2013' 14 13 11 28 30 4 5
145 '28-Jun-2013' 15 1 47 28 35 7 1
146 '25-Jun-2013' 4 13 35 27 5 2 1
147 '21-Jun-2013' 30 11 36 45 10 1 2
148 '18-Jun-2013' 24 33 17 41 44 11 1
149 '14-Jun-2013' 41 25 48 10 47 6 10
150 '11-Jun-2013' 7 9 25 5 41 5 1
151 '07-Jun-2013' 14 26 45 50 7 2 7
152 '04-Jun-2013' 34 33 40 31 37 6 1
153 '31-May-2013' 29 43 28 34 27 10 5
154 '28-May-2013' 34 38 13 8 26 3 11
155 '24-May-2013' 22 17 40 7 27 2 3
156 '21-May-2013' 29 19 8 28 7 9 5
157 '17-May-2013' 25 24 50 6 20 9 10
158 '14-May-2013' 24 7 8 36 27 11 5
159 '10-May-2013' 48 35 45 1 32 4 11
160 '07-May-2013' 43 27 13 28 42 4 6
161 '03-May-2013' 5 49 34 3 40 2 3
162 '30-Apr-2013' 13 50 40 43 36 9 5
163 '26-Apr-2013' 40 38 16 24 11 2 5
164 '23-Apr-2013' 50 4 1 7 10 4 11
165 '19-Apr-2013' 1 46 8 42 48 4 7
166 '16-Apr-2013' 33 50 22 1 11 4 6
167 '12-Apr-2013' 28 45 15 5 10 3 9
168 '09-Apr-2013' 15 44 48 38 35 10 5
169 '05-Apr-2013' 32 1 17 39 11 7 2
170 '02-Apr-2013' 17 12 41 29 25 1 4
171 '29-Mar-2013' 44 30 46 43 13 9 5
172 '26-Mar-2013' 44 30 26 42 4 6 11
173 '22-Mar-2013' 27 32 12 34 49 9 8
174 '19-Mar-2013' 44 32 19 37 35 9 1
175 '15-Mar-2013' 24 14 39 4 21 10 3
176 '12-Mar-2013' 50 4 10 2 22 5 8
177 '08-Mar-2013' 20 42 23 28 3 8 11
178 '05-Mar-2013' 33 31 19 8 39 7 2
179 '01-Mar-2013' 1 11 36 29 42 4 5
180 '26-Feb-2013' 12 13 17 3 30 6 2
181 '22-Feb-2013' 15 37 36 16 28 2 11
182 '19-Feb-2013' 28 30 44 12 15 9 8
183 '15-Feb-2013' 2 4 42 28 22 4 9
184 '12-Feb-2013' 28 25 5 11 16 7 9

1
app/newermobile.htm Normal file

File diff suppressed because one or more lines are too long

64
app/newmobile.htm Normal file
View File

@ -0,0 +1,64 @@
<html><head><title>Slack</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="viewport" content="width=320; initial-scale=1.0;">
<style>
body,ul,ol,dl,h1,h2,h3,h4,h5,h6,td,th,
caption,pre,p,blockquote,input,textarea,a,.l,.r,.m2 {
font: 105% 'Helvetica Neue', Helvetica, 'Lucida Grande', 'Lucida Sans Unicode', sans-serif;
}
body{background-color: #fff;};
a {color:#ff0000;text-decoration:underline;white-space: nowrap;margin:5px;padding:2px;}
a:visited {color:purple;}
a:hover {color:#CC0000;}
.m {text-align:center; font-weight:900;font-size: 120%;color: #888;}
.l{font-style:italic;text-align:left;font-weight:900;font-size:110%;color: #888;}
.r{text-align:right;border-bottom:1px solid #888;}
</style>
</head>
<body>
<div class='m'>Slack - I have plenty of talent and vision I just don't give a damn</div>
<div class='l'>Starting Points/Metasites</div>
<div class='r'><a href='https://kanbanflow.com/m'>Kanban flow</a> /
<a href="https://en.m.wikipedia.org/wiki/Main_Page">Wikipedia</a> /
<a href="http://iphone.facebook.com/#/home.php">Facebook</a> / <a href="http://www.yahoo.com/">Yahoo!</a> / <a href="http://www.talk3g.co.uk/forumdisplay.php?f=100">Talk3G</a> / <a href="http://www.unmajestic.com/home/bookmarkshome.htm">Bookmarks</a> / <a href="http://iphone.ebay.com/">Ebay</a> / <a href="http://www.evernote.com/m">Evernote</a> / <a href="http://mobile.wikipedia.org/">Wikipedia</a> / <a href="http://mobile.twitter.com/">Twitter</a> / <a href="http://m.foursquare.com/">Foursquare</a></div>
<div class='l'>News</div>
<div class='r'><a href='http://m.bbc.co.uk/'>BBC News</a> / <a href='http://m.guardian.co.uk/'>Guardian</a> / <a href='http://m.telegraph.co.uk/'>Telegraph</a> / <a href="http://m.wsj.com/home-page">WSJ</a> / <a href="http://mobile.bloomberg.com/">Bloomberg</a> / <a href='http://m.wired.com/'>Wired</a></div>
<div class='l'>Travel</div>
<div class='r'>
<a href="http://www.bbc.co.uk/travel/glasgowandwestscotland/incidents/road">travel news</a> / <a href="http://m.nationalrail.co.uk/pj/ldbboard/dep/DBE/WES/To">DBE->WES</a> / <a href="http://m.nationalrail.co.uk/pj/ldbboard/dep/WES/DBE/To">WES->DBE</a> / <a href="http://m.nationalrail.co.uk/pj/ldbboard/dep/DBE">Dumbarton East Trains</a> / <a href="http://m.nationalrail.co.uk/pj/ldbboard/dep/GLQ">Queen Street Trains</a> / <a href="http://m.nationalrail.co.uk/pj/ldbboard/dep/CHC">Charing Cross</a> / <a href='http://m.thetrainline.com/dsb/timetable/jsp/mobile_portal.jsp'>The Trainline</a> / <a href="http://m.kayak.co.uk/">Kayak</a> / <a href='http://www.laterooms.com/'>Laterooms</a> / <a href="http://www.travelocity.com/MobileHotel">Travelocity</a> / <a href="http://reservation.travel.com/m/">Travel.com</a> / <a href='http://www.tripadvisor.com/'>Trip Advisor</a> / <a href="http://www.landings.com/_landings/pages/commercial.html">Airlines</a> / <a href="http://mobile.flightstats.com/go/Mobile/home.do">Landings</a> / <a href="http://www.lib.utexas.edu/Libs/PCL/Map_collection/map_sites/map_sites.html#general">Maps</a> / <a href="http://www.sitesatlas.com/Maps/">Maps2</a> / <a href="http://www.itn.net/">ITN</a> / <a href="http://bahn.hafas.de/bin/query.exe/en">HAFAS</a> / <a href="http://bahn.hafas.de/bin/query.exe/en" alt='DieBahn' title='DieBahn'>Eurotrains</a> / <a href="http://www.cwrr.com/nmra/travelreg.html">RailUSA</a> / <a href="http://www.trainweb.com/frames_travel.html">TrainWeb</a> / <a href="http://www.cwrr.com/nmra/travelw2.html">RailWorld</a> / <a href="http://www.xe.com/currency/gbp-british-pound?c=SEK">Currency Converter</a> / <a href="http://www.cia.gov/cia/publications/factbook/index.html">CIA</a> / <a href="http://maps.google.com/">GMaps</a> / <a href="http://mtrvl.com/">Mobile Travel Aid</a> / <a href="https://www.tfl.gov.uk/plan-a-journey/">TfL Route Planner</a> / <a href="http://www.norwegian.com/uk/">Norwegian</a> / <a href='http://m.tripit.com/'>TripIt</a> / <a href='http://www.ichotelsgroup.com/wireless/pc/us/en/home.action?cm_sp=IMMerch-_-PC_US_en-_-MobileDemoButton'>Priority Club</a> / <a href='http://www.urbanspoon.com/m'>Urban Spoon</a> / <a href='http://pda.continental.com'>Continental Flight Checker</a>
</div>
<div class='l'>Weather Reports</div>
<div class='r'>
<a href="http://i.wund.com/cgi-bin/findweather/getForecast?brand=iphone&query=dumbarton%2C+uk">WU Dumbarton Weather</a> / <a href="http://weather.yahoo.com/forecast/UKXX0663.html?unit=c">Y! Dumbarton Weather</a> / <a href="http://www.accuweather.com/ukie/index-forecast.asp?postalcode=G82%201RG">Dumbarton Weather</a> / <a href="http://i.wund.com/cgi-bin/findweather/getForecast?brand=iphone&query=glasgow%2C+uk">WU Glasgow Weather</a> / <a href="http://weather.yahoo.com/Glasgow-United-Kingdom/UKXX0061/forecast.html?unit=c">Y! Glasgow Weather</a> / <a href="http://www.accuweather.com/ukie/index-forecast.asp?postalcode=G9%202SU">Glasgow Weather</a> /<a href="http://i.wund.com/">WU Elsewhere</a> / <a href="http://www.nowcast.co.uk/lightning/">Live Lightning</a> / <a href="http://www.upminsterweather.co.uk/test/lightning.htm">Other Live Lightning</a> / <a href="http://www.meteorologica.info/freedata_lightning.htm">Closer Live Lightning</a>
</div>
<div class='l'>Job Searching</div>
<div class='r'>
<a href="http://forums.contractoruk.com/index.php">Contractor UK</a> / <a href="http://www.monster.co.uk/">monster</a> / <a href="http://www.cwjobs.co.uk/">cwjobs</a> / <a href="http://www.s1jobs.com/myaccount/">s1jobs</a> / <a href="http://www.jobserve.com/mobile/phone/mobilehomepage.aspx">jobserve</a> / <a href="http://www.jobsite.co.uk/mobile/">jobsite</a> / <a href="http://www.itjobswatch.co.uk/contracts/scotland/asp.do">IT Jobs Watch Scotland</a>
</div>
<div class='l'>Entertainment</div>
<div class='r'>
<a href="http://genre.amazingradio.co.uk:8000/stream.mp3?arplayer=1">Amazing Radio Chill</a> / <a href="http://www.whatsonglasgow.co.uk/">Whats on In Glasgow</a> / <a href="http://www.5pm.co.uk/Search/Event/">Local Events</a> / <a href="http://www.cineworld.co.uk/cinemas/28?fallback=false&isMobileAgent=false">Cineworld</a> / <a href="http://www.showcasecinemas.co.uk/showtimes/default.asp?selectTheatre=8508">Showcase</a> / <a href="http://uk.rottentomatoes.com/">Rotten Tomatoes</a> / <a href="http://www.metacritic.com/">Metacritic</a> / <a href="http://m.runpee.com/">RunPee</a> / <a href="http://www.imdb.com/">Imdb</a> / <a href="http://www.epguides.com/">EPGuides</a> / <a href="http://eztv.it">Eztv</a> / <a href="http://www.mininova.org">Mininova</a> / <a href="http://www.scrapetorrent.com">Scrapetorrent</a> / <a href="http://www.solidrockglasgow.com/">solid</a> / <a href="https://www.google.co.uk/search?q=cathouse+glasgow&oq=cathouse+glasgow&aqs=chrome..69i57j0l5.2799j0j4&sourceid=chrome&es_sm=119&ie=UTF-8">catty</a> / <a href="http://www.vegasscotland.co.uk/">vegas</a> / <a href="http://www.clubnoir.co.uk/calendar.html?c=view&event_id=15">noir</a> / <a href='http://www.amazon.com/gp/aw/h.html'>Amazon</a>
</div>
<div class='l'>Personal / Money</div>
<div class='r'><a href="http://www.paypal.com/">Paypal</a> / <a href="http://www.halifax.co.uk/">Halifax</a> / <a href="http://www.bullbearings.co.uk/stock.portfolio.php">Bullbearings</a> / <a href="http://www.fidelity.co.uk/">Fidelity</a> / <a href="http://www.contractorumbrella.com/">Contractor Umbrella</a> / <a href="https://www99.americanexpress.com/myca/mobl/us/?r=l_l">American Express</a> / <a href='http://rates.fxcm.com/rates_a'>Exchange Rates</a>
</div>
</body></html>

518
app/slack.htm Normal file
View File

@ -0,0 +1,518 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Slack</title>
<!-- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> -->
<script src="//cdnjs.cloudflare.com/ajax/libs/zepto/1.1.4/zepto.min.js"></script>
<style type="text/css" media="all">
body {
text-align: center;
background: #C9C5C2;
margin: auto;
}
.container {
text-align: left;
position: relative;
width: 960px;
background: #FFF;
border: 2px solid #FFF;
-moz-box-shadow: 3px 3px 3px #aaa;
-webkit-box-shadow: 3px 3px 3px #aaa;
box-shadow: 3px 3px 3px #aaa;
margin: 18px auto;
padding: 0;
}
body, ul, ol, dl, h1, h2, h3, h4, h5, h6, td, th, caption, pre, p, blockquote, input, textarea {
font: .9em 'Helvetica Neue', Helvetica, 'Lucida Grande', 'Lucida Sans Unicode', sans-serif;
color: #333;
}
a {
color: #000;
text-decoration: underline;
white-space: nowrap;
}
a:visited {
color: #666;
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Helvetica Neue', Helvetica, 'Lucida Grande', 'Lucida Sans Unicode', sans-serif;
color: #FFF;
margin: 0;
padding: 9px 0;
}
h1 a, h1 a:visited {
color: #EEE;
}
h1 a:hover {
color: #CCC;
}
h1 {
font-size: 18px;
background: teal;
border-bottom: 3px solid #80007e;
padding: 9px 0 9px 9px;
}
.small {
font-size: .8em;
}
h2 {
font-size: 12px;
background: #DDD;
border-bottom: 1px solid #80007e;
color: #333;
margin-top: 0;
padding: 9px 0 9px 9px;
}
h3 {
font-size: 18px;
}
ul {
margin: 0;
padding: 0;
}
li {
display: inline;
margin: 0;
padding: 0 4px 0 0;
}
table {
width: 100%;
border-spacing: 10px;
}
th {
width: 33%;
font-size: 16px;
font-weight: 700;
line-height: 24px;
border-bottom: 1px solid #80007e;
color: #333;
}
td {
vertical-align: top;
background: #FFF;
padding: 0 0 6px;
}
td.footer {
background: #8abbd7;
padding: 10px;
}
.red:hover {
color: blue;
}
.floatright {
float: right;
padding-right: 10px;
}
.floatleft {
float: left;
padding-left: 10px;
}
a:hover, .red {
color: #C00;
}
.dates {
padding: 2px;
border: solid 1px #80007e;
background-color: #ffffff;
}
#btc, #fx {
font-size: 75%;
}
.up {
color: darkgreen;
}
.down {
color: darkred;
}
.nochange {
color: #000000;
}
</style>
</head>
<body>
<div class="container">
<h1 class="title">Slack - I have plenty of talent and vision I just don't give a damn</h1>
<div>
<h2><span id='one' class='dates'>----</span><span>&nbsp;&nbsp;</span><span
id='two' class='dates'>----</span><span>&nbsp;&nbsp;</span> <span
id='three' class='dates'>----</span>
</h2>
</div>
<table>
<tr>
<th>Starting Points/Metasites</th>
<th>Tools</th>
<th>Bitcoin <span id="btc"></span></th>
</tr>
<tr>
<td>
<!-- Starting Points/Metasites -->
<ul>
<li><a href="https://feedly.com/#my">Feedly</a></li>
<li><a href="https://www.reddit.com">Reddit</a></li>
<li><a href="http://www.facebook.com/">Facebook</a></li>
<li><a href="http://www.yahoo.com/">Yahoo!</a></li>
<li>
<a href="http://www.unmajestic.com/home/bookmarks.php">Slack Bookmarks</a>
</li>
</ul>
</td>
<td>
<!-- tools -->
<ul>
<li>
<a href='https://kanbanflow.com'>Kanban Flow</a></li>
<li>
<a href="https://www.linode.com/">Linode</a>
</li>
<li>
<a href="http://www.colorzilla.com/gradient-editor/">CSS Gradient Generator</a>
</li>
<li><a href="http://utilities-online.info/xmltojson">XML to JSON</a>
</li>
<li><a href="http://shancarter.com/data_converter">CSV to JSON</a>
</li>
<li><a href="http://cubic-bezier.com/">Cubic Bezier</a></li>
<li><a href="http://gskinner.com/RegExr/">RegEx Tool</a></li>
<li>
<a href="http://closure-compiler.appspot.com/home">Closure Compiler</a>
</li>
<li><a href="http://jsonlint.com/">JSON Lint</a></li>
<li><a href="http://jsoneditoronline.org/">JSON Editor</a></li>
<li><a href="http://www.base64decode.org/">Base64 Decoder</a></li>
<li><a href="http://jsbeautifier.org/">JS Beautifier</a></li>
<li><a href="http://spritepad.wearekiss.com/">Spritepad</a></li>
<li>
<a href="http://draeton.github.com/stitches/">Sprite Sheet Generator</a>
</li>
<li><a href="http://www.cleancss.com/">CSS Optimizer</a></li>
<li><a href="http://fontello.com/">Icon Font Generator</a></li>
<li><a href="http://html2jade.aaron-powell.com/">HTML to Jade</a></li>
<li><a href="http://cdnjs.com//">Cloudflare JS CDN</a></li>
<li><a href="http://www.willpeavy.com/minifier/">HTML Minifier</a></li>
<li><a href='https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet'>XSS Cheat Sheet</a></li>
<li><a href='http://jsfiddle.net/'>JSFiddle</a></li>
<li><a href="http://jsbin.com/">JS Bin</a></li>
<li><a href='https://draftin.com/documents'>Draftin</a></li>
</ul>
</td>
<td>
<!-- Bitcoin -->
<ul>
<li><a href="https://www.bitstamp.net">Bitstamp</a></li>
<li><a href="https://www.kraken.net">Kraken</a></li>
<li>
<a href="https://cryptowat.ch/">Cryptowat.ch</a>
</li>
<li>
<a href="http://www.coindesk.com/price/">BTC Chart</a>
</li>
<li>
<a href="https://bitcoinwisdom.com/">BTC Chart 2</a>
</li>
<li>
<a href="http://bitcoinity.org/markets/bitstamp/USD">BitStamp Chart</a>
</li>
<li>
<a href="http://btc-chart.com/market/bitstamp/86400">Bitstamp Chart 2</a>
</li>
<li><a href="https://bitbargain.co.uk">BitBargin UK</a></li>
<li><a href="https://yacuna.com/">Yacuna UK</a></li>
<li><a href="http://blockchain.info/">Blockchain</a></li>
<li><a href="http://bitminter.com/">Bitminter</a></li>
<li><a href="http://preev.com/">BTC Exchange Rate</a></li>
<li><a href="http://www.silvrtree.co.uk/watch.html">CFT Watcher</a>
<span style="cursor: pointer;"
onclick="popitoutSmall('http://www.silvrtree.co.uk/watch.html');"><img
src="gfx/popout.png"></span>
</li>
</ul>
</td>
</tr>
<tr>
<th>Computer News</th>
<th>Weather Reports</th>
<th>Free Email WEBpages</th>
</tr>
<tr>
<td>
<!-- Computer News -->
<ul>
<li><a href="http://www.pcmag.com/">PCMag</a></li>
<li><a href="http://www.newslinx.com/">Newslinx</a></li>
<li><a href="http://www.zdnet.com/zdnn"> ZDNet</a></li>
<li>
<a href="http://service.bfast.com/bfast/click?bfmid=1476905&amp;siteid=22078656&amp;bfpage=news_5">Bfast</a>
</li>
<li><a href="http://www.news.com/">News.com</a></li>
<li><a href="http://www.computerworld.com/">CW</a></li>
<li><a href="http://www.cmpnet.com/">TechW</a></li>
</ul>
</td>
<td>
<!-- Weather Reports -->
<ul>
<li>
<a href="http://www.accuweather.com/ukie/index-forecast.asp?postalcode=G82%201RG">Dumbarton
Weather</a>
</li>
<li>
<a href="http://www.wunderground.com/cgi-bin/findweather/getForecast?query=dumbarton,%20uk&wuSelect=WEATHER">WU
Dumbarton Weather</a>
</li>
<li>
<a href="http://weather.yahoo.com/forecast/UKXX0663.html?unit=c">Y! Dumbarton Weather</a>
</li>
<li>
<a href="http://www.accuweather.com/ukie/index-forecast.asp?postalcode=G9%202SU">Glasgow
Weather</a>
</li>
<li>
<a href="http://www.wunderground.com/cgi-bin/findweather/getForecast?query=glasgow,%20uk&wuSelect=WEATHER">WU
Glasgow Weather</a>
</li>
<li><a href="http://www.nowcast.co.uk/lightning/">Live Lightning</a>
</li>
<li>
<a href="http://www.upminsterweather.co.uk/test/live_lightning.htm">Other Live Lightning</a>
</li>
<li>
<a href="http://www.meteorologica.info/freedata_lightning.htm">Closer Live Lightning</a>
</li>
<li>
<a href="http://www.malvernwx.co.uk/lightning_data/lightning.htm">Multiple Lightning</a>
</li>
<li>
<a href="http://www.blitzortung.org/Webpages/index.php">European Lightning</a>
</li>
<li>
<a href="http://www.madpaddler.net/wxlightning.php">East Kilbride Lightning</a>
</li>
<li>
<a href="http://www.bordersweather.co.uk/wxlightning.php">Borders Lightning</a>
</li>
<li><a href="http://www.madpaddler.net/wxais.php">Ships</a></li>
</ul>
</td>
<td>
<!-- Free Email WEBpages -->
<ul>
<li><a href="http://gmail.google.com/">Gmail</a></li>
<li>
<a href="http://www.unmajestic.com/webmail/">Unmajestic Webmail</a>
</li>
<li>
<a href="http://www.artizanconsulting.co.uk/webmail/">Artizan Webmail</a>
</li>
<li><a href="http://mail.yahoo.com">Yahoo Mail</a></li>
<li>
<a href="https://www.guerrillamail.com/">Guerrilla Mail Anti Spam</a>
</li>
</ul>
</td>
</tr>
<tr>
<th>Job Searching</th>
<th>Entertainment</th>
<th>Travel <span id="fx"></span></th>
</tr>
<tr>
<td>
<!-- Real News Related -->
<ul>
<li><a href='https://worksheets.computerfutures.com/'>CF Timesheets</a></li>
<li><a href="http://www.monster.co.uk/">monster</a></li>
<li><a href="http://www.cwjobs.co.uk/">cwjobs</a></li>
<li><a href="http://www.s1jobs.com/myaccount/">s1jobs</a></li>
<li><a href="http://www.jobserve.com/">jobserve</a></li>
<li><a href="http://www.jobsite.co.uk/jbe/myprofile/">jobsite</a>
</li>
<li>
<a href="http://www.itjobswatch.co.uk/contracts/scotland/asp.do">IT Jobs Watch Scotland</a>
</li>
</ul>
</td>
<td>
<!-- Entertainment -->
<ul>
<li>
<a href="http://genre.amazingradio.co.uk:8000/stream.mp3?arplayer=1">Amazing Radio Chill</a>
</li>
<li>
<a href="http://www.cineworld.co.uk/cinemas/28?fallback=false&isMobileAgent=false">Cineworld</a>
</li>
<li>
<a href="http://www.showcasecinemas.co.uk/showtimes/default.asp?selectTheatre=8508">Showcase</a>
</li>
<li><a href="http://www.imdb.com/">Imdb</a></li>
<li><a href="http://www.epguides.com/">EPGuides</a></li>
<li><a href="http://eztv.it">Eztv</a></li>
<li><a href="http://www.mininova.org">Mininova</a></li>
<li><a href="http://www.scrapetorrent.com">Scrapetorrent</a></li>
<li>
<a href="http://glasgow.myvillage.com/events">Whats on In Glasgow</a>
</li>
<li><a href="http://www.5pm.co.uk/Search/Event/">Local Events</a>
</li>
</ul>
</td>
<td>
<!-- Travel -->
<span>DBEGLQ: <span id="dbeglq">---</span></span>
<ul>
<li>
<a href='http://www.journeycheck.com/firstscotrail'>Journey Check</a>
<a href="http://www.bbc.co.uk/travel/2650802/incidents/road">BBC Road
news</a>
</li>
<li>
<a href="http://ojp.nationalrail.co.uk/service/ldbboard/dep/DBE/WES/To?ar=true">DBE->WES</a>
</li>
<li>
<a href="http://ojp.nationalrail.co.uk/service/ldbboard/dep/WES/DBE/To?ar=true">WES->DBE</a>
<span style="cursor: pointer;"
onclick="popitout('http://ojp.nationalrail.co.uk/service/ldbboard/dep/WES/DBE/To?ar=true#skip-content-hold');"><img
src="gfx/popout.png"></span>
</li>
<li>
<a href="http://www.livedepartureboards.co.uk/ldb/summary.aspx?T=DBE">Dumbarton East Trains</a>
</li>
<li>
<a href="http://www.livedepartureboards.co.uk/ldb/summary.aspx?T=GLQ">Queen Street Trains</a>
</li>
<li><a href="http://www.kayak.co.uk/">Kayak</a></li>
<li><a href="http://www.travelocity.co.uk/">Travelocity</a></li>
<li><a href="http://www.travel.com/sitemap.htm">Travel.com</a></li>
<li>
<a href="http://www.landings.com/_landings/pages/commercial.html">Airlines</a>
</li>
<li><a href="http://www.flightstats.com">Landings</a></li>
<li>
<a href="http://www.lib.utexas.edu/Libs/PCL/Map_collection/map_sites/map_sites.html#general">Maps</a>
</li>
<li><a href="http://www.sitesatlas.com/Maps/">Maps2</a></li>
<li><a href="http://www.itn.net/">ITN</a></li>
<li><a href="http://bahn.hafas.de/bin/query.exe/en">HAFAS</a></li>
<li><a href="http://bahn.hafas.de/bin/query.exe/en">DieBahn</a></li>
<li><a href="http://www.cwrr.com/nmra/travelreg.html">RailUSA</a>
</li>
<li>
<a href="http://www.trainweb.com/frames_travel.html">TrainWeb</a>
</li>
<li><a href="http://www.cwrr.com/nmra/travelw2.html">RailWorld</a>
</li>
<li><a href="http://www.xe.net/currency/">Currency Converter</a>
</li>
<li>
<a href="http://www.cia.gov/cia/publications/factbook/index.html">CIA</a>
</li>
<li><a href="http://maps.google.com/">GMaps</a></li>
</ul>
</td>
</tr>
<tr>
<th>Computer Software, etc.</th>
<th>Reference &amp; Special sites</th>
<th>Earth and Beyond</th>
</tr>
<tr>
<td>
<!-- Computer Software, etc. -->
<ul>
<li><a href="">Portable Apps</a></li>
<li><a href="http://www.newfreeware.com/">NewFreeware</a></li>
<li>
<a href="http://www.makeuseof.com/tag/portable-software-usb/">Portable Software</a>
</li>
<li>
<a href="http://www.portablefreeware.com/">Portable Freeware Collection</a>
</li>
</ul>
</td>
<td>
<!-- Reference and Special sites -->
<ul>
<li><a href="http://www.glossarist.com/default.asp">Glossaries</a>
</li>
<li><a href="http://www.convert-me.com/en/">Converters</a></li>
<li>
<a href="http://decoder.americom.com/cgi-bin/decoder.cgi">DECODE</a>
</li>
<li><a href="http://www.rxlist.com/">Drugs</a></li>
<li><a href="http://www.ncbi.nlm.nih.gov/PubMed/">Medline</a></li>
<li>
<a href="http://www.logos.it/dictionary/owa/sp?lg=EN">Translation</a>
</li>
<li><a href="http://www.onelook.com/">One Look</a></li>
<li><a href="http://www.defenselink.mil/">US Military</a></li>
<li><a href="http://www.fedworld.gov/">US Fed</a></li>
<li><a href="http://www.ih2000.net/ira/legal.htm">Legal</a></li>
<li><a href="http://www.nih.gov/">NIH</a></li>
<li><a href="http://www.refdesk.com/">RefDESK</a></li>
<li><a href="http://www.britannica.com/">Britannica</a></li>
<li><a href="http://www.capitolimpact.com/gw/">States</a></li>
<li><a href="http://www.packtrack.com/">PackTrack</a></li>
<li><a href="http://www.acronymfinder.com/">Acronym</a></li>
<li><a href="http://www.visualthesaurus.com/">V-Thes</a></li>
<li>
<a href="http://www.timelineindex.com/content/home/forced">Timelines</a>
</li>
<li><a href="http://en.wikipedia.org/wiki/Main_Page">Wikipedia</a>
</li>
</ul>
</td>
<td>
<!-- Good Reading Misc. -->
<ul>
<li><a href="http://enbarsenal.com">ENB Arsenal</a></li>
<li><a href="http://enb.wikia.com/">ENB Wikia</a></li>
<li><a href="http://enb.gearlist.co.uk/">Gear List</a></li>
<li><a href='http://forum.enb-emulator.com/'>Emu Forum</a></li>
<li><a href="http://net-7.org/wiki/index.php?title=Main_Page">Net 7 Wiki</a></li>
</ul>
</td>
</tr>
<tr>
<td colspan="3" class="footer">
<div id='weather'></div>
</td>
</tr>
</table>
</div>
<div id="container"></div>
</body>
<script src="app.js"></script>
</html>

View File

@ -0,0 +1,33 @@
<%
var d = new Date();
%>
<table>
<tr>
<th>Item</th>
<th>Cost</th>
<th>BTC</th>
<th>Value</th>
</tr>
<% for( var i=0;i<items.length;i++)
{
var coins = items[i].usd / usd;
var v = coins * gbp;
%>
<tr>
<td><%=link_to(items[i].title, items[i].url)%></td>
<td>&#36;<%=items[i].usd.toFixed(2) %></td>
<td><%=coins.toFixed(4) %></td>
<td>&pound;<%=v.toFixed(2) %></td>
</tr>
<%
}
%>
</table>
Last Update <%=d.toLocaleString()%>

222
app/watch.html Normal file
View File

@ -0,0 +1,222 @@
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="watchlist.json.js"></script>
<script src="libs/ejs.js"></script>
<script src="libs/view.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/zepto/1.1.4/zepto.min.js"></script>
<style type="text/css" media="all">
body {
text-align: center;
background: #C9C5C2;
margin: auto;
}
.container {
text-align: left;
position: relative;
width: 960px;
background: #FFF;
border: 2px solid #FFF;
-moz-box-shadow: 3px 3px 3px #aaa;
-webkit-box-shadow: 3px 3px 3px #aaa;
box-shadow: 3px 3px 3px #aaa;
margin: 18px auto;
padding: 0;
}
body, ul, ol, dl, h1, h2, h3, h4, h5, h6, td, th, caption, pre, p, blockquote, input, textarea {
font: .9em 'Helvetica Neue', Helvetica, 'Lucida Grande', 'Lucida Sans Unicode', sans-serif;
color: #333;
}
a {
color: #000;
text-decoration: underline;
white-space: nowrap;
}
a:visited {
color: #666;
}
h1, h2, h3, h4, h5, h6 {
font-family: 'Helvetica Neue', Helvetica, 'Lucida Grande', 'Lucida Sans Unicode', sans-serif;
color: #FFF;
margin: 0;
padding: 9px 0;
}
h1 a, h1 a:visited {
color: #EEE;
}
h1 a:hover {
color: #CCC;
}
h1 {
font-size: 18px;
background: teal;
border-bottom: 3px solid #80007e;
padding: 9px 0 9px 9px;
}
.small {
font-size: .8em;
}
h2 {
font-size: 12px;
background: #DDD;
border-bottom: 1px solid #80007e;
color: #333;
margin-top: 0;
padding: 9px 0 9px 9px;
}
h3 {
font-size: 18px;
}
ul {
margin: 0;
padding: 0;
}
li {
display: inline;
margin: 0;
padding: 0 4px 0 0;
}
table {
width: 100%;
border-spacing: 10px;
}
th {
width: 33%;
font-size: 16px;
font-weight: 700;
line-height: 24px;
border-bottom: 1px solid #80007e;
color: #333;
}
td {
vertical-align: top;
background: #FFF;
padding: 0 0 6px;
}
td.footer {
background: #8abbd7;
padding: 10px;
}
.red:hover {
color: blue;
}
.floatright {
float: right;
padding-right: 10px;
}
.floatleft {
float: left;
padding-left: 10px;
}
a:hover, .red {
color: #C00;
}
.dates {
padding: 2px;
border: solid 1px #80007e;
background-color: #ffffff;
}
#btc {
font-size: 75%;
}
.up {
color: darkgreen;
}
.down {
color: darkred;
}
.nochange {
color: #000000;
}
</style>
</head>
<body>
<div id="area">
</div>
</body>
<script>
var elm = $('#area');
var updateDisplay = function()
{
var html = new EJS({url: '/template/watchlist.ejs'}).render(list);
elm.html(html);
};
var btcValue = function() {
// console.log("getting btc");
var url = '/btc';
// let's show a map or do something interesting!
$.ajax({
type: 'GET',
url: url,
data: '',
dataType: 'json',
timeout: 10000,
//contentType: ('application/json'),
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'PUT, GET, POST, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type'
},
success: function(data) {
// console.log(data);
list.gbp = data.bpi.GBP.rate_float;
list.usd = data.bpi.USD.rate_float;
console.log(list);
updateDisplay();
//updateBTC(gbp,usd);
//$('#weather').text(data.currently.summary + " " + ((5.0 / 9.0 * (data.currently.temperature - 32))));
},
error: function(xhr, type) {
console.log("ajax error");
console.log(xhr);
console.log(type);
}
});
};
btcValue();
var _timer = setInterval(function(){btcValue()},(60000));
</script>
</html>

36
app/watchlist.json.js Normal file
View File

@ -0,0 +1,36 @@
var list={
items:[
{
title:'DMC-GM1',
url:'http://coinsfortech.com/shop/panasonic-lumix-dmc-gm1-with-12-32mm-lens/',
usd:508.00
},
{
title:'Intel NUC D54250WYK',
url:'http://coinsfortech.com/shop/intel-nuc-kit-d54250wyk-mini-desktop-pc/',
usd:496.00
},
{
title:'Moto 360 Smart Watch',
url:'http://coinsfortech.com/shop/moto-360-smart-watch/',
usd:355.00
},
{
title:'Nikon D600 24-85mm lens kit',
url:'http://coinsfortech.com/shop/nikon-d600-24-85mm-lens-ki/',
usd:2048.00
},
{
title:'Nikon D5300 18-55mm and 55-200mm Twin Lens Kit',
url:'http://coinsfortech.com/shop/nikon-d5300-18-55mm-and-55-200mm-twin-lens-kit/',
usd:882.00
},
{
title:'Full NUC @ e4btc.com',
url:'https://e4btc.com/cart',
usd:668.542
}
]
};

45
lib/btc.js Normal file
View File

@ -0,0 +1,45 @@
var http = require('http');
var btcCache = {};
exports.doBTC = function (req,res) {
console.log('Bitcoin request');
function btcQuery(callback, r) {
var req = r;
var options = {
host: 'api.coindesk.com',
// port: 80,
path: '/v1/bpi/currentprice.json',
// method: 'GET',
headers: {
/* 'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(data)*/
}
};
http.request(options).on('response', function (response) {
var data = '';
response.on("data", function (chunk) {
data += chunk;
});
response.on('end', function () {
callback(JSON.parse(data), r);
});
}).end();
}
var now = new Date();
if (now - GLOBAL.lastcheck > (59000 )) {
btcQuery(function (a, b) {
console.log(a);
btcCache = a;
GLOBAL.lastcheck = now;
res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify(btcCache));
}, res)
}
else {
console.log("Using cache");
res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify(btcCache));
}
};

2
lib/btc.min.js vendored Normal file
View File

@ -0,0 +1,2 @@
var http=require("http"),btcCache={};exports.doBTC=function(e,o){function n(e,o){var n={host:"api.coindesk.com",path:"/v1/bpi/currentprice.json",headers:{}};http.request(n).on("response",function(n){var r="";n.on("data",function(e){r+=e}),n.on("end",function(){e(JSON.parse(r),o)})}).end()}console.log("Bitcoin request");var r=new Date;r-GLOBAL.lastcheck>59e3?n(function(e){console.log(e),btcCache=e,GLOBAL.lastcheck=r,o.setHeader("Content-Type","application/json"),o.end(JSON.stringify(btcCache))},o):(console.log("Using cache"),o.setHeader("Content-Type","application/json"),o.end(JSON.stringify(btcCache)))};
//# sourceMappingURL=btc.min.js.map

1
lib/btc.min.js.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["btc.js"],"names":["http","require","btcCache","exports","doBTC","req","res","btcQuery","callback","r","options","host","path","headers","request","on","response","data","chunk","JSON","parse","end","console","log","now","Date","GLOBAL","lastcheck","a","setHeader","stringify"],"mappings":"AAAC,GAAIA,MAAOC,QAAQ,QAChBC,WACJC,SAAQC,MAAQ,SAAUC,EAAIC,GAEtB,QAASC,GAASC,EAAUC,GACxB,GACIC,IACAC,KAAM,mBAENC,KAAM,4BAENC,WAOJb,MAAKc,QAAQJ,GAASK,GAAG,WAAY,SAAUC,GAC3C,GAAIC,GAAO,EACXD,GAASD,GAAG,OAAQ,SAAUG,GAC1BD,GAAQC,IAEZF,EAASD,GAAG,MAAO,WACfP,EAASW,KAAKC,MAAMH,GAAOR,OAEhCY,MAvBPC,QAAQC,IAAI,kBA0BZ,IAAIC,GAAM,GAAIC,KACVD,GAAME,OAAOC,UAAY,KACzBpB,EAAS,SAAUqB,GACfN,QAAQC,IAAIK,GACZ1B,SAAW0B,EACXF,OAAOC,UAAYH,EACnBlB,EAAIuB,UAAU,eAAgB,oBAC9BvB,EAAIe,IAAIF,KAAKW,UAAU5B,YACxBI,IAGHgB,QAAQC,IAAI,eACZjB,EAAIuB,UAAU,eAAgB,oBAC9BvB,EAAIe,IAAIF,KAAKW,UAAU5B"}

46
lib/fx.js Normal file
View File

@ -0,0 +1,46 @@
var http = require('http');
var fxCache = {};
exports.doFx = function (req,res) {
console.log('FX request');
function fxQuery(callback, r) {
var req = r;
var options = {
host: 'openexchangerates.org',
// port: 80,
path: '/api/latest.json?app_id=0eb932cee3bc40259f824d4b4c96c7d2',
// method: 'GET',
headers: {
/* 'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(data)*/
}
};
http.request(options).on('response', function (response) {
var data = '';
response.on("data", function (chunk) {
data += chunk;
});
response.on('end', function () {
callback(JSON.parse(data), r);
});
}).end();
}
var now = new Date();
if (now - GLOBAL.lastcheck > (60000 * 14)) {
fxQuery(function (a, b) {
console.log(a);
fxCache = a;
GLOBAL.lastcheck = now;
res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify(fxCache));
}, res);
}
else {
console.log("Using cache");
res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify(fxCache));
}
};

2
lib/fx.min.js vendored Normal file
View File

@ -0,0 +1,2 @@
var http=require("http"),fxCache={};exports.doFx=function(e,o){function n(e,o){var n={host:"openexchangerates.org",path:"/api/latest.json?app_id=0eb932cee3bc40259f824d4b4c96c7d2",headers:{}};http.request(n).on("response",function(n){var r="";n.on("data",function(e){r+=e}),n.on("end",function(){e(JSON.parse(r),o)})}).end()}console.log("FX request");var r=new Date;r-GLOBAL.lastcheck>84e4?n(function(e){console.log(e),fxCache=e,GLOBAL.lastcheck=r,o.setHeader("Content-Type","application/json"),o.end(JSON.stringify(fxCache))},o):(console.log("Using cache"),o.setHeader("Content-Type","application/json"),o.end(JSON.stringify(fxCache)))};
//# sourceMappingURL=fx.min.js.map

1
lib/fx.min.js.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["fx.js"],"names":["http","require","fxCache","exports","doFx","req","res","fxQuery","callback","r","options","host","path","headers","request","on","response","data","chunk","JSON","parse","end","console","log","now","Date","GLOBAL","lastcheck","a","setHeader","stringify"],"mappings":"AAAC,GAAIA,MAAOC,QAAQ,QAChBC,UACJC,SAAQC,KAAO,SAAUC,EAAIC,GAErB,QAASC,GAAQC,EAAUC,GACvB,GACIC,IACAC,KAAM,wBAENC,KAAM,2DAENC,WAOJb,MAAKc,QAAQJ,GAASK,GAAG,WAAY,SAAUC,GAC3C,GAAIC,GAAO,EACXD,GAASD,GAAG,OAAQ,SAAUG,GAC1BD,GAAQC,IAEZF,EAASD,GAAG,MAAO,WACfP,EAASW,KAAKC,MAAMH,GAAOR,OAEhCY,MAvBPC,QAAQC,IAAI,aA0BZ,IAAIC,GAAM,GAAIC,KACVD,GAAME,OAAOC,UAAY,KACzBpB,EAAQ,SAAUqB,GACdN,QAAQC,IAAIK,GACZ1B,QAAU0B,EACVF,OAAOC,UAAYH,EACnBlB,EAAIuB,UAAU,eAAgB,oBAC9BvB,EAAIe,IAAIF,KAAKW,UAAU5B,WACxBI,IAGHgB,QAAQC,IAAI,eACZjB,EAAIuB,UAAU,eAAgB,oBAC9BvB,EAAIe,IAAIF,KAAKW,UAAU5B"}

130
lib/train.js Normal file
View File

@ -0,0 +1,130 @@
// train.js
var http = require('http');
var trainCache = {
last: {},
data: {}
};
module.exports = {
dbe_glq: function(req, res) {
// http://huxley.apphb.com/all/dbe/to/glq/1?accessToken=215b99fe-b237-4a01-aadc-cf315d6756d8
// http://huxley.apphb.com/all/dbe/from/glq/1?accessToken=215b99fe-b237-4a01-aadc-cf315d6756d8
console.log('DBE:GLQ request');
function Query(callback, r) {
var req = r;
var options = {
host: 'huxley.apphb.com',
// port: 80,
path: '/next/dbe/to/glq/1?accessToken=215b99fe-b237-4a01-aadc-cf315d6756d8',
//method: 'GET',
headers: {
}
};
try {
http.request(options).on('response', function(response) {
var data = '';
response.on("data", function(chunk) {
data += chunk;
});
response.on('end', function() {
callback(JSON.parse(data), r);
});
}).end();
} catch (e) {
console.log(e);
}
}
var now = new Date();
var nowSeconds = (now.getHours() * (60 * 60)) + (now.getMinutes() * 60);
console.log('Now Seconds: ' + nowSeconds);
if (trainCache.last.dbeglq == null || nowSeconds != trainCache.last.dbeglq) {
Query(function(a, b) {
//console.log(a);
var ts = a.departures[0].service;
var output = {};
//GLOBAL.lastcheck = now;
console.log(ts.sta);
// console.log(toSeconds(ts.sta));
output.sta = ts.sta;
output.eta = ts.eta;
trainCache.data.dbeglq = output;
// trainCache.last.dbeglq = toSeconds(ts.sta);
// console.log(ts);
res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify(trainCache.data.dbeglq));
}, res);
}
},
glq_dbe: function(req, res) {
// http://huxley.apphb.com/all/dbe/to/glq/1?accessToken=215b99fe-b237-4a01-aadc-cf315d6756d8
// http://huxley.apphb.com/all/dbe/from/glq/1?accessToken=215b99fe-b237-4a01-aadc-cf315d6756d8
console.log('GLQ:DBE request');
function Query(callback, r) {
var req = r;
var options = {
host: 'huxley.apphb.com',
// port: 80,
path: '/next/dbe/from/glq/1?accessToken=215b99fe-b237-4a01-aadc-cf315d6756d8',
//method: 'GET',
headers: {
}
};
try {
http.request(options).on('response', function(response) {
var data = '';
response.on("data", function(chunk) {
data += chunk;
});
response.on('end', function() {
callback(JSON.parse(data), r);
});
}).end();
} catch (e) {
console.log(e);
}
}
var now = new Date();
var nowSeconds = (now.getHours() * (60 * 60)) + (now.getMinutes() * 60);
console.log('Now Seconds: ' + nowSeconds);
if (trainCache.last.glqdbe == null || nowSeconds != trainCache.last.dbeglq) {
Query(function(a, b) {
//console.log(a);
var ts = a.departures[0].service;
var output = {};
//GLOBAL.lastcheck = now;
console.log(ts.sta);
console.log(toSeconds(ts.sta));
output.sta = ts.sta;
output.eta = ts.eta;
trainCache.data.glqdbe = output;
// trainCache.last.glqdbe = toSeconds(ts.sta);
// console.log(ts);
res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify(trainCache.data.glqdbe));
}, res);
}
}
};
function toSeconds(inval) {
var a = inval.split(':');
return ((parseInt(a[0]) * (60 * 60)) + (parseInt(a[1]) * 60));
}

2
lib/train.min.js vendored Normal file
View File

@ -0,0 +1,2 @@
function toSeconds(e){var t=e.split(":");return 3600*parseInt(t[0])+60*parseInt(t[1])}var http=require("http"),trainCache={last:{},data:{}};module.exports={dbe_glq:function(e,t){function n(e,t){var n={host:"huxley.apphb.com",path:"/next/dbe/to/glq/1?accessToken=215b99fe-b237-4a01-aadc-cf315d6756d8",headers:{}};try{http.request(n).on("response",function(n){var o="";n.on("data",function(e){o+=e}),n.on("end",function(){e(JSON.parse(o),t)})}).end()}catch(o){console.log(o)}}console.log("DBE:GLQ request");var o=new Date,a=3600*o.getHours()+60*o.getMinutes();console.log("Now Seconds: "+a),(null==trainCache.last.dbeglq||a!=trainCache.last.dbeglq)&&n(function(e){var n=e.departures[0].service,o={};console.log(n.sta),o.sta=n.sta,o.eta=n.eta,trainCache.data.dbeglq=o,t.setHeader("Content-Type","application/json"),t.end(JSON.stringify(trainCache.data.dbeglq))},t)},glq_dbe:function(e,t){function n(e,t){var n={host:"huxley.apphb.com",path:"/next/dbe/from/glq/1?accessToken=215b99fe-b237-4a01-aadc-cf315d6756d8",headers:{}};try{http.request(n).on("response",function(n){var o="";n.on("data",function(e){o+=e}),n.on("end",function(){e(JSON.parse(o),t)})}).end()}catch(o){console.log(o)}}console.log("GLQ:DBE request");var o=new Date,a=3600*o.getHours()+60*o.getMinutes();console.log("Now Seconds: "+a),(null==trainCache.last.glqdbe||a!=trainCache.last.dbeglq)&&n(function(e){var n=e.departures[0].service,o={};console.log(n.sta),console.log(toSeconds(n.sta)),o.sta=n.sta,o.eta=n.eta,trainCache.data.glqdbe=o,t.setHeader("Content-Type","application/json"),t.end(JSON.stringify(trainCache.data.glqdbe))},t)}};
//# sourceMappingURL=train.min.js.map

1
lib/train.min.js.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["train.js"],"names":["toSeconds","inval","a","split","parseInt","http","require","trainCache","last","data","module","exports","dbe_glq","req","res","Query","callback","r","options","host","path","headers","request","on","response","chunk","JSON","parse","end","e","console","log","now","Date","nowSeconds","getHours","getMinutes","dbeglq","ts","departures","service","output","sta","eta","setHeader","stringify","glq_dbe","glqdbe"],"mappings":"AA6HA,QAASA,WAAUC,GACf,GAAIC,GAAID,EAAME,MAAM,IACpB,OAA0B,MAAjBC,SAASF,EAAE,IAAqC,GAAjBE,SAASF,EAAE,IA9HvD,GAAIG,MAAOC,QAAQ,QACfC,YACAC,QACAC,QAGJC,QAAOC,SAGHC,QAAS,SAASC,EAAKC,GAOnB,QAASC,GAAMC,EAAUC,GACrB,GACIC,IACAC,KAAM,mBAENC,KAAM,sEAENC,WAIJ,KACIhB,KAAKiB,QAAQJ,GAASK,GAAG,WAAY,SAASC,GAC1C,GAAIf,GAAO,EACXe,GAASD,GAAG,OAAQ,SAASE,GACzBhB,GAAQgB,IAEZD,EAASD,GAAG,MAAO,WACfP,EAASU,KAAKC,MAAMlB,GAAOQ,OAEhCW,MACL,MAAOC,GACLC,QAAQC,IAAIF,IAxBpBC,QAAQC,IAAI,kBA4BZ,IAAIC,GAAM,GAAIC,MACVC,EAA+B,KAAjBF,EAAIG,WAA8C,GAAnBH,EAAII,YACrDN,SAAQC,IAAI,gBAAkBG,IACA,MAA1B3B,WAAWC,KAAK6B,QAAkBH,GAAc3B,WAAWC,KAAK6B,SAChEtB,EAAM,SAASb,GAEX,GAAIoC,GAAKpC,EAAEqC,WAAW,GAAGC,QACrBC,IAEJX,SAAQC,IAAIO,EAAGI,KAGfD,EAAOC,IAAMJ,EAAGI,IAChBD,EAAOE,IAAML,EAAGK,IAChBpC,WAAWE,KAAK4B,OAASI,EAGzB3B,EAAI8B,UAAU,eAAgB,oBAC9B9B,EAAIc,IAAIF,KAAKmB,UAAUtC,WAAWE,KAAK4B,UACxCvB,IAIXgC,QAAS,SAASjC,EAAKC,GAOnB,QAASC,GAAMC,EAAUC,GACrB,GACIC,IACAC,KAAM,mBAENC,KAAM,wEAENC,WAIJ,KACIhB,KAAKiB,QAAQJ,GAASK,GAAG,WAAY,SAASC,GAC1C,GAAIf,GAAO,EACXe,GAASD,GAAG,OAAQ,SAASE,GACzBhB,GAAQgB,IAEZD,EAASD,GAAG,MAAO,WACfP,EAASU,KAAKC,MAAMlB,GAAOQ,OAEhCW,MACL,MAAOC,GACLC,QAAQC,IAAIF,IAxBpBC,QAAQC,IAAI,kBA4BZ,IAAIC,GAAM,GAAIC,MACVC,EAA+B,KAAjBF,EAAIG,WAA8C,GAAnBH,EAAII,YACrDN,SAAQC,IAAI,gBAAkBG,IACA,MAA1B3B,WAAWC,KAAKuC,QAAkBb,GAAc3B,WAAWC,KAAK6B,SAChEtB,EAAM,SAASb,GAEX,GAAIoC,GAAKpC,EAAEqC,WAAW,GAAGC,QACrBC,IAEJX,SAAQC,IAAIO,EAAGI,KACfZ,QAAQC,IAAI/B,UAAUsC,EAAGI,MAEzBD,EAAOC,IAAMJ,EAAGI,IAChBD,EAAOE,IAAML,EAAGK,IAChBpC,WAAWE,KAAKsC,OAASN,EAGzB3B,EAAI8B,UAAU,eAAgB,oBAC9B9B,EAAIc,IAAIF,KAAKmB,UAAUtC,WAAWE,KAAKsC,UACxCjC"}

12
package.json Normal file
View File

@ -0,0 +1,12 @@
{
"name": "silvrtree",
"version": "0.1.1",
"devDependencies": {
"mongodb": "*",
"node-rss": "^1.0.1",
"pg": "*"
},
"dependencies": {
"express": "3.x"
}
}

3
routes/btc.js Normal file
View File

@ -0,0 +1,3 @@
/**
* Created by martind on 14/11/14.
*/

66
web-server.js Normal file
View File

@ -0,0 +1,66 @@
var express = require('express'), path = require('path'), http = require('http'), fx = require('./lib/fx'), btc = require('./lib/btc'), train = require('./lib/train')
//train = require('lib/train')
/* ,submit = require('./routes/mongo/submit') */
;
var app = express();
GLOBAL.lastcheck = 0;
var btcCache = {}, fxCache = {} , trainCache = {};
app.configure(function () {
app.set('port', process.env.PORT || 4545);
app.use(express.logger('dev'));
app.use(express.cookieParser());
app.use(express.session({secret: '1234567890QWERTY'}));
/* 'default', 'short', 'tiny', 'dev' */
app.use(express.methodOverride());
app.use(express.bodyParser());
app.use(function (req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
next();
});
app.use(app.router);
app.use(express.static(path.join(__dirname, 'app')));
app.use(express.errorHandler({dumpExceptions: true, showStack: true}));
app.use('/btc', btc.doBTC);
app.use('/fx', fx.doFx);
app.use('/dbeglq', train.dbe_glq);
app.use('/glqdbe', train.glq_dbe);
app.use('/lot', function (req, res) {
var pg = require('pg');
var conString = "postgres://pguser:1V3D4m526i@localhost/silver";
console.log(conString);
var client = new pg.Client(conString);
var q = 'select * from lot order by d desc';
client.connect(function(err) {
if(err) {
return console.error('could not connect to postgres', err);
}
client.query(q, function(err, result) {
if(err) {
return console.error('error running query', err);
}
console.log(result.rows[0].theTime);
//output: Tue Jan 15 2013 19:12:47 GMT-600 (CST)
client.end();
});
});
});
});
/**
* create the server
*/
http.createServer(app).listen(app.get('port'), function () {
console.log("Express server listening on port " + app.get('port'));
});

2
web-server.min.js vendored Normal file
View File

@ -0,0 +1,2 @@
var express=require("express"),path=require("path"),http=require("http"),fx=require("./lib/fx"),btc=require("./lib/btc"),train=require("./lib/train"),app=express();GLOBAL.lastcheck=0;var btcCache={},fxCache={},trainCache={};app.configure(function(){app.set("port",process.env.PORT||4545),app.use(express.logger("dev")),app.use(express.cookieParser()),app.use(express.session({secret:"1234567890QWERTY"})),app.use(express.methodOverride()),app.use(express.bodyParser()),app.use(function(e,t,o){t.header("Access-Control-Allow-Origin","*"),t.header("Access-Control-Allow-Headers","X-Requested-With"),o()}),app.use(app.router),app.use(express.static(path.join(__dirname,"app"))),app.use(express.errorHandler({dumpExceptions:!0,showStack:!0})),app.use("/btc",btc.doBTC),app.use("/fx",fx.doFx),app.use("/dbeglq",train.dbe_glq),app.use("/glqdbe",train.glq_dbe),app.use("/lot",function(){var e=require("pg"),t="postgres://pguser:1V3D4m526i@localhost/silver";console.log(t);var o=new e.Client(t),n="select * from lot order by d desc";o.connect(function(e){return e?console.error("could not connect to postgres",e):void o.query(n,function(e,t){return e?console.error("error running query",e):(console.log(t.rows[0].theTime),void o.end())})})})}),http.createServer(app).listen(app.get("port"),function(){console.log("Express server listening on port "+app.get("port"))});
//# sourceMappingURL=web-server.min.js.map

1
web-server.min.js.map Normal file
View File

@ -0,0 +1 @@
{"version":3,"sources":["web-server.js"],"names":["express","require","path","http","fx","btc","train","app","GLOBAL","lastcheck","btcCache","fxCache","trainCache","configure","set","process","env","PORT","use","logger","cookieParser","session","secret","methodOverride","bodyParser","req","res","next","header","router","static","join","__dirname","errorHandler","dumpExceptions","showStack","doBTC","doFx","dbe_glq","glq_dbe","pg","conString","console","log","client","Client","q","connect","err","error","query","result","rows","theTime","end","createServer","listen","get"],"mappings":"AAAA,GAAIA,SAAUC,QAAQ,WAAYC,KAAOD,QAAQ,QAASE,KAAOF,QAAQ,QAASG,GAAKH,QAAQ,YAAaI,IAAMJ,QAAQ,aAAcK,MAAQL,QAAQ,eAIpJM,IAAMP,SACVQ,QAAOC,UAAY,CACnB,IAAIC,aAAeC,WAAeC,aAElCL,KAAIM,UAAU,WACVN,IAAIO,IAAI,OAAQC,QAAQC,IAAIC,MAAQ,MACpCV,IAAIW,IAAIlB,QAAQmB,OAAO,QACvBZ,IAAIW,IAAIlB,QAAQoB,gBAChBb,IAAIW,IAAIlB,QAAQqB,SAASC,OAAQ,sBAEjCf,IAAIW,IAAIlB,QAAQuB,kBAEhBhB,IAAIW,IAAIlB,QAAQwB,cAEhBjB,IAAIW,IAAI,SAAUO,EAAKC,EAAKC,GACxBD,EAAIE,OAAO,8BAA+B,KAC1CF,EAAIE,OAAO,+BAAgC,oBAC3CD,MAEJpB,IAAIW,IAAIX,IAAIsB,QACZtB,IAAIW,IAAIlB,QAAQ8B,OAAO5B,KAAK6B,KAAKC,UAAW,SAC5CzB,IAAIW,IAAIlB,QAAQiC,cAAcC,gBAAgB,EAAMC,WAAW,KAE/D5B,IAAIW,IAAI,OAAQb,IAAI+B,OAEpB7B,IAAIW,IAAI,MAAOd,GAAGiC,MAElB9B,IAAIW,IAAI,UAAWZ,MAAMgC,SAEzB/B,IAAIW,IAAI,UAAWZ,MAAMiC,SAEzBhC,IAAIW,IAAI,OAAQ,WACZ,GAAIsB,GAAKvC,QAAQ,MAEbwC,EAAY,+CAChBC,SAAQC,IAAIF,EAGZ,IAAIG,GAAS,GAAIJ,GAAGK,OAAOJ,GACvBK,EAAI,mCACRF,GAAOG,QAAQ,SAASC,GACpB,MAAGA,GACQN,QAAQO,MAAM,gCAAiCD,OAE1DJ,GAAOM,MAAMJ,EAAG,SAASE,EAAKG,GAC1B,MAAGH,GACQN,QAAQO,MAAM,sBAAuBD,IAEhDN,QAAQC,IAAIQ,EAAOC,KAAK,GAAGC,aAE3BT,GAAOU,eASvBnD,KAAKoD,aAAahD,KAAKiD,OAAOjD,IAAIkD,IAAI,QAAS,WAC3Cf,QAAQC,IAAI,oCAAsCpC,IAAIkD,IAAI"}

145
web-server.old.js Normal file
View File

@ -0,0 +1,145 @@
var express = require('express'), path = require('path'), http = require('http')
/* ,submit = require('./routes/mongo/submit') */
;
var app = express();
var lastcheck = 0;
var btcCache = {}, fxCache = {} , trainCache = {};
app.configure(function () {
app.set('port', process.env.PORT || 9000);
app.use(express.logger('dev'));
app.use(express.cookieParser());
app.use(express.session({secret: '1234567890QWERTY'}));
/* 'default', 'short', 'tiny', 'dev' */
app.use(express.methodOverride());
app.use(express.bodyParser());
app.use(function (req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
next();
});
app.use(app.router);
app.use(express.static(path.join(__dirname, 'app')));
app.use(express.errorHandler({dumpExceptions: true, showStack: true}));
app.use('/btc', function (req, res) {
console.log('Bitcoin request');
function btcQuery(callback, r) {
var req = r;
var options = {
host: 'api.coindesk.com',
// port: 80,
path: '/v1/bpi/currentprice.json',
// method: 'GET',
headers: {
/* 'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(data)*/
}
};
http.request(options).on('response', function (response) {
var data = '';
response.on("data", function (chunk) {
data += chunk;
});
response.on('end', function () {
callback(JSON.parse(data), r);
});
}).end();
}
var now = new Date();
if (now - lastcheck > (59000 )) {
btcQuery(function (a, b) {
console.log(a);
btcCache = a;
lastcheck = now;
res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify(btcCache));
}, res)
}
else {
console.log("Using cache");
res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify(btcCache));
}
});
app.use('/fx', function (req, res) {
console.log('FX request');
function fxQuery(callback, r) {
var req = r;
var options = {
host: 'openexchangerates.org',
// port: 80,
path: '/api/latest.json?app_id=0eb932cee3bc40259f824d4b4c96c7d2',
// method: 'GET',
headers: {
/* 'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(data)*/
}
};
http.request(options).on('response', function (response) {
var data = '';
response.on("data", function (chunk) {
data += chunk;
});
response.on('end', function () {
callback(JSON.parse(data), r);
});
}).end();
}
var now = new Date();
if (now - lastcheck > (60000 * 14)) {
fxQuery(function (a, b) {
console.log(a);
fxCache = a;
lastcheck = now;
res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify(fxCache));
}, res);
}
else {
console.log("Using cache");
res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify(fxCache));
}
});
app.use('/lot', function (req, res) {
var pg = require('pg');
var conString = "postgres://pguser:1V3D4m526i@localhost/silver";
console.log(conString);
var client = new pg.Client(conString);
var q = 'select * from lot order by d desc';
client.connect(function(err) {
if(err) {
return console.error('could not connect to postgres', err);
}
client.query(q, function(err, result) {
if(err) {
return console.error('error running query', err);
}
console.log(result.rows[0].theTime);
//output: Tue Jan 15 2013 19:12:47 GMT-600 (CST)
client.end();
});
});
});
});
/**
* create the server
*/
http.createServer(app).listen(app.get('port'), function () {
console.log("Express server listening on port " + app.get('port'));
});

7
www/index.html Normal file
View File

@ -0,0 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>hello</body>
</html>

487
www/slack.htm Normal file
View File

@ -0,0 +1,487 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Slack</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<style type="text/css" media="all">
body { text-align: center; background: #C9C5C2; margin: auto; }
.container { text-align: left; position: relative; width: 960px; background: #FFF; border: 2px solid #FFF; -moz-box-shadow: 3px 3px 3px #aaa; -webkit-box-shadow: 3px 3px 3px #aaa; box-shadow: 3px 3px 3px #aaa; margin: 18px auto; padding: 0; }
body, ul, ol, dl, h1, h2, h3, h4, h5, h6, td, th, caption, pre, p, blockquote, input, textarea { font: .9em 'Helvetica Neue', Helvetica, 'Lucida Grande', 'Lucida Sans Unicode', sans-serif; color: #333; }
a { color: #000; text-decoration: underline; white-space: nowrap; }
a:visited { color: #666; }
h1, h2, h3, h4, h5, h6 { font-family: 'Helvetica Neue', Helvetica, 'Lucida Grande', 'Lucida Sans Unicode', sans-serif; color: #FFF; margin: 0; padding: 9px 0; }
h1 a, h1 a:visited { color: #EEE; }
h1 a:hover { color: #CCC; }
h1 { font-size: 18px; background: teal; border-bottom: 3px solid #80007e; padding: 9px 0 9px 9px; }
.small { font-size: .8em; }
h2 { font-size: 12px; background: #DDD; border-bottom: 1px solid #80007e; color: #333; margin-top: 0; padding: 9px 0 9px 9px; }
h3 { font-size: 18px; }
ul { margin: 0; padding: 0; }
li { display: inline; margin: 0; padding: 0 4px 0 0; }
table { width: 100%; border-spacing: 10px; }
th { width: 33%; font-size: 16px; font-weight: 700; line-height: 24px; border-bottom: 1px solid #80007e; color: #333; }
td { vertical-align: top; background: #FFF; padding: 0 0 6px; }
td.footer { background: #8abbd7; padding: 10px; }
.red:hover { color: blue; }
.floatright { float: right; padding-right: 10px; }
.floatleft { float: left; padding-left: 10px; }
a:hover, .red { color: #C00; }
.dates { padding: 2px; border: solid 1px #80007e; background-color: #ffffff; }
</style>
</head>
<body>
<div class="container">
<h1 class="title">Slack - I have plenty of talent and vision I just don't give a damn</h1>
<div>
<h2><span id='one' class='dates'>----</span><span>&nbsp;&nbsp;</span><span
id='two' class='dates'>----</span><span>&nbsp;&nbsp;</span> <span
id='three' class='dates'>----</span>
</h2>
</div>
<table>
<tr>
<th>Starting Points/Metasites</th>
<th>Tools</th>
<th>Bitcoin</th>
</tr>
<tr>
<td>
<!-- Starting Points/Metasites -->
<ul>
<li>
<a href="http://www.unmajestic.com/home/bookmarks.php">Slack Bookmarks</a>
</li>
<li><a href="http://reader.google.com">GReader</a></li>
<li><a href="http://www.twitley.com">Twitley</a></li>
<li><a href="http://www.bloglines.com/myblogs">Bloglines</a></li>
<li><a href="http://www.facebook.com/">Facebook</a></li>
<li><a href="http://www.yahoo.com/">Yahoo!</a></li>
<li>
<a href="http://www.talk3g.co.uk/forumdisplay.php?f=100">Talk3G</a>
</li>
<li>
<a href="http://www.unmajestic.com/home/bookmarkshome.htm">Bookmarks</a>
</li>
</ul>
</td>
<td>
<!-- tools -->
<ul>
<li>
<a href="https://console.appfog.com/#apps">AppFog</a>
</li>
<li>
<a href="http://www.colorzilla.com/gradient-editor/">CSS Gradient Generator</a>
</li>
<li><a href="http://utilities-online.info/xmltojson">XML to JSON</a>
</li>
<li><a href="http://shancarter.com/data_converter">CSV to JSON</a>
</li>
<li><a href="http://cubic-bezier.com/">Cubic Bezier</a></li>
<li><a href="http://gskinner.com/RegExr/">RegEx Tool</a></li>
<li>
<a href="http://closure-compiler.appspot.com/home">Closure Compiler</a>
</li>
<li><a href="http://jsonlint.com/">JSON Lint</a></li>
<li><a href="http://jsoneditoronline.org/">JSON Editor</a></li>
<li><a href="http://www.base64decode.org/">Base64 Decoder</a></li>
<li><a href="http://jsbeautifier.org/">JS Beautifier</a></li>
<li><a href="http://spritepad.wearekiss.com/">Spritepad</a></li>
<li>
<a href="http://draeton.github.com/stitches/">Sprite Sheet Generator</a>
</li>
<li><a href="http://www.cleancss.com/">CSS Optimizer</a></li>
<li><a href="http://fontello.com/">Icon Font Generator</a></li>
<li><a href="http://html2jade.aaron-powell.com/">HTML to Jade</a></li>
<li><a href="http://cdnjs.com//">Cloudflare JS CDN</a></li>
</ul>
</td>
<td>
<!-- Bitcoin -->
<ul>
<li><a href="https://www.bitstamp.net">Bitstamp</a></li>
<li>
<a href="http://bitcoinity.org/markets/bitstamp/USD">BitStamp Chart</a>
</li>
<li>
<a href="http://btc-chart.com/market/bitstamp/86400">Bitstamp Chart 2</a>
</li>
<li><a href="https://mtgox.com/">Mt.Gox</a></li>
<li><a href="https://bitbargain.co.uk">BitBargin</a></li>
<li><a href="http://blockchain.info/">Blockchain</a></li>
<li><a href="http://bitminter.com/">Bitminter</a></li>
<li><a href="http://preev.com/">BTC Exchange Rate</a></li>
</ul>
</td>
</tr>
<tr>
<th>Computer News</th>
<th>Weather Reports</th>
<th>Free Email WEBpages</th>
</tr>
<tr>
<td>
<!-- Computer News -->
<ul>
<li><a href="http://www.pcmag.com/">PCMag</a></li>
<li><a href="http://www.newslinx.com/">Newslinx</a></li>
<li><a href="http://www.zdnet.com/zdnn"> ZDNet</a></li>
<li>
<a href="http://service.bfast.com/bfast/click?bfmid=1476905&amp;siteid=22078656&amp;bfpage=news_5">Bfast</a>
</li>
<li><a href="http://www.news.com/">News.com</a></li>
<li><a href="http://www.computerworld.com/">CW</a></li>
<li><a href="http://www.cmpnet.com/">TechW</a></li>
</ul>
</td>
<td>
<!-- Weather Reports -->
<ul>
<li>
<a href="http://www.accuweather.com/ukie/index-forecast.asp?postalcode=G82%201RG">Dumbarton Weather</a>
</li>
<li>
<a href="http://www.wunderground.com/cgi-bin/findweather/getForecast?query=dumbarton,%20uk&wuSelect=WEATHER">WU Dumbarton Weather</a>
</li>
<li>
<a href="http://weather.yahoo.com/forecast/UKXX0663.html?unit=c">Y! Dumbarton Weather</a>
</li>
<li>
<a href="http://www.accuweather.com/ukie/index-forecast.asp?postalcode=G9%202SU">Glasgow Weather</a>
</li>
<li>
<a href="http://www.wunderground.com/cgi-bin/findweather/getForecast?query=glasgow,%20uk&wuSelect=WEATHER">WU Glasgow Weather</a>
</li>
<li><a href="http://www.nowcast.co.uk/lightning/">Live Lightning</a>
</li>
<li>
<a href="http://www.upminsterweather.co.uk/test/live_lightning.htm">Other Live Lightning</a>
</li>
<li>
<a href="http://www.meteorologica.info/freedata_lightning.htm">Closer Live Lightning</a>
</li>
<li>
<a href="http://www.malvernwx.co.uk/lightning_data/lightning.htm">Multiple Lightning</a>
</li>
<li>
<a href="http://www.blitzortung.org/Webpages/index.php">European Lightning</a>
</li>
<li>
<a href="http://www.madpaddler.net/wxlightning.php">East Kilbride Lightning</a>
</li>
<li>
<a href="http://www.bordersweather.co.uk/wxlightning.php">Borders Lightning</a>
</li>
<li><a href="http://www.madpaddler.net/wxais.php">Ships</a></li>
</ul>
</td>
<td>
<!-- Free Email WEBpages -->
<ul>
<li><a href="http://gmail.google.com/">Gmail</a></li>
<li>
<a href="http://www.unmajestic.com/webmail/">Unmajestic Webmail</a>
</li>
<li>
<a href="http://www.artizanconsulting.co.uk/webmail/">Artizan Webmail</a>
</li>
<li><a href="http://mail.yahoo.com">Yahoo Mail</a></li>
<li>
<a href="https://www.guerrillamail.com/">Guerrilla Mail Anti Spam</a>
</li>
</ul>
</td>
</tr>
<tr>
<th>Job Searching</th>
<th>Entertainment</th>
<th>Travel</th>
</tr>
<tr>
<td>
<!-- Real News Related -->
<ul>
<li><a href="http://www.monster.co.uk/">monster</a></li>
<li><a href="http://www.cwjobs.co.uk/">cwjobs</a></li>
<li><a href="http://www.s1jobs.com/myaccount/">s1jobs</a></li>
<li><a href="http://www.jobserve.com/">jobserve</a></li>
<li><a href="http://www.jobsite.co.uk/jbe/myprofile/">jobsite</a>
</li>
<li>
<a href="http://www.itjobswatch.co.uk/contracts/scotland/asp.do">IT Jobs Watch Scotland</a>
</li>
</ul>
</td>
<td>
<!-- Entertainment -->
<ul>
<li>
<a href="http://www.cineworld.co.uk/cinemas/28?fallback=false&isMobileAgent=false">Cineworld</a>
</li>
<li>
<a href="http://www.showcasecinemas.co.uk/showtimes/default.asp?selectTheatre=8508">Showcase</a>
</li>
<li><a href="http://www.imdb.com/">Imdb</a></li>
<li><a href="http://www.epguides.com/">EPGuides</a></li>
<li><a href="http://eztv.it">Eztv</a></li>
<li><a href="http://www.mininova.org">Mininova</a></li>
<li><a href="http://www.scrapetorrent.com">Scrapetorrent</a></li>
<li>
<a href="http://glasgow.myvillage.com/events">Whats on In Glasgow</a>
</li>
<li><a href="http://www.5pm.co.uk/Search/Event/">Local Events</a>
</li>
</ul>
</td>
<td>
<!-- Travel -->
<ul>
<li>
<a href="http://www.bbc.co.uk/scotland/whereilive/travelscotland/home/regions/index.shtml?name=clyde&amp;place_name=Glasgow&amp;place_number=0006">travel news</a>
</li>
<li>
<a href="http://www.livedepartureboards.co.uk/ldb/summary.aspx?T=DBE">Dumbarton East Trains</a>
</li>
<li>
<a href="http://www.livedepartureboards.co.uk/ldb/summary.aspx?T=GLQ">Queen Street Trains</a>
</li>
<li><a href="http://www.kayak.co.uk/">Kayak</a></li>
<li><a href="http://www.travelocity.co.uk/">Travelocity</a></li>
<li><a href="http://www.travel.com/sitemap.htm">Travel.com</a></li>
<li>
<a href="http://www.landings.com/_landings/pages/commercial.html">Airlines</a>
</li>
<li><a href="http://www.flightstats.com">Landings</a></li>
<li>
<a href="http://www.lib.utexas.edu/Libs/PCL/Map_collection/map_sites/map_sites.html#general">Maps</a>
</li>
<li><a href="http://www.sitesatlas.com/Maps/">Maps2</a></li>
<li><a href="http://www.itn.net/">ITN</a></li>
<li><a href="http://bahn.hafas.de/bin/query.exe/en">HAFAS</a></li>
<li><a href="http://bahn.hafas.de/bin/query.exe/en">DieBahn</a></li>
<li><a href="http://www.cwrr.com/nmra/travelreg.html">RailUSA</a>
</li>
<li>
<a href="http://www.trainweb.com/frames_travel.html">TrainWeb</a>
</li>
<li><a href="http://www.cwrr.com/nmra/travelw2.html">RailWorld</a>
</li>
<li><a href="http://www.xe.net/currency/">Currency Converter</a>
</li>
<li>
<a href="http://www.cia.gov/cia/publications/factbook/index.html">CIA</a>
</li>
<li><a href="http://maps.google.com/">GMaps</a></li>
</ul>
</td>
</tr>
<tr>
<th>Computer Software, etc.</th>
<th>Reference &amp; Special sites</th>
<th>Internet Money</th>
</tr>
<tr>
<td>
<!-- Computer Software, etc. -->
<ul>
<li><a href="">Portable Apps</a></li>
<li><a href="http://www.newfreeware.com/">NewFreeware</a></li>
<li>
<a href="http://www.makeuseof.com/tag/portable-software-usb/">Portable Software</a>
</li>
<li>
<a href="http://www.portablefreeware.com/">Portable Freeware Collection</a>
</li>
</ul>
</td>
<td>
<!-- Reference and Special sites -->
<ul>
<li><a href="http://www.glossarist.com/default.asp">Glossaries</a>
</li>
<li><a href="http://www.convert-me.com/en/">Converters</a></li>
<li>
<a href="http://decoder.americom.com/cgi-bin/decoder.cgi">DECODE</a>
</li>
<li><a href="http://www.rxlist.com/">Drugs</a></li>
<li><a href="http://www.ncbi.nlm.nih.gov/PubMed/">Medline</a></li>
<li>
<a href="http://www.logos.it/dictionary/owa/sp?lg=EN">Translation</a>
</li>
<li><a href="http://www.onelook.com/">One Look</a></li>
<li><a href="http://www.defenselink.mil/">US Military</a></li>
<li><a href="http://www.fedworld.gov/">US Fed</a></li>
<li><a href="http://www.ih2000.net/ira/legal.htm">Legal</a></li>
<li><a href="http://www.nih.gov/">NIH</a></li>
<li><a href="http://www.refdesk.com/">RefDESK</a></li>
<li><a href="http://www.britannica.com/">Britannica</a></li>
<li><a href="http://www.capitolimpact.com/gw/">States</a></li>
<li><a href="http://www.packtrack.com/">PackTrack</a></li>
<li><a href="http://www.acronymfinder.com/">Acronym</a></li>
<li><a href="http://www.visualthesaurus.com/">V-Thes</a></li>
<li>
<a href="http://www.timelineindex.com/content/home/forced">Timelines</a>
</li>
<li><a href="http://en.wikipedia.org/wiki/Main_Page">Wikipedia</a>
</li>
</ul>
</td>
<td>
<!-- Good Reading Misc. -->
<ul>
<li><a href="http://www.paypal.com/">Paypal</a></li>
<li><a href="http://www.halifax.co.uk/">Halifax</a></li>
<li>
<a href="http://www.bullbearings.co.uk/stock.portfolio.php">Bullbearings</a>
</li>
<li><a href="http://www.fidelity.co.uk/">Fidelity</a></li>
<li>
<a href="http://www.contractorumbrella.com/">Contractor Umbrella</a>
</li>
</ul>
</td>
</tr>
<tr>
<td colspan="3" class="footer">
<div id='weather'></div>
</td>
</tr>
</table>
</div>
<div id="container"></div>
</body>
<script>
function addDays(myDate, days) {
return new Date(myDate.getTime() + days * 24 * 60 * 60 * 1000);
}
function getDays(startdate, enddate) {
var r, s, e;
s = startdate.getTime();
e = enddate.getTime();
r = (e - s) / (24 * 60 * 60 * 1000);
return r;
}
function tick() {
var today = new Date();
var start101 = new Date();
var end101 = new Date();
var endContract = new Date();
var third = new Date();
start101.setFullYear(2013, 9, 24);
end101 = addDays(start101, 1001);
endContract.setFullYear(2014, 3, 6);
third.setFullYear(2013, 7, 25);
$('#one').text('101B ends: ' + Math.ceil(getDays(today,
end101)) + " days / " + Math.ceil(getDays(today,
end101) / 7) + " weeks");
$('#two').text('Ends: ' + Math.ceil(getDays(today,
endContract)) + " days / " + Math.ceil(getDays(today,
endContract) / 7) + " weeks");
// $('#three').text(innerText =
// 'Tough Mudder: ' + Math.ceil(getDays(today,
// third)) + " days / " + Math.ceil(getDays(today,
// third) / 7) + " weeks");
}
tick();
function get_weather() {
navigator.geolocation.getCurrentPosition(show_weather);
}
function show_weather(position) {
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
// let's show a map or do something interesting!
$.ajax({
type: 'GET',
url: 'https://api.forecast.io/forecast/0657dc0d81c037cbc89ca88e383b6bbf/' + latitude.toString() + ',' + longitude.toString(),
data: '',
dataType: 'jsonp',
timeout: 10000,
context: $('body'),
contentType: ('application/json'),
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'PUT, GET, POST, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type'
},
success: function(data) {
// console.log(data);
$('#weather').text(data.currently.summary + " " + ((5.0 / 9.0 * (data.currently.temperature - 32))));
},
error: function(xhr, type) {
console.log("ajax error");
console.log(xhr);
console.log(type);
}
});
}
function bitstamp() {
console.log("getting bitstamp");
var url = 'https://www.bitstamp.net/api/ticker/?=&callback=';
// let's show a map or do something interesting!
$.ajax({
type: 'GET',
url: url,
data: '',
dataType: 'json',
jsonp: false,
jsonpCallback: "BitStampParser",
timeout: 10000,
//contentType: ('application/json'),
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'PUT, GET, POST, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type'
},
success: function(data) {
console.log(data);
//$('#weather').text(data.currently.summary + " " + ((5.0 / 9.0 * (data.currently.temperature - 32))));
},
error: function(xhr, type) {
console.log("ajax error");
console.log(xhr);
console.log(type);
}
});
}
function BitStampParser(v)
{
console.log("Bitstamp parser");
console.log(v);
}
get_weather();
bitstamp();
</script>
</html>