1W51qISAkmAUZ2JG4Z0FBE changeset

Changeset663737643064 (b)
ParentNone (a)
ab
0+function(head, row, req, row_info) {
0+  csv_row = function(arr) {
0+    return ['"' + item + '"' for each (item in arr)].join(',') + '\n';
0+  }
0+
0+  if (head) {
0+    return {
0+      headers: { 'Content-Type': 'text/csv' },
0+      body: csv_row(['Titel', 'URL', 'CategoriĆ«n', 'Tags'])
0+    };
0+  }
0+  else if (row) {
0+    doc = row.value;
0+    return csv_row([doc.title, doc.url, doc.categories.join(','), doc.tags.join(',')]);
0+  }
0+}
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--- Revision None
+++ Revision 663737643064
@@ -0,0 +1,16 @@
+function(head, row, req, row_info) {
+ csv_row = function(arr) {
+ return ['"' + item + '"' for each (item in arr)].join(',') + '\n';
+ }
+
+ if (head) {
+ return {
+ headers: { 'Content-Type': 'text/csv' },
+ body: csv_row(['Titel', 'URL', 'Categoriƫn', 'Tags'])
+ };
+ }
+ else if (row) {
+ doc = row.value;
+ return csv_row([doc.title, doc.url, doc.categories.join(','), doc.tags.join(',')]);
+ }
+}