-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
31 lines (26 loc) · 1.33 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Note: some RSS feeds can't be loaded in the browser due to CORS security.
// To get around this, you can use a proxy.
const CORS_PROXY = "https://cors-anywhere.herokuapp.com/"
let parser = new RSSParser({})
parser.parseURL(CORS_PROXY + 'http://www.rssmix.com/yourcombinedfeeds.xml', function(err, feed) {
//console.log(feed.title);
var counter = 0;
feed.items.forEach(function(entry) {
//console.log(entry);
counter++;
if (counter < 7) {
var thetitle = entry.title;
thetitle = thetitle.replace("Brad W. is drinking an", "");
thetitle = thetitle.replace("Brad W. is drinking a", "");
document.getElementById('feed').innerHTML += '<li><span><a href=' + entry.link + '>' + thetitle + '</a></span></li>';
}
})
})
// Time Logic
var current_hour = new moment().format("HH");
var current_min = new moment().format("mm");
document.getElementById('clock').innerHTML += current_hour +' <font class="blink"><b>:</b></font> ' + current_min;
var current_day = new moment().format("D");
var current_month = new moment().format("M");
var current_year = new moment().format("YY");
document.getElementById('date').innerHTML += current_month + ' <font class="blink"><b>/</b></font> ' + current_day + ' <font class="blink"><b>/</b></font> ' + current_year;