-
Notifications
You must be signed in to change notification settings - Fork 0
/
rss.html
79 lines (70 loc) · 2.07 KB
/
rss.html
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body {
background-color: #37536A;
color: #ffffff;
width: 50vw;
}
.medium-blog-post {
display: table;
cursor: pointer;
transition: background-color 0.15s ease-in, transform 0.2s ease-in;
margin-bottom: 50px;
}
.medium-blog-title {
display: table-cell;
background-color: #FFFFFF;
color: #37536A; /*darkblue*/
width: 75%;
padding: 20px 40px;
}
.medium-blog-title h2 {
margin: 0;
}
.medium-blog-date {
position: relative;
display: table-cell;
color: #FFFFFF;
background-color: #71C6D2; /*vibblue*/
vertical-align: top;
height: 100%;
padding: 20px;
width: 25%;
}
.medium-blog-post:hover {
background-color: #71C6D2; /*vibblue*/
transform: scale(1.01);
}
</style>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-dateFormat/1.0/jquery.dateFormat.js"></script>
</head>
<body>
<h1>My First Heading</h1>
<div id="rss-test-content"></div>
<script type="application/javascript">
$(function () {
var $content = $('#rss-test-content');
var data = {
rss_url: 'https://api.zotero.org/groups/4391561/collections/V7BDQZSQ/items/top?direction=desc&format=atom&sort=dateAdded'
};
$.get('https://api.rss2json.com/v1/api.json', data, function (response) {
if (response.status == 'ok') {
var output = '';
$.each(response.items, function (k, item) {
output += '<div class="medium-blog-post" onclick="window.open(\'' + item.guid + '\',\'mywindow\');">'
output += '<div class="medium-blog-title"><h2>' + item.title + '</h2></div>';
output += '<div class="medium-blog-date">' + $.format.date(item.pubDate, "MMM dd, yyyy") + '</div>';
output += '</div>';
return k < 3;
});
$content.html(output).hide();
$content.fadeIn('slow');
}
});
});
</script>
</body>
</html>