-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotification.html
70 lines (55 loc) · 1.66 KB
/
notification.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
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="styles/post.css" type="text/css" />
<script src='scripts/jquery-1.6.1.min.js'></script>
<script src="scripts/parse.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-33222326-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = 'https://ssl.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<script>
function fetch_feed() {
chrome.extension.sendRequest({'action' : 'fetch_feed', 'url' : 'http://g5line.com/feed/'},
function(response) {
display_stories(response);
}
);
}
function display_stories(feed_data) {
xmlDoc = $.parseXML(feed_data),
$xml = $(xmlDoc),
items = $xml.find("item");
var element = items.first();
item='';
link=$(element).find('link').text();
title=$(element).find('title').text();
description=$(element).find('description').text();
item +='<div><a class="item" href="'+link+'" target="_blank">'
+'<dl>'
+'<dt><img src="images/tick.png" /> '+title+'</dt>'
+'<dd>'+description+'</dd>'
+'</dl>'
+'</a></div>';
$('#popupNotification').append(item);
}
//close notification after X amount of time
setTimeout("window.close()",25000);
</script>
</head>
<body>
<div id="popupNotification">
</div>
<script>
$(document).ready(function() {
fetch_feed();
});
</script>
</body>
</html>