mirror of
https://gitlab.silvrtree.co.uk/martind2000/old-silvrgit.git
synced 2025-01-10 22:05:07 +00:00
added swedish word of the day
This commit is contained in:
parent
87f98af3f6
commit
62e3c8711e
6
.idea/jsLibraryMappings.xml
Normal file
6
.idea/jsLibraryMappings.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="JavaScriptLibraryMappings">
|
||||||
|
<file url="file://$PROJECT_DIR$" libraries="{silvrgit node_modules}" />
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -1,6 +1,6 @@
|
|||||||
doctype html
|
|
||||||
html(lang="en")
|
html(lang="en")
|
||||||
head
|
head
|
||||||
|
meta(charset='utf-8')
|
||||||
title
|
title
|
||||||
Today
|
Today
|
||||||
body
|
body
|
||||||
@ -35,6 +35,12 @@ html(lang="en")
|
|||||||
h2 Calendar
|
h2 Calendar
|
||||||
each line in data.cal.entries
|
each line in data.cal.entries
|
||||||
p !{line.combined}
|
p !{line.combined}
|
||||||
|
.swedish
|
||||||
|
h2 Word of the day
|
||||||
|
p(style="font-weight:900;")= data.swedish.xml.words.word
|
||||||
|
p It is an #{data.swedish.xml.words.wordtype} which means '<em>#{data.swedish.xml.words.translation}</em>'.
|
||||||
|
p Example: #{data.swedish.xml.words.fnphrase}
|
||||||
|
p Translated: #{data.swedish.xml.words.enphrase}
|
||||||
.history
|
.history
|
||||||
h2 Today in history
|
h2 Today in history
|
||||||
if data.history.length > 0
|
if data.history.length > 0
|
||||||
|
@ -42,4 +42,4 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.getSwedishWord();
|
//module.exports.getSwedishWord();
|
18
lib/today.js
18
lib/today.js
@ -7,7 +7,7 @@ var jsonfile = require('jsonfile'), fs = require('fs'), STRING = require('string
|
|||||||
var log4js = require('log4js');
|
var log4js = require('log4js');
|
||||||
var logger = log4js.getLogger();
|
var logger = log4js.getLogger();
|
||||||
var calHandler = require('./calHandler');
|
var calHandler = require('./calHandler');
|
||||||
|
var swedishWord = require('./swedishword');
|
||||||
|
|
||||||
var todayCache = {
|
var todayCache = {
|
||||||
last: 0,
|
last: 0,
|
||||||
@ -17,7 +17,8 @@ var todayCache = {
|
|||||||
history: [],
|
history: [],
|
||||||
today: '',
|
today: '',
|
||||||
tv:{entries:[]},
|
tv:{entries:[]},
|
||||||
cal:{entries:[]}
|
cal:{entries:[]},
|
||||||
|
swedish:{}
|
||||||
},
|
},
|
||||||
expire: ((60 * 1000) * 60)
|
expire: ((60 * 1000) * 60)
|
||||||
};
|
};
|
||||||
@ -359,6 +360,15 @@ module.exports = {
|
|||||||
logger.error(e);
|
logger.error(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
swedishWord.getSwedishWord(function(v) {
|
||||||
|
todayCache.data.swedish = v ;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
logger.error(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// word of the day http://wotd.transparent.com/rss/swedish-widget.xml?t=1455840000000
|
// word of the day http://wotd.transparent.com/rss/swedish-widget.xml?t=1455840000000
|
||||||
@ -389,12 +399,12 @@ function sendEmailV1() {
|
|||||||
console.log('compiled template email sent');
|
console.log('compiled template email sent');
|
||||||
});
|
});
|
||||||
|
|
||||||
//saveData();
|
// saveData();
|
||||||
var fn = jade.compileFile(template.file);
|
var fn = jade.compileFile(template.file);
|
||||||
|
|
||||||
console.log(fn(todayCache));
|
console.log(fn(todayCache));
|
||||||
|
|
||||||
//fs.writeFileSync(htmlfile, fn(todayCache));
|
// fs.writeFileSync(htmlfile, fn(todayCache));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
"request": "^2.67.0",
|
"request": "^2.67.0",
|
||||||
"simple-weather": "^1.2.2",
|
"simple-weather": "^1.2.2",
|
||||||
"wordsoap": "^0.2.0",
|
"wordsoap": "^0.2.0",
|
||||||
|
"xmljson": "^0.2.0",
|
||||||
"xmltojson": "^1.1.0"
|
"xmltojson": "^1.1.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
Loading…
Reference in New Issue
Block a user