Created
October 13, 2015 17:13
-
-
Save raydive/5506502b440ec78c69f0 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
# encoding: utf-8 | |
require "nokogiri" | |
doc = File.open("com.YoruFukurouProject.YoruFukurou.plist") {|f| Nokogiri::XML(f) } | |
File.open("info.txt", mode = "w") do |f| | |
doc.xpath("//dict[key='SearchTab']").each do |dict| | |
title = dict.xpath("key[.='TitleName']/following-sibling::string").text | |
names = dict.xpath("array/string").map { |e| e.text }.join(',') | |
f.write "#{title}\n#{names}\n" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment