title: Exporting Google spreadsheet to RSS format using Google Apps Script
body: <p>I'm trying to export google spreadsheet to RSS using Google Apps script. Here is my google sheet:</p>
  
  <p><a href="https://docs.google.com/spreadsheets/d/15fwOeR6Jo4UadzOTlryTucgI3ZFZ5IVM16GDSwA0XE0/edit?usp=sharing" rel="nofollow noreferrer">https://docs.google.com/spreadsheets/d/15fwOeR6Jo4UadzOTlryTucgI3ZFZ5IVM16GDSwA0XE0/edit?usp=sharing</a></p>
  
  <p>and here is my google apps script code:</p>
  
  <pre><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='&lt;?xml version="1.0" encoding="utf-8"?&gt;';
    rss+='&lt;feed xmlns="http://www.w3.org/2005/Atom"&gt;';
    rss+='&lt;title&gt;testtile &lt;/title&gt;';
    rss+='&lt;link href="www.google.com"/&gt;';
    rss+='&lt;id&gt;http://nexcono.appspot.com/frase/&lt;/id&gt;';   
    for(var i=1;i&lt;title.length;i++){
      rss+='&lt;entry&gt;';
      rss+='&lt;title&gt;sometitle '+title[i][0]+'&lt;/title&gt;';
      rss+='&lt;link rel="alternate" href="http://apple.com"/&gt;';
      rss+='&lt;id&gt;http://nexcono.appspot.com/frase/'+'&lt;/id&gt;';
      rss+='&lt;/entry&gt;';
    }
     rss+='&lt;/feed&gt;';
     return ContentService.createTextOutput(rss).setMimeType(ContentService.MimeType.RSS);
  }
  </code></pre>
  
  <p>However, when I verify using <a href="https://validator.w3.org/feed/" rel="nofollow noreferrer">https://validator.w3.org/feed/</a>, it says it's not a vlid RSS :(</p>
  
  <p>Thanks a lot,</p>