-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathfeed.js
More file actions
27 lines (27 loc) · 832 Bytes
/
feed.js
File metadata and controls
27 lines (27 loc) · 832 Bytes
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
function (head, req) {
start({
'headers': {
'Content-Type': 'text/xml'
}
});
uri = req.query.app;
send('<rss><channel><title>' + req.query.startkey + '</title><link>');
send(uri);
send('</link><description>Created or updated items.</description>');
while(row = getRow()){
var i=0;
var topic="";
for (var t in row.doc.topics){
topic+=t+", ";
}
send(''.concat(
'<item>',
'<title>' + row.doc.item_name + '</title>',
'<description> Lieu : ' + row.doc.spatial + ' Créé le : ' + row.doc.created + ' Catégorie(s) : ' + topic + '</description>',
'<link>' + uri + '/item/' + row.doc.item_corpus + '/' + row.id + '</link>',
'<guid>Modifié le : ' + row.doc.record.modified + '</guid>'
'</item>'
));
}
send('</channel></rss>');
}