Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
夜フクロウのタブ情報をさくっと出力できるようにした
# 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
You can’t perform that action at this time.