Skip to content

Instantly share code, notes, and snippets.

@ik11235
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ik11235/7d5d3429675dc53e0e17 to your computer and use it in GitHub Desktop.
Save ik11235/7d5d3429675dc53e0e17 to your computer and use it in GitHub Desktop.
function parseRss(url)
{
//引数で渡されたURLのRSSの解析
var xml = UrlFetchApp.fetch(url).getContentText();;
var document = XmlService.parse(xml);
var root = document.getRootElement();
var entries = document.getRootElement().getChild('channel').getChildren('item');
//最新の記事のタイトルとURL
//更新のたびに通知される想定なので、必要なのはその時点での最も最新の記事情報のみ
var title = entries[0].getChild('title').getText();
var link = entries[0].getChild('link').getText();
/*
スプレッドシート等への書き込み処理
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment