I'm trying to export google spreadsheet to RSS using Google Apps script. Here is my google sheet:
https://docs.google.com/spreadsheets/d/15fwOeR6Jo4UadzOTlryTucgI3ZFZ5IVM16GDSwA0XE0/edit?usp=sharing
and here is my google apps script code:
function doGet() {
var ss = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/15fwOeR6Jo4UadzOTlryTucgI3ZFZ5IVM16GDSwA0XE0/edit#gid=0');
SpreadsheetApp.setActiveSpreadsheet(ss);
SpreadsheetApp.setActiveSheet(ss.getSheets()[0]);
var title = ss.getSheets()[0].getRange("A1:A3").getValues();
var rss='<?xml version="1.0" encoding="utf-8"?>';
rss+='<feed xmlns="http://www.w3.org/2005/Atom">';
rss+='<title>testtile </title>';
rss+='<link href="www.google.com"/>';
rss+='<id>http://nexcono.appspot.com/frase/</id>';
for(var i=1;i<title.length;i++){
rss+='<entry>';
rss+='<title>sometitle '+title[i][0]+'</title>';
rss+='<link rel="alternate" href="http://apple.com"/>';
rss+='<id>http://nexcono.appspot.com/frase/'+'</id>';
rss+='</entry>';
}
rss+='</feed>';
return ContentService.createTextOutput(rss).setMimeType(ContentService.MimeType.RSS);
}
However, when I verify using https://validator.w3.org/feed/, it says it's not a vlid RSS :(
Thanks a lot,