Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function doGet() {
- var ss = SpreadsheetApp.openByUrl(
- 'https://docs.google.com/spreadsheets/d/1lPOwiYGBK0kSJXXU9kaQjG7WNHjnNuxy25WCUudE5sk/edit');
- SpreadsheetApp.setActiveSpreadsheet(ss);
- SpreadsheetApp.setActiveSheet(ss.getSheets()[0]);
- var title = ss.getSheets()[0].getRange("A1:A").getValues();
- var titles = [];
- var link = ss.getSheets()[0].getRange("B1:B").getValues();
- var links = [];
- var pubdate = ss.getSheets()[0].getRange("C1:C").getValues();
- var pubdates = [];
- var description = ss.getSheets()[0].getRange("D1:D").getValues();
- var descriptions = [];
- var author = ss.getSheets()[0].getRange("E1:E").getValues();
- var authors = [];
- for (i = 0; i < title.length; i++) {
- titles += "<item>" + "<title>" + title[i] + "</title>";
- }
- for (i = 0; i < link.length; i++) {
- links += "<link>" + link[i] + "</link>";
- }
- for (i = 0; i < pubdate.length; i++) {
- pubdates += "<pubdate>" + pubdate[i] + "</pubdate>";
- }
- for (i = 0; i < description.length; i++) {
- descriptions += "<description>" + description[i] + "</description>";
- }
- for (i = 0; i < author.length; i++) {
- authors += "<author>" + author[i] + "</author>" + "</item>";
- }
- return ContentService.createTextOutput(titles + links + descriptions + pubdates + authors)
- .setMimeType(ContentService.MimeType.RSS);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement