diff --git a/ftsetest.js b/ftsetest.js new file mode 100644 index 0000000..f8b0cf7 --- /dev/null +++ b/ftsetest.js @@ -0,0 +1,10 @@ +/** + * + * User: Martin Donnelly + * Date: 2016-06-23 + * Time: 11:41 + * + */ +var ftse = require('ftse')('100', 10, 'risers', function(items) { + console.log(items); // Array +}); diff --git a/lib/jade/today.jade b/lib/jade/today.jade index fc6b360..8d4f115 100644 --- a/lib/jade/today.jade +++ b/lib/jade/today.jade @@ -55,6 +55,16 @@ html(lang="en") if data.fitbit.summary h2 Fitbit p Yesterday you walked #{data.fitbit.summary.steps} steps and covered #{data.fitbit.summary.distances[0].distance} km. + .ftse + if data.ftse + h2 FTSE + each line in data.ftse + table + tr + td= line.name + td= line.price + td= line.change_amount + td= line.change_percent .swedish h2 Word of the day p(style="font-weight:900;")= data.swedish.xml.words.word diff --git a/lib/newdata.json b/lib/newdata.json index c4a4fcc..cf4534b 100644 --- a/lib/newdata.json +++ b/lib/newdata.json @@ -1 +1,1664 @@ -{"last":0,"data":{"trains":{"last":"2016-05-03T13:34:18.227Z","data":[]},"weather":{},"history":["On this day in 1679, Archbishop James Sharp, Primate of Scotland, was attacked and killed.","The murder happened while he was travelling through Fife to St Andrews. The attackers were probably waiting for the Sheriff of Fife, but were happy to kill instead the man leading the forces suppressing the Covenant in Scotland. It sparked a wider uprising, leading to what is known as the \"Killing Time\".","Today in 1860, John Haldane, Scottish physician and physiologist, was born. Noted for his work on respiration, it was Haldane who demonstrated the role of carbon dioxide, and the change in temperature of the human body at extreme pressures. Author of 'Causes of Death in Colliery Explosions,' he was also father of the great population geneticist, JBS Haldane.","Earliest Known Case of Spam","Today, unsolicited bulk email--better known as spam--accounts for up to 90% of all email messages, but it wasn't until this date in 1978 that the first spam was sent. Gary Thuerk, a Digital Equipment Corporation marketer, composed a message promoting the DECSYSTEM-20 computer. The message promoted two upcoming product presentations of the DECSYSTEM-20 accessing the ARPANET. The reaction to the message was swift and highly negative, including one who claimed that the message shut down his system."],"today":"Tuesday May 03, 2016 - The 123rd day of 2016, and there are 242 days left until the end of the year.","tv":{"entries":[{"summary":"Castle 8x20 - Much Ado About Murder","dtstart":"2016-05-03T02:00:00.000Z","dtend":"2016-05-03T03:00:00.000Z","description":"After a movie star turned theater actor is mysteriously","timeStart":"3:00:00","timeEnd":"4:00:00","duration":"1 hour","combined":"3:00:00 - Castle 8x20 - Much Ado About Murder, 1 hour","long":"Tuesday, 3:00:00 - ","longcombined":"Tuesday, 3:00:00 - Castle 8x20 - Much Ado About Murder, 1 hour"},{"summary":"NCIS: Los Angeles 7x24 - Talion","dtstart":"2016-05-03T02:00:00.000Z","dtend":"2016-05-03T03:00:00.000Z","description":"When Sam receives a distress code from his son Aiden that his","timeStart":"3:00:00","timeEnd":"4:00:00","duration":"1 hour","combined":"3:00:00 - NCIS: Los Angeles 7x24 - Talion, 1 hour","long":"Tuesday, 3:00:00 - ","longcombined":"Tuesday, 3:00:00 - NCIS: Los Angeles 7x24 - Talion, 1 hour"}]},"cal":{"today":[],"tomorrow":[],"week":[{"summary":"Kevin / Martin / Michael - Lunch Catch Up","dtstart":"2016-05-05T13:30:00.000Z","dtend":"2016-05-05T14:30:00.000Z","description":"Hi Kevin/Martin\\,\\n\\nI do feel our lunch meeting is cursed... I","timeStart":"14:30:00","timeEnd":"15:30:00","duration":"1 hour","combined":"14:30:00 - Kevin / Martin / Michael - Lunch Catch Up, 1 hour","long":"Thursday, 14:30:00 - ","longcombined":"Thursday, 14:30:00 - Kevin / Martin / Michael - Lunch Catch Up, 1 hour"}],"entries":[]},"swedish":{"xml":{"$":{"xmlns:wotd":"http://www.transparent.com/word-of-the-day/"},"words":{"date":"05-03-2016","langname":"Swedish","wordtype":"expression","word":"otur","wordsound":"http://wotd.transparent.com/swedish/level-1/sound/00060_WOTD_Swedish_Words.mp3","translation":"bad luck","fnphrase":"Svarta katter betyder otur.","phrasesound":"http://wotd.transparent.com/swedish/level-1/sound/00060_WOTD_Swedish_Sentences.mp3","enphrase":"Black cats are a sign of bad luck.","wotd:transliteratedWord":"","wotd:transliteratedSentence":"","notes":""}}},"fitbit":{}},"expire":3600000,"date":{"year":2016,"month":5,"day":3}} +{ + "last": 0, + "data": { + "trains": { + "last": "2016-06-23T10:56:45.731Z", + "data": [] + }, + "weather": { + "currently": "Partly Cloudy. Around 11 to 20 degrees.", + "today": "Light rain starting in the evening.", + "later": "Light rain throughout the week, with temperatures falling to 14°C on Wednesday.", + "alerts": {}, + "data": { + "latitude": 55.8582846, + "longitude": -4.2593033, + "timezone": "Europe/London", + "offset": 1, + "currently": { + "time": 1466679382, + "summary": "Partly Cloudy", + "icon": "partly-cloudy-day", + "nearestStormDistance": 117, + "nearestStormBearing": 267, + "precipIntensity": 0, + "precipProbability": 0, + "temperature": 17.47, + "apparentTemperature": 17.47, + "dewPoint": 9.72, + "humidity": 0.6, + "windSpeed": 6.75, + "windBearing": 216, + "visibility": 10, + "cloudCover": 0.26, + "pressure": 1015.37, + "ozone": 352.29 + }, + "minutely": { + "summary": "Partly cloudy for the hour.", + "icon": "partly-cloudy-day", + "data": [ + { + "time": 1466679360, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466679420, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466679480, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466679540, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466679600, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466679660, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466679720, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466679780, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466679840, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466679900, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466679960, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466680020, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466680080, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466680140, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466680200, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466680260, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466680320, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466680380, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466680440, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466680500, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466680560, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466680620, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466680680, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466680740, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466680800, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466680860, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466680920, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466680980, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466681040, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466681100, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466681160, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466681220, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466681280, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466681340, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466681400, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466681460, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466681520, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466681580, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466681640, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466681700, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466681760, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466681820, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466681880, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466681940, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466682000, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466682060, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466682120, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466682180, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466682240, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466682300, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466682360, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466682420, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466682480, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466682540, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466682600, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466682660, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466682720, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466682780, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466682840, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466682900, + "precipIntensity": 0, + "precipProbability": 0 + }, + { + "time": 1466682960, + "precipIntensity": 0, + "precipProbability": 0 + } + ] + }, + "hourly": { + "summary": "Light rain starting this evening.", + "icon": "rain", + "data": [ + { + "time": 1466676000, + "summary": "Clear", + "icon": "clear-day", + "precipIntensity": 0, + "precipProbability": 0, + "temperature": 17.05, + "apparentTemperature": 17.05, + "dewPoint": 9.72, + "humidity": 0.62, + "windSpeed": 6.56, + "windBearing": 217, + "visibility": 7.73, + "cloudCover": 0.2, + "pressure": 1015.55, + "ozone": 351.54 + }, + { + "time": 1466679600, + "summary": "Partly Cloudy", + "icon": "partly-cloudy-day", + "precipIntensity": 0, + "precipProbability": 0, + "temperature": 17.49, + "apparentTemperature": 17.49, + "dewPoint": 9.72, + "humidity": 0.6, + "windSpeed": 6.76, + "windBearing": 216, + "visibility": 10, + "cloudCover": 0.27, + "pressure": 1015.36, + "ozone": 352.34 + }, + { + "time": 1466683200, + "summary": "Partly Cloudy", + "icon": "partly-cloudy-day", + "precipIntensity": 0, + "precipProbability": 0, + "temperature": 18.14, + "apparentTemperature": 18.14, + "dewPoint": 9.88, + "humidity": 0.59, + "windSpeed": 6.99, + "windBearing": 215, + "visibility": 10, + "cloudCover": 0.33, + "pressure": 1015.15, + "ozone": 352.79 + }, + { + "time": 1466686800, + "summary": "Partly Cloudy", + "icon": "partly-cloudy-day", + "precipIntensity": 0, + "precipProbability": 0, + "temperature": 18.79, + "apparentTemperature": 18.79, + "dewPoint": 10.47, + "humidity": 0.58, + "windSpeed": 6.91, + "windBearing": 213, + "visibility": 10, + "cloudCover": 0.31, + "pressure": 1014.9, + "ozone": 352.45 + }, + { + "time": 1466690400, + "summary": "Partly Cloudy", + "icon": "partly-cloudy-day", + "precipIntensity": 0, + "precipProbability": 0, + "temperature": 19.71, + "apparentTemperature": 19.71, + "dewPoint": 11.33, + "humidity": 0.58, + "windSpeed": 6.83, + "windBearing": 210, + "visibility": 10, + "cloudCover": 0.26, + "pressure": 1014.62, + "ozone": 351.77 + }, + { + "time": 1466694000, + "summary": "Clear", + "icon": "clear-day", + "precipIntensity": 0.0432, + "precipProbability": 0.04, + "precipType": "rain", + "temperature": 20.45, + "apparentTemperature": 20.45, + "dewPoint": 12.08, + "humidity": 0.59, + "windSpeed": 6.77, + "windBearing": 207, + "visibility": 10, + "cloudCover": 0.21, + "pressure": 1014.39, + "ozone": 351.32 + }, + { + "time": 1466697600, + "summary": "Drizzle", + "icon": "rain", + "precipIntensity": 0.1499, + "precipProbability": 0.24, + "precipType": "rain", + "temperature": 20.14, + "apparentTemperature": 20.14, + "dewPoint": 12.09, + "humidity": 0.6, + "windSpeed": 6.58, + "windBearing": 206, + "visibility": 10, + "cloudCover": 0.34, + "pressure": 1014.2, + "ozone": 351.43 + }, + { + "time": 1466701200, + "summary": "Light Rain", + "icon": "rain", + "precipIntensity": 0.2896, + "precipProbability": 0.46, + "precipType": "rain", + "temperature": 19.58, + "apparentTemperature": 19.58, + "dewPoint": 11.92, + "humidity": 0.61, + "windSpeed": 6.42, + "windBearing": 205, + "visibility": 10, + "cloudCover": 0.45, + "pressure": 1014.05, + "ozone": 351.77 + }, + { + "time": 1466704800, + "summary": "Light Rain", + "icon": "rain", + "precipIntensity": 0.3988, + "precipProbability": 0.49, + "precipType": "rain", + "temperature": 18.67, + "apparentTemperature": 18.67, + "dewPoint": 11.41, + "humidity": 0.63, + "windSpeed": 6.17, + "windBearing": 204, + "visibility": 10, + "cloudCover": 0.57, + "pressure": 1013.97, + "ozone": 351.95 + }, + { + "time": 1466708400, + "summary": "Light Rain", + "icon": "rain", + "precipIntensity": 0.475, + "precipProbability": 0.51, + "precipType": "rain", + "temperature": 17.57, + "apparentTemperature": 17.57, + "dewPoint": 11.24, + "humidity": 0.66, + "windSpeed": 5.27, + "windBearing": 207, + "visibility": 10, + "cloudCover": 0.64, + "pressure": 1013.95, + "ozone": 352 + }, + { + "time": 1466712000, + "summary": "Light Rain", + "icon": "rain", + "precipIntensity": 0.5232, + "precipProbability": 0.52, + "precipType": "rain", + "temperature": 16.18, + "apparentTemperature": 16.18, + "dewPoint": 10.76, + "humidity": 0.7, + "windSpeed": 4.23, + "windBearing": 210, + "visibility": 10, + "cloudCover": 0.7, + "pressure": 1013.98, + "ozone": 351.88 + }, + { + "time": 1466715600, + "summary": "Light Rain", + "icon": "rain", + "precipIntensity": 0.508, + "precipProbability": 0.52, + "precipType": "rain", + "temperature": 14.72, + "apparentTemperature": 14.72, + "dewPoint": 10.11, + "humidity": 0.74, + "windSpeed": 3.14, + "windBearing": 212, + "visibility": 10, + "cloudCover": 0.75, + "pressure": 1013.94, + "ozone": 351.14 + }, + { + "time": 1466719200, + "summary": "Light Rain", + "icon": "rain", + "precipIntensity": 0.381, + "precipProbability": 0.49, + "precipType": "rain", + "temperature": 13.53, + "apparentTemperature": 13.53, + "dewPoint": 9.54, + "humidity": 0.77, + "windSpeed": 2.79, + "windBearing": 198, + "visibility": 10, + "cloudCover": 0.75, + "pressure": 1013.76, + "ozone": 349.07 + }, + { + "time": 1466722800, + "summary": "Drizzle", + "icon": "rain", + "precipIntensity": 0.193, + "precipProbability": 0.34, + "precipType": "rain", + "temperature": 13.09, + "apparentTemperature": 13.09, + "dewPoint": 9.63, + "humidity": 0.8, + "windSpeed": 2.68, + "windBearing": 183, + "visibility": 10, + "cloudCover": 0.75, + "pressure": 1013.51, + "ozone": 346.38 + }, + { + "time": 1466726400, + "summary": "Mostly Cloudy", + "icon": "partly-cloudy-night", + "precipIntensity": 0.0711, + "precipProbability": 0.08, + "precipType": "rain", + "temperature": 12.79, + "apparentTemperature": 12.79, + "dewPoint": 9.81, + "humidity": 0.82, + "windSpeed": 2.76, + "windBearing": 167, + "visibility": 9.32, + "cloudCover": 0.89, + "pressure": 1013.27, + "ozone": 344.64 + }, + { + "time": 1466730000, + "summary": "Mostly Cloudy", + "icon": "partly-cloudy-night", + "precipIntensity": 0.0838, + "precipProbability": 0.11, + "precipType": "rain", + "temperature": 12.57, + "apparentTemperature": 12.57, + "dewPoint": 10.13, + "humidity": 0.85, + "windSpeed": 2.53, + "windBearing": 155, + "visibility": 10, + "cloudCover": 0.91, + "pressure": 1013.05, + "ozone": 344.66 + }, + { + "time": 1466733600, + "summary": "Drizzle", + "icon": "rain", + "precipIntensity": 0.1626, + "precipProbability": 0.27, + "precipType": "rain", + "temperature": 12.43, + "apparentTemperature": 12.43, + "dewPoint": 10.49, + "humidity": 0.88, + "windSpeed": 2.4, + "windBearing": 142, + "visibility": 10, + "cloudCover": 0.95, + "pressure": 1012.84, + "ozone": 345.63 + }, + { + "time": 1466737200, + "summary": "Drizzle", + "icon": "rain", + "precipIntensity": 0.2159, + "precipProbability": 0.39, + "precipType": "rain", + "temperature": 12.35, + "apparentTemperature": 12.35, + "dewPoint": 10.89, + "humidity": 0.91, + "windSpeed": 2.41, + "windBearing": 128, + "visibility": 10, + "cloudCover": 0.98, + "pressure": 1012.7, + "ozone": 346.74 + }, + { + "time": 1466740800, + "summary": "Drizzle", + "icon": "rain", + "precipIntensity": 0.2032, + "precipProbability": 0.36, + "precipType": "rain", + "temperature": 12.42, + "apparentTemperature": 12.42, + "dewPoint": 10.97, + "humidity": 0.91, + "windSpeed": 2.7, + "windBearing": 134, + "visibility": 10, + "cloudCover": 0.79, + "pressure": 1012.67, + "ozone": 347.96 + }, + { + "time": 1466744400, + "summary": "Drizzle", + "icon": "rain", + "precipIntensity": 0.1676, + "precipProbability": 0.28, + "precipType": "rain", + "temperature": 12.49, + "apparentTemperature": 12.49, + "dewPoint": 11.03, + "humidity": 0.91, + "windSpeed": 3.03, + "windBearing": 136, + "visibility": 9.26, + "cloudCover": 0.79, + "pressure": 1012.7, + "ozone": 349.3 + }, + { + "time": 1466748000, + "summary": "Drizzle", + "icon": "rain", + "precipIntensity": 0.1448, + "precipProbability": 0.23, + "precipType": "rain", + "temperature": 12.75, + "apparentTemperature": 12.75, + "dewPoint": 11.23, + "humidity": 0.9, + "windSpeed": 3.49, + "windBearing": 137, + "visibility": 8.17, + "cloudCover": 0.78, + "pressure": 1012.76, + "ozone": 350.06 + }, + { + "time": 1466751600, + "summary": "Drizzle", + "icon": "rain", + "precipIntensity": 0.1626, + "precipProbability": 0.27, + "precipType": "rain", + "temperature": 13.62, + "apparentTemperature": 13.62, + "dewPoint": 11.66, + "humidity": 0.88, + "windSpeed": 2.66, + "windBearing": 155, + "visibility": 9.08, + "cloudCover": 0.75, + "pressure": 1012.84, + "ozone": 349.72 + }, + { + "time": 1466755200, + "summary": "Drizzle", + "icon": "rain", + "precipIntensity": 0.193, + "precipProbability": 0.34, + "precipType": "rain", + "temperature": 14.61, + "apparentTemperature": 14.61, + "dewPoint": 12.12, + "humidity": 0.85, + "windSpeed": 2.3, + "windBearing": 177, + "visibility": 9.99, + "cloudCover": 0.71, + "pressure": 1012.96, + "ozone": 348.79 + }, + { + "time": 1466758800, + "summary": "Drizzle", + "icon": "rain", + "precipIntensity": 0.2108, + "precipProbability": 0.38, + "precipType": "rain", + "temperature": 15.59, + "apparentTemperature": 15.59, + "dewPoint": 12.58, + "humidity": 0.82, + "windSpeed": 2.28, + "windBearing": 198, + "visibility": 10, + "cloudCover": 0.69, + "pressure": 1013.05, + "ozone": 348.08 + }, + { + "time": 1466762400, + "summary": "Drizzle", + "icon": "rain", + "precipIntensity": 0.193, + "precipProbability": 0.34, + "precipType": "rain", + "temperature": 16.42, + "apparentTemperature": 16.42, + "dewPoint": 12.71, + "humidity": 0.79, + "windSpeed": 2.35, + "windBearing": 209, + "visibility": 10, + "cloudCover": 0.68, + "pressure": 1013.11, + "ozone": 347.95 + }, + { + "time": 1466766000, + "summary": "Drizzle", + "icon": "rain", + "precipIntensity": 0.16, + "precipProbability": 0.26, + "precipType": "rain", + "temperature": 17.1, + "apparentTemperature": 17.1, + "dewPoint": 12.7, + "humidity": 0.75, + "windSpeed": 2.55, + "windBearing": 219, + "visibility": 10, + "cloudCover": 0.68, + "pressure": 1013.15, + "ozone": 348.05 + }, + { + "time": 1466769600, + "summary": "Drizzle", + "icon": "rain", + "precipIntensity": 0.1499, + "precipProbability": 0.24, + "precipType": "rain", + "temperature": 17.6, + "apparentTemperature": 17.6, + "dewPoint": 12.52, + "humidity": 0.72, + "windSpeed": 2.86, + "windBearing": 225, + "visibility": 10, + "cloudCover": 0.75, + "pressure": 1013.2, + "ozone": 348.13 + }, + { + "time": 1466773200, + "summary": "Drizzle", + "icon": "rain", + "precipIntensity": 0.1829, + "precipProbability": 0.32, + "precipType": "rain", + "temperature": 17.72, + "apparentTemperature": 17.72, + "dewPoint": 12.68, + "humidity": 0.72, + "windSpeed": 3.13, + "windBearing": 230, + "visibility": 10, + "cloudCover": 0.8, + "pressure": 1013.26, + "ozone": 348.09 + }, + { + "time": 1466776800, + "summary": "Light Rain", + "icon": "rain", + "precipIntensity": 0.2362, + "precipProbability": 0.44, + "precipType": "rain", + "temperature": 17.29, + "apparentTemperature": 17.29, + "dewPoint": 12.35, + "humidity": 0.73, + "windSpeed": 3.36, + "windBearing": 234, + "visibility": 10, + "cloudCover": 0.87, + "pressure": 1013.34, + "ozone": 348.05 + }, + { + "time": 1466780400, + "summary": "Light Rain", + "icon": "rain", + "precipIntensity": 0.2845, + "precipProbability": 0.46, + "precipType": "rain", + "temperature": 16.62, + "apparentTemperature": 16.62, + "dewPoint": 11.83, + "humidity": 0.73, + "windSpeed": 3.48, + "windBearing": 240, + "visibility": 9.74, + "cloudCover": 0.91, + "pressure": 1013.43, + "ozone": 348.07 + }, + { + "time": 1466784000, + "summary": "Light Rain", + "icon": "rain", + "precipIntensity": 0.3226, + "precipProbability": 0.47, + "precipType": "rain", + "temperature": 15.99, + "apparentTemperature": 15.99, + "dewPoint": 11.37, + "humidity": 0.74, + "windSpeed": 3.4, + "windBearing": 241, + "visibility": 10, + "cloudCover": 0.9, + "pressure": 1013.53, + "ozone": 348.21 + }, + { + "time": 1466787600, + "summary": "Light Rain", + "icon": "rain", + "precipIntensity": 0.3556, + "precipProbability": 0.48, + "precipType": "rain", + "temperature": 15.54, + "apparentTemperature": 15.54, + "dewPoint": 11.12, + "humidity": 0.75, + "windSpeed": 3.23, + "windBearing": 242, + "visibility": 10, + "cloudCover": 0.87, + "pressure": 1013.64, + "ozone": 348.41 + }, + { + "time": 1466791200, + "summary": "Light Rain", + "icon": "rain", + "precipIntensity": 0.3632, + "precipProbability": 0.48, + "precipType": "rain", + "temperature": 15.06, + "apparentTemperature": 15.06, + "dewPoint": 10.87, + "humidity": 0.76, + "windSpeed": 3.06, + "windBearing": 243, + "visibility": 10, + "cloudCover": 0.83, + "pressure": 1013.81, + "ozone": 348.65 + }, + { + "time": 1466794800, + "summary": "Light Rain", + "icon": "rain", + "precipIntensity": 0.3353, + "precipProbability": 0.47, + "precipType": "rain", + "temperature": 14.31, + "apparentTemperature": 14.31, + "dewPoint": 10.66, + "humidity": 0.79, + "windSpeed": 2.62, + "windBearing": 250, + "visibility": 10, + "cloudCover": 0.71, + "pressure": 1014.07, + "ozone": 348.9 + }, + { + "time": 1466798400, + "summary": "Light Rain", + "icon": "rain", + "precipIntensity": 0.2819, + "precipProbability": 0.45, + "precipType": "rain", + "temperature": 13.32, + "apparentTemperature": 13.32, + "dewPoint": 10.24, + "humidity": 0.82, + "windSpeed": 2.23, + "windBearing": 260, + "visibility": 10, + "cloudCover": 0.69, + "pressure": 1014.38, + "ozone": 349.18 + }, + { + "time": 1466802000, + "summary": "Light Rain", + "icon": "rain", + "precipIntensity": 0.2337, + "precipProbability": 0.43, + "precipType": "rain", + "temperature": 12.15, + "apparentTemperature": 12.15, + "dewPoint": 9.57, + "humidity": 0.84, + "windSpeed": 1.9, + "windBearing": 273, + "visibility": 10, + "cloudCover": 0.68, + "pressure": 1014.67, + "ozone": 349.45 + }, + { + "time": 1466805600, + "summary": "Drizzle", + "icon": "rain", + "precipIntensity": 0.1956, + "precipProbability": 0.34, + "precipType": "rain", + "temperature": 11.73, + "apparentTemperature": 11.73, + "dewPoint": 9.5, + "humidity": 0.86, + "windSpeed": 1.65, + "windBearing": 264, + "visibility": 10, + "cloudCover": 0.68, + "pressure": 1014.88, + "ozone": 349.76 + }, + { + "time": 1466809200, + "summary": "Drizzle", + "icon": "rain", + "precipIntensity": 0.16, + "precipProbability": 0.26, + "precipType": "rain", + "temperature": 11.69, + "apparentTemperature": 11.69, + "dewPoint": 9.74, + "humidity": 0.88, + "windSpeed": 1.62, + "windBearing": 253, + "visibility": 10, + "cloudCover": 0.68, + "pressure": 1015.05, + "ozone": 350.05 + }, + { + "time": 1466812800, + "summary": "Drizzle", + "icon": "rain", + "precipIntensity": 0.127, + "precipProbability": 0.19, + "precipType": "rain", + "temperature": 11.62, + "apparentTemperature": 11.62, + "dewPoint": 9.96, + "humidity": 0.89, + "windSpeed": 1.56, + "windBearing": 240, + "visibility": 9.32, + "cloudCover": 0.68, + "pressure": 1015.17, + "ozone": 350.19 + }, + { + "time": 1466816400, + "summary": "Mostly Cloudy", + "icon": "partly-cloudy-night", + "precipIntensity": 0.0838, + "precipProbability": 0.11, + "precipType": "rain", + "temperature": 11.38, + "apparentTemperature": 11.38, + "dewPoint": 9.99, + "humidity": 0.91, + "windSpeed": 1.37, + "windBearing": 264, + "visibility": 7.66, + "cloudCover": 0.68, + "pressure": 1015.24, + "ozone": 350.08 + }, + { + "time": 1466820000, + "summary": "Mostly Cloudy", + "icon": "partly-cloudy-night", + "precipIntensity": 0.0432, + "precipProbability": 0.04, + "precipType": "rain", + "temperature": 11.05, + "apparentTemperature": 11.05, + "dewPoint": 9.93, + "humidity": 0.93, + "windSpeed": 1.43, + "windBearing": 289, + "visibility": 6.01, + "cloudCover": 0.67, + "pressure": 1015.25, + "ozone": 349.81 + }, + { + "time": 1466823600, + "summary": "Mostly Cloudy", + "icon": "partly-cloudy-night", + "precipIntensity": 0, + "precipProbability": 0, + "temperature": 10.93, + "apparentTemperature": 10.93, + "dewPoint": 10.06, + "humidity": 0.94, + "windSpeed": 1.67, + "windBearing": 309, + "visibility": 4.35, + "cloudCover": 0.66, + "pressure": 1015.29, + "ozone": 349.5 + }, + { + "time": 1466827200, + "summary": "Mostly Cloudy", + "icon": "partly-cloudy-day", + "precipIntensity": 0.0279, + "precipProbability": 0.02, + "precipType": "rain", + "temperature": 11.3, + "apparentTemperature": 11.3, + "dewPoint": 10.34, + "humidity": 0.94, + "windSpeed": 1.7, + "windBearing": 333, + "visibility": 6.01, + "cloudCover": 0.67, + "pressure": 1015.35, + "ozone": 349.14 + }, + { + "time": 1466830800, + "summary": "Mostly Cloudy", + "icon": "partly-cloudy-day", + "precipIntensity": 0.0559, + "precipProbability": 0.06, + "precipType": "rain", + "temperature": 11.72, + "apparentTemperature": 11.72, + "dewPoint": 10.64, + "humidity": 0.93, + "windSpeed": 1.95, + "windBearing": 355, + "visibility": 7.66, + "cloudCover": 0.67, + "pressure": 1015.42, + "ozone": 348.74 + }, + { + "time": 1466834400, + "summary": "Mostly Cloudy", + "icon": "partly-cloudy-day", + "precipIntensity": 0.0711, + "precipProbability": 0.08, + "precipType": "rain", + "temperature": 11.98, + "apparentTemperature": 11.98, + "dewPoint": 10.78, + "humidity": 0.92, + "windSpeed": 2.36, + "windBearing": 9, + "visibility": 9.32, + "cloudCover": 0.67, + "pressure": 1015.53, + "ozone": 348.35 + }, + { + "time": 1466838000, + "summary": "Mostly Cloudy", + "icon": "partly-cloudy-day", + "precipIntensity": 0.0559, + "precipProbability": 0.06, + "precipType": "rain", + "temperature": 12.29, + "apparentTemperature": 12.29, + "dewPoint": 10.91, + "humidity": 0.91, + "windSpeed": 2.46, + "windBearing": 13, + "visibility": 9.32, + "cloudCover": 0.68, + "pressure": 1015.68, + "ozone": 348.02 + }, + { + "time": 1466841600, + "summary": "Mostly Cloudy", + "icon": "partly-cloudy-day", + "precipIntensity": 0.0254, + "precipProbability": 0.01, + "precipType": "rain", + "temperature": 12.83, + "apparentTemperature": 12.83, + "dewPoint": 11.24, + "humidity": 0.9, + "windSpeed": 2.53, + "windBearing": 16, + "visibility": 9.32, + "cloudCover": 0.7, + "pressure": 1015.85, + "ozone": 347.71 + }, + { + "time": 1466845200, + "summary": "Mostly Cloudy", + "icon": "partly-cloudy-day", + "precipIntensity": 0, + "precipProbability": 0, + "temperature": 13.42, + "apparentTemperature": 13.42, + "dewPoint": 11.61, + "humidity": 0.89, + "windSpeed": 2.61, + "windBearing": 17, + "visibility": 9.32, + "cloudCover": 0.71, + "pressure": 1016, + "ozone": 347.36 + }, + { + "time": 1466848800, + "summary": "Mostly Cloudy", + "icon": "partly-cloudy-day", + "precipIntensity": 0.033, + "precipProbability": 0.02, + "precipType": "rain", + "temperature": 14.26, + "apparentTemperature": 14.26, + "dewPoint": 11.97, + "humidity": 0.86, + "windSpeed": 2.7, + "windBearing": 14, + "visibility": 9.32, + "cloudCover": 0.72, + "pressure": 1016.1, + "ozone": 346.92 + } + ] + }, + "daily": { + "summary": "Light rain throughout the week, with temperatures falling to 14°C on Wednesday.", + "icon": "rain", + "data": [ + { + "time": 1466636400, + "summary": "Light rain starting in the evening.", + "icon": "rain", + "sunriseTime": 1466652792, + "sunsetTime": 1466716075, + "moonPhase": 0.6, + "precipIntensity": 0.1194, + "precipIntensityMax": 0.5232, + "precipIntensityMaxTime": 1466712000, + "precipProbability": 0.52, + "precipType": "rain", + "temperatureMin": 11.37, + "temperatureMinTime": 1466650800, + "temperatureMax": 20.45, + "temperatureMaxTime": 1466694000, + "apparentTemperatureMin": 11.37, + "apparentTemperatureMinTime": 1466650800, + "apparentTemperatureMax": 20.45, + "apparentTemperatureMaxTime": 1466694000, + "dewPoint": 10.75, + "humidity": 0.75, + "windSpeed": 4.41, + "windBearing": 203, + "visibility": 10, + "cloudCover": 0.43, + "pressure": 1014.97, + "ozone": 352 + }, + { + "time": 1466722800, + "summary": "Light rain throughout the day.", + "icon": "rain", + "sunriseTime": 1466739215, + "sunsetTime": 1466802476, + "moonPhase": 0.63, + "precipIntensity": 0.2134, + "precipIntensityMax": 0.3632, + "precipIntensityMaxTime": 1466791200, + "precipProbability": 0.48, + "precipType": "rain", + "temperatureMin": 11.73, + "temperatureMinTime": 1466805600, + "temperatureMax": 17.72, + "temperatureMaxTime": 1466773200, + "apparentTemperatureMin": 11.73, + "apparentTemperatureMinTime": 1466805600, + "apparentTemperatureMax": 17.72, + "apparentTemperatureMaxTime": 1466773200, + "dewPoint": 11.19, + "humidity": 0.81, + "windSpeed": 1.91, + "windBearing": 203, + "visibility": 10, + "cloudCover": 0.79, + "pressure": 1013.37, + "ozone": 348.03 + }, + { + "time": 1466809200, + "summary": "Drizzle starting in the afternoon, continuing until evening.", + "icon": "rain", + "sunriseTime": 1466825641, + "sunsetTime": 1466888873, + "moonPhase": 0.67, + "precipIntensity": 0.0889, + "precipIntensityMax": 0.1829, + "precipIntensityMaxTime": 1466870400, + "precipProbability": 0.32, + "precipType": "rain", + "temperatureMin": 10.93, + "temperatureMinTime": 1466823600, + "temperatureMax": 17.82, + "temperatureMaxTime": 1466866800, + "apparentTemperatureMin": 10.93, + "apparentTemperatureMinTime": 1466823600, + "apparentTemperatureMax": 17.82, + "apparentTemperatureMaxTime": 1466866800, + "dewPoint": 11.52, + "humidity": 0.87, + "windSpeed": 1.66, + "windBearing": 345, + "visibility": 9.02, + "cloudCover": 0.7, + "pressure": 1015.98, + "ozone": 346.32 + }, + { + "time": 1466895600, + "summary": "Drizzle starting in the afternoon, continuing until evening.", + "icon": "rain", + "sunriseTime": 1466912072, + "sunsetTime": 1466975266, + "moonPhase": 0.7, + "precipIntensity": 0.0635, + "precipIntensityMax": 0.1753, + "precipIntensityMaxTime": 1466956800, + "precipProbability": 0.3, + "precipType": "rain", + "temperatureMin": 10.12, + "temperatureMinTime": 1466910000, + "temperatureMax": 16.1, + "temperatureMaxTime": 1466942400, + "apparentTemperatureMin": 10.12, + "apparentTemperatureMinTime": 1466910000, + "apparentTemperatureMax": 16.1, + "apparentTemperatureMaxTime": 1466942400, + "dewPoint": 11.22, + "humidity": 0.89, + "windSpeed": 6.03, + "windBearing": 230, + "visibility": 9.4, + "cloudCover": 0.81, + "pressure": 1014.91, + "ozone": 337.1 + }, + { + "time": 1466982000, + "summary": "Partly cloudy throughout the day.", + "icon": "partly-cloudy-day", + "sunriseTime": 1466998506, + "sunsetTime": 1467061655, + "moonPhase": 0.74, + "precipIntensity": 0.0762, + "precipIntensityMax": 0.1118, + "precipIntensityMaxTime": 1467036000, + "precipProbability": 0.16, + "precipType": "rain", + "temperatureMin": 7.76, + "temperatureMinTime": 1467064800, + "temperatureMax": 14.85, + "temperatureMaxTime": 1467032400, + "apparentTemperatureMin": 5.05, + "apparentTemperatureMinTime": 1467064800, + "apparentTemperatureMax": 14.85, + "apparentTemperatureMaxTime": 1467032400, + "dewPoint": 9.02, + "humidity": 0.79, + "windSpeed": 12.58, + "windBearing": 268, + "visibility": 10, + "cloudCover": 0.58, + "pressure": 1012.66, + "ozone": 357.79 + }, + { + "time": 1467068400, + "summary": "Light rain throughout the day.", + "icon": "rain", + "sunriseTime": 1467084944, + "sunsetTime": 1467148040, + "moonPhase": 0.78, + "precipIntensity": 0.2972, + "precipIntensityMax": 0.508, + "precipIntensityMaxTime": 1467147600, + "precipProbability": 0.52, + "precipType": "rain", + "temperatureMin": 6.24, + "temperatureMinTime": 1467072000, + "temperatureMax": 15.02, + "temperatureMaxTime": 1467122400, + "apparentTemperatureMin": 3.24, + "apparentTemperatureMinTime": 1467072000, + "apparentTemperatureMax": 15.02, + "apparentTemperatureMaxTime": 1467122400, + "dewPoint": 8.47, + "humidity": 0.88, + "windSpeed": 13.18, + "windBearing": 236, + "visibility": 10, + "cloudCover": 0.85, + "pressure": 1012.47, + "ozone": 361.82 + }, + { + "time": 1467154800, + "summary": "Rain in the morning and evening and breezy starting in the evening.", + "icon": "rain", + "sunriseTime": 1467171385, + "sunsetTime": 1467234422, + "moonPhase": 0.82, + "precipIntensity": 0.3861, + "precipIntensityMax": 1.8669, + "precipIntensityMaxTime": 1467234000, + "precipProbability": 0.65, + "precipType": "rain", + "temperatureMin": 6.77, + "temperatureMinTime": 1467165600, + "temperatureMax": 14.28, + "temperatureMaxTime": 1467205200, + "apparentTemperatureMin": 4.55, + "apparentTemperatureMinTime": 1467165600, + "apparentTemperatureMax": 14.28, + "apparentTemperatureMaxTime": 1467205200, + "dewPoint": 8.66, + "humidity": 0.88, + "windSpeed": 12.49, + "windBearing": 211, + "cloudCover": 0.74, + "pressure": 1007.48, + "ozone": 356.49 + }, + { + "time": 1467241200, + "summary": "Light rain throughout the day.", + "icon": "rain", + "sunriseTime": 1467257830, + "sunsetTime": 1467320799, + "moonPhase": 0.85, + "precipIntensity": 0.2845, + "precipIntensityMax": 1.4732, + "precipIntensityMaxTime": 1467241200, + "precipProbability": 0.63, + "precipType": "rain", + "temperatureMin": 5.96, + "temperatureMinTime": 1467252000, + "temperatureMax": 14.47, + "temperatureMaxTime": 1467298800, + "apparentTemperatureMin": 3.23, + "apparentTemperatureMinTime": 1467255600, + "apparentTemperatureMax": 14.47, + "apparentTemperatureMaxTime": 1467298800, + "dewPoint": 8, + "humidity": 0.87, + "windSpeed": 13.92, + "windBearing": 230, + "cloudCover": 0.62, + "pressure": 1005.29, + "ozone": 378.56 + } + ] + }, + "flags": { + "sources": [ + "darksky", + "datapoint", + "gfs", + "cmc", + "nam", + "fnmoc", + "isd", + "metwarn", + "madis", + "nearest-precip" + ], + "darksky-stations": [ + "uk_glasgow" + ], + "datapoint-stations": [ + "uk-310009", + "uk-350595", + "uk-350847", + "uk-351270", + "uk-351466", + "uk-351582", + "uk-351585", + "uk-351629", + "uk-351638", + "uk-351745", + "uk-352959", + "uk-352960", + "uk-353052", + "uk-353098", + "uk-353161", + "uk-353626" + ], + "isd-stations": [ + "031340-99999", + "031400-99999", + "031450-99999", + "031490-99999", + "031520-99999" + ], + "madis-stations": [ + "EGPF", + "EGPH", + "EGPK" + ], + "units": "uk2" + } + } + }, + "history": [ + "Today in 1314 Robert I, King of Scots, killed Henry de Bohun at the commencement of the Battle of Bannockburn.", + "In retaliation for the defeat of English garrisons at Edinburgh and Roxburgh castles, Edward II led a massive invasion force into Scotland, where they met the Scots army at Bannockburn, near Stirling. The battle continued until the next day.", + "On this day in 1832 Sir James Hall, Scottish geologist, died. Founder of geochemistry, Hall demonstrated that if igneous rocks are allowed to cool slowly, they form crystalline rather than glassy rock. He also showed that limestone, when heated under pressure, does not decompose but becomes marble.", + "Computer Pioneer Alan Turing Born", + "Turing, a British mathematician, logician and cryptanalyst, played key roles in the conception and theoretical underpinnings of electronic computers. As a codebreaker at Bletchley Park in the UK during World War II, Turing led the team that cracked the \"unbreakable\" Enigma code used by the German high command for battlefield communications. This has led some observers to speculate that Turing's work alone shortened the war by two years, savings many lives. Turing is best-known today for his work on the idea of a \"universal computer,\" one that could run any program. This has since become known as a \"Turing Machine.\" Turing died under mysterious circumstances from cyanide poisoning in 1954, though it was officially declared suicide. He was 41." + ], + "today": "Thursday June 23, 2016 - The 174th day of 2016, and there are 191 days left until the end of the year.", + "tv": { + "entries": [] + }, + "cal": { + "today": [ + { + "summary": "Jessicas birthday", + "dtstart": "2016-06-22T23:00:00.888Z", + "dtend": "2016-06-23T23:00:00.888Z", + "description": "", + "timeStart": "0:00:00", + "timeEnd": "0:00:00", + "duration": "1 day", + "combined": "0:00:00 - Jessicas birthday, 1 day", + "recur": "FREQ=YEARLY;INTERVAL=1", + "long": "Thursday, 0:00:00 - ", + "longcombined": "Thursday, 0:00:00 - Jessicas birthday, 1 day" + } + ], + "tomorrow": [ + { + "summary": "Update Timesheet", + "dtstart": "2016-06-24T14:30:00.111Z", + "dtend": "2016-06-24T15:30:00.111Z", + "description": "Update the timesheet using https://outsauce.backofficeportal.co", + "timeStart": "15:30:00", + "timeEnd": "16:30:00", + "duration": "1 hour", + "combined": "15:30:00 - Update Timesheet, 1 hour", + "recur": "FREQ=WEEKLY;COUNT=15;BYDAY=FR", + "long": "Friday, 15:30:00 - ", + "longcombined": "Friday, 15:30:00 - Update Timesheet, 1 hour" + } + ], + "week": [ + { + "summary": "Inchaailloch Walk", + "dtstart": "2016-06-26T12:00:00.000Z", + "dtend": "2016-06-26T14:00:00.000Z", + "description": "https://twitter.com/lomondtrossachs/status/743887229991460864", + "timeStart": "13:00:00", + "timeEnd": "15:00:00", + "duration": "2 hours", + "combined": "13:00:00 - Inchaailloch Walk, 2 hours", + "recur": null, + "long": "Sunday, 13:00:00 - ", + "longcombined": "Sunday, 13:00:00 - Inchaailloch Walk, 2 hours" + } + ] + }, + "swedish": { + "xml": { + "$": { + "xmlns:wotd": "http://www.transparent.com/word-of-the-day/" + }, + "words": { + "date": "06-23-2016", + "langname": "Swedish", + "wordtype": "verb", + "word": "att bråka", + "wordsound": "http://wotd.transparent.com/swedish/level-1/sound/00111_WOTD_Swedish_Words.mp3", + "translation": "to quarrel", + "fnphrase": "De har hållit på och grälat hela kvällen.", + "phrasesound": "http://wotd.transparent.com/swedish/level-1/sound/00111_WOTD_Swedish_Sentences.mp3", + "enphrase": "They have been quarreling all evening.", + "wotd:transliteratedWord": "", + "wotd:transliteratedSentence": "", + "notes": "" + } + } + }, + "fitbit": {}, + "ftse": [ + { + "name": "InterContinental Hotels Group Plc", + "price": "2,759.00", + "change_amount": "+107.00", + "change_percent": "+4.03%" + }, + { + "name": "International Consolidated Airlines Group SA", + "price": "527.00", + "change_amount": "+17.50", + "change_percent": "+3.43%" + }, + { + "name": "Whitbread Plc", + "price": "4,208.00", + "change_amount": "+139.00", + "change_percent": "+3.42%" + }, + { + "name": "Royal Bank of Scotland Group Plc", + "price": "254.80", + "change_amount": "+8.40", + "change_percent": "+3.41%" + }, + { + "name": "DCC Plc", + "price": "6,655.00", + "change_amount": "+195.00", + "change_percent": "+3.02%" + }, + { + "name": "Glencore Plc", + "price": "153.22", + "change_amount": "+4.40", + "change_percent": "+2.96%" + }, + { + "name": "Prudential Plc", + "price": "1,360.75", + "change_amount": "+39.00", + "change_percent": "+2.95%" + }, + { + "name": "Antofagasta Holdings", + "price": "437.15", + "change_amount": "+12.30", + "change_percent": "+2.89%" + }, + { + "name": "Anglo American", + "price": "687.90", + "change_amount": "+18.50", + "change_percent": "+2.76%" + }, + { + "name": "St James's Place Plc", + "price": "934.00", + "change_amount": "+25.00", + "change_percent": "+2.75%" + } + ] + }, + "expire": 3600000, + "date": { + "year": 2016, + "month": 6, + "day": 23 + } +} diff --git a/lib/today.js b/lib/today.js index 33a2f26..a24dc83 100644 --- a/lib/today.js +++ b/lib/today.js @@ -14,6 +14,7 @@ var trains = require('./today/trains'); var history = require('./today/history'); var mdMailer = require('./today/mailer'); var mdFitbit = require('./today/fitbit'); +var todayFTSE = require('./today/todayftse'); var db_name = 'silvrgit'; var dbCouch = nano.use(db_name); @@ -21,7 +22,7 @@ require('sugar-date'); var todayCache = { last: 0, data: { - trains: {last: 0, data: []}, weather: {}, history: [], today: '', tv: {entries: []}, cal: {today: [], tomorrow: [], week: []}, swedish: {}, fitbit: {} + trains: {last: 0, data: []}, weather: {}, history: [], today: '', tv: {entries: []}, cal: {today: [], tomorrow: [], week: []}, swedish: {}, fitbit: {}, ftse:{} }, expire: ((60 * 1000) * 60) }; var file = __dirname + '/' + 'newdata.json'; @@ -191,6 +192,14 @@ module.exports = { logger.error(e); }); + todayFTSE.getFTSE() + .then((d) => { + todayCache.data.ftse = d; + }) + .catch((e) => { + logger.error(e); + }); + for (var t = 0; t < calHandler.calendars.length;t++) { calHandler.getAdvancedCalV3(calHandler.calendars[t]) @@ -237,7 +246,7 @@ setTimeout(function() { setTimeout(function() { // MdMailer.sendEmailV1(todayCache, __dirname); // saveToDB(todayCache); - // saveData(); + saveData(); }, 45000); cron.schedule('45 6 * * *', function() { module.exports.preLoadToday(); diff --git a/lib/today/todayftse.js b/lib/today/todayftse.js new file mode 100644 index 0000000..e93ab88 --- /dev/null +++ b/lib/today/todayftse.js @@ -0,0 +1,30 @@ +/** + * + * User: Martin Donnelly + * Date: 2016-06-23 + * Time: 11:45 + * + */ +var ftse = require('ftse'); + + +module.exports = { + + getFTSE: function() { + + return new Promise(function(resolve, reject) { + "use strict"; + + var err = 0; + ftse('100', 10, 'risers', function(items) { + + if (items === err) { + return reject(err); + } + return resolve(items); + }); + + }); + + } +}; diff --git a/package.json b/package.json index 4c30b5b..35f3ed0 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,7 @@ "errorhandler": "^1.4.3", "express": "^4.13.4", "express-session": "^1.13.0", + "ftse": "^1.0.6", "ical2json": "^0.2.0", "logger": "0.0.1", "method-override": "^2.3.5",