Advertisement
hakarune

AppScript Code Version 1

Jun 19th, 2015
425
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. function doGet() {
  2. var ss = SpreadsheetApp.openByUrl(
  3. 'https://docs.google.com/spreadsheets/d/1lPOwiYGBK0kSJXXU9kaQjG7WNHjnNuxy25WCUudE5sk/edit');
  4. SpreadsheetApp.setActiveSpreadsheet(ss);
  5. SpreadsheetApp.setActiveSheet(ss.getSheets()[0]);
  6. var title = ss.getSheets()[0].getRange("A1:A").getValues();
  7. var titles = [];
  8. var link = ss.getSheets()[0].getRange("B1:B").getValues();
  9. var links = [];
  10. var pubdate = ss.getSheets()[0].getRange("C1:C").getValues();
  11. var pubdates = [];
  12. var description = ss.getSheets()[0].getRange("D1:D").getValues();
  13. var descriptions = [];
  14. var author = ss.getSheets()[0].getRange("E1:E").getValues();
  15. var authors = [];
  16. for (i = 0; i < title.length; i++) {
  17. titles += "<item>" + "<title>" + title[i] + "</title>";
  18. }
  19. for (i = 0; i < link.length; i++) {
  20. links += "<link>" + link[i] + "</link>";
  21. }
  22. for (i = 0; i < pubdate.length; i++) {
  23. pubdates += "<pubdate>" + pubdate[i] + "</pubdate>";
  24. }
  25. for (i = 0; i < description.length; i++) {
  26. descriptions += "<description>" + description[i] + "</description>";
  27. }
  28. for (i = 0; i < author.length; i++) {
  29. authors += "<author>" + author[i] + "</author>" + "</item>";
  30. }
  31.  
  32. return ContentService.createTextOutput(titles + links + descriptions + pubdates + authors)
  33. .setMimeType(ContentService.MimeType.RSS);
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement