Skip to content

@mhawksey /gist:2720726

Embed URL


Subversion checkout URL

You can clone with
Download ZIP
Google Apps Script fetch feed item link
function fetchUrlfromRSS(url) {
var cache = CacheService.getPublicCache(); // using Cache service to prevent too many urlfetch
var cached = cache.get(url);
if (cached != null) { // if value in cache return it
return cached;
// otherwise build urlfetch
var options = {"method" : "get"};
try {
var response = UrlFetchApp.fetch(url , options);
var doc = Xml.parse(response.getContentText(),true); // parse content as xml
if ( != undefined ){ // if item is defined get link
// Note using item instead of because urls appear to be slipping out of schema
var res =^\s+|\s+$/g, '');
cache.put(url, res, 3600); // put result in cache for next time
return res;
} catch (e){
return "NONE";
return "NONE";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.