LoginSignup
2
2

More than 5 years have passed since last update.

Kobitoに保存したアイテムをHTMLとMarkdownでダンプする

Posted at

まとめてエクスポートしたさがあった。

-データベースファイルの場所
- Kobito 2.x: ~/Library/Containers/com.qiita.Kobito/Data/Library/Kobito/Kobito.db
- Kobito 1.x: ~/Library/Kobito/Kobito.db

kobito-dump.rb
# Usage: $ ruby kobito-dump.rb ~/Library/Kobito/Kobito.db
require 'sqlite3'
db = SQLite3::Database.new(ARGV[0])
db.results_as_hash = true
db.execute('select * from ZITEM').each do |row|
  File.write("#{row['Z_PK']}.html", row['ZBODY'])
  File.write("#{row['Z_PK']}.md", row['ZRAW_BODY'])
end

という感じでどうだろう。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2