Skip to content

Instantly share code, notes, and snippets.

@twotix
Last active December 16, 2015 14:38
Show Gist options
  • Save twotix/5449649 to your computer and use it in GitHub Desktop.
Save twotix/5449649 to your computer and use it in GitHub Desktop.
function myFunction() {
rss = '<?xml version="1.0"?><rss version="2.0">';
rss += ' <channel><title>Twitter ' + type + ': ' + key + '</title>';
rss += ' <link>' + htmlentities ( json ) + '</link>';
rss += ' <pubDate>' + new Date() + '</pubDate>';
for (var i=0; i<len; i++) {
var sender = tweets[i].user.screen_name;
var tweet = htmlentities ( tweets[i].text );
rss += "<item><title>" + sender + ": " + tweet + "</title>";
rss += " <author>" + tweets[i].user.name
+ " (@" + sender + ")</author>";
rss += " <pubDate>" + tweets[i].created_at + "</pubDate>";
rss += " <guid isPermaLink='false'>" + tweets[i].id_str + "</guid>";
rss += " <link>https://twitter.com/" + sender
+ "/statuses/" + tweets[i].id_str + "</link>";
rss += " <description>" + tweet + "</description>";
rss += "</item>";
}
rss += "</channel></rss>";
return rss;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment