AppleScript名:RSSをダウンロードしてparseする(XmlToDictKit) |
— Created 2016-11-05 by Takaaki Naganoya — 2016 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" use framework "XmlToDictKit" –https://github.com/nicklockwood/XMLDictionary set aURL to current application’s |NSURL|’s alloc()’s initWithString:"http://piyocast.com/as/feed/" set xmlString to current application’s NSString’s alloc()’s initWithContentsOfURL:aURL encoding:(current application’s NSUTF8StringEncoding) |error|:(missing value) if xmlString = missing value then return false set xmlDoc to (current application’s NSDictionary’s dictionaryWithXMLString:xmlString) set blogTitle to (xmlDoc’s valueForKeyPath:"channel.title") as string –> "AppleScirpt Hole" –タイトル一覧を取得する set titleList to (xmlDoc’s valueForKeyPath:"channel.item.title") as list –> {"XmlToDictKitでBlogのRSS情報を解析", "listのrecordをplistにserializeして、plistをde-serializeする", "Listのrecordをエンコーディングしてplist文字列にする", "serializeされたlistのrecordからKeynoteで新規ドキュメントを作成してグラフを作成", "system_profilerの結果のstringのplistをdictionaryにのコピー2", "XPathQuery4ObjCのじっけん2", "recordをXMLに v2", "XmlToDictKitでXMLをDictionaryに(remote file)", "XmlToDictKitでXMLをDictionaryに(local file)", "XMLをrecordにv2"} –URL一覧を返す set urlList to (xmlDoc’s valueForKeyPath:"channel.item.link") as list –> {"http://piyocast.com/as/archives/814", "http://piyocast.com/as/archives/812", "http://piyocast.com/as/archives/810", "http://piyocast.com/as/archives/805", "http://piyocast.com/as/archives/803", "http://piyocast.com/as/archives/799", "http://piyocast.com/as/archives/797", "http://piyocast.com/as/archives/792", "http://piyocast.com/as/archives/790", "http://piyocast.com/as/archives/788"} –本文のプレビュー一覧 set descList to (xmlDoc’s valueForKeyPath:"channel.item.description") as list (* {"AppleScript名:XmlToDictKitでBlogのRSS情報を解析 — Created 2016-11-05 by Takaaki Naganoya— 2016 Piyomaru S … <a href=\"http://piyocast.com/as/archives/814\" class=\"more-link\"><span class=\"screen-reader-text\">\"XmlToDictKitでBlogのRSS情報を解析\"の</span>続きを読む</a>", …. *) –更新日時の一覧 set descList to (xmlDoc’s valueForKeyPath:"channel.item.pubDate") as list –> {"Wed, 07 Feb 2018 08:00:53 +0000", "Wed, 07 Feb 2018 07:58:06 +0000", "Wed, 07 Feb 2018 07:55:12 +0000", "Wed, 07 Feb 2018 07:50:07 +0000", "Wed, 07 Feb 2018 07:28:10 +0000", "Wed, 07 Feb 2018 07:23:45 +0000", "Wed, 07 Feb 2018 07:23:04 +0000", "Wed, 07 Feb 2018 07:20:21 +0000", "Wed, 07 Feb 2018 07:20:13 +0000", "Wed, 07 Feb 2018 07:11:33 +0000"} |
More from my site
(Visited 57 times, 1 visits today)