Skip to content

Instantly share code, notes, and snippets.

@rcknr
Created August 30, 2012 08:35
Show Gist options
  • Save rcknr/3524230 to your computer and use it in GitHub Desktop.
Save rcknr/3524230 to your computer and use it in GitHub Desktop.
Apps Script Release Notes RSS Feed
function getFeed() {
var cache = CacheService.getPublicCache();
var cachedFeed = cache.get("gas-relnotes-feed");
if(cachedFeed == null) {
var URL = "https://developers.google.com/apps-script/release_notes";
var feedSize = 25;
var data = UrlFetchApp.fetch(URL).getContentText();
var dox = Xml.parse(data, true);
var text = dox.html.body.toXmlString().replace(/<\?[^>]*>/g,"");
var e4x = new XML(text);
var releases = e4x..h3;
var notes = [];
for(n in releases) {
if(n < feedSize) {
var title = releases[n];
var url = URL+"#"+releases[n].@['id'];
var description = releases[n].parent().children()[releases[n].childIndex()+1];
notes.push({title:title, url:url, description:description});
}
else break;
}
var template = HtmlService.createTemplateFromFile("Feed");
template.notes = notes;
var feed = template.evaluate().getContent();
cache.put("gas-relnotes-feed", feed);
}
else var feed = cachedFeed;
return feed;
}
function doGet() {
return ContentService
.createTextOutput(getFeed())
.setMimeType(ContentService.MimeType.RSS);
}
<rss version="2.0">
<channel>
<title>Apps Script Release Notes</title>
<link>https://developers.google.com/apps-script/release_notes</link>
<description>This page identifies changes to Google Apps Script and the dates that those changes were introduced. This document is intended to be a reference for developers who are looking for an easy way to identify recent changes to Google Apps Script services. Changes in this document will be listed by date, beginning with the most recently released changes. Each change in the list will link to the corresponding place in the documentation, if applicable, to help you easily locate the updated documentation.</description>
<? for(n in notes) { ?>
<item>
<title><?=notes[n].title?></title>
<link><?=notes[n].url?></link>
<description><?=notes[n].description?></description>
<pubDate><?=Utilities.formatDate(new Date(Date.parse(notes[n].title)), "GMT", "E, dd MMM yyyy HH:mm:ss z")?></pubDate>
<guid isPermaLink="true"><?=notes[n].url?></guid>
</item>
<? } ?>
</channel>
</rss>
@loicbisiere
Copy link

Does this script still work ?

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment