Last active
August 29, 2015 14:17
-
-
Save ik11235/7d5d3429675dc53e0e17 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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