-
Notifications
You must be signed in to change notification settings - Fork 0
/
DomainWave.xml
70 lines (64 loc) · 2.34 KB
/
DomainWave.xml
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
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Hello Wave">
<Require feature="wave" />
</ModulePrefs>
<Content type="html">
<Content type="html">
<![CDATA[
<style> #content_div { font-size: 80%; margin: 5px; background-color: #FFFFBF;} </style>
<div id="content_div"></div>
<script type="text/javascript">
// Get userprefs
var prefs = new gadgets.Prefs();
var showdate = prefs.getBool("show_date");
var entries = prefs.getInt("num_entries");
var summaries = prefs.getBool("show_summ");
function getFeed() {
var params = {};
params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.FEED;
params[gadgets.io.RequestParameters.NUM_ENTRIES] = new Number(entries);
params[gadgets.io.RequestParameters.GET_SUMMARIES] = summaries;
var url = "http://groups.google.com/group/Google-Gadgets-API/feed/rss_v2_0_msgs.xml";
gadgets.io.makeRequest(url, response, params);
};
function response(obj) {
// obj.data contains the feed data
var feed = obj.data;
var html = "";
// Display the feed title and description
html += "<div><b>" + feed.Title + "</b></div>";
html += "<div>" + feed.Description + "</div><br>";
// Access the data for a given entry
if (feed.Entry) {
for (var i = 0; i < feed.Entry.length; i++) {
html += "<div>"
+ "<a target='_blank' href='" + feed.Entry[i].Link + "'>"
+ feed.Entry[i].Title
+ "</a> ";
if (showdate==true)
{
// The feed entry Date field contains the timestamp in seconds
// since Jan. 1, 1970. To convert it to the milliseconds needed
// to initialize the JavaScript Date object with the correct date,
// multiply by 1000.
var milliseconds = (feed.Entry[i].Date) * 1000;
var date = new Date(milliseconds);
html += date.toLocaleDateString();
html += " ";
html += date.toLocaleTimeString();
}
if (summaries==true) {
html += "<br><i>" + feed.Entry[i].Summary + "</i>";
}
html += "</div>";
}
}
document.getElementById('content_div').innerHTML = html;
};
gadgets.util.registerOnLoadHandler(getFeed);
</script>
]]>
</Content>
</Content>
</Module>