Skip to content

Instantly share code, notes, and snippets.

@raydive
Created October 13, 2015 17:13
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 raydive/5506502b440ec78c69f0 to your computer and use it in GitHub Desktop.
Save raydive/5506502b440ec78c69f0 to your computer and use it in GitHub Desktop.
夜フクロウのタブ情報をさくっと出力できるようにした
# 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