clippings-gem解析 Kindle 剪贴文件中的笔记和标记
Clippings
Clippings 能够解析 Kindle 剪贴文件中的笔记和标记。
安装
Add this line to your application's Gemfile:
gem 'clippings'
And then execute:
$ bundle
Or install it yourself as:
$ gem install clippings
使用
require 'clippings' clippings = Clippings::Parse.new("My Clippings.txt") notes = clippings.parseForNote notes.each do |title, note| print title, note[:author], note[:fragment] end
示例
test.txt
========== HTTP权威指南 (图灵程序设计丛书) ([美]David Gourley Brian Totty Marjorie Sayer Sailu Reddy Aushu Aggarwal) - 您在位置 #425-426的标注 | 添加于 2017年6月16日星期五 下午8:21:59 下报文是如何通过传输控制协议(Transmission Control Protocol,TCP)连接从一个地方搬移到另一个地方去的。 ========== HTTP权威指南 (图灵程序设计丛书) ([美]David Gourley Brian Totty Marjorie Sayer Sailu Reddy Aushu Aggarwal) - 您在位置 #802 的笔记 | 添加于 2017年6月16日星期五 下午9:02:31 解析相对url 的算法 ========== The Well-Grounded Rubyist, Second Edition (David A. Black) - 您在位置 #7107-7107的标注 | 添加于 2017年9月5日星期二 上午10:13:28 Ranges have begin and end methods, ========== The Well-Grounded Rubyist, Second Edition (David A. Black) - 您在位置 #7193-7193的标注 | 添加于 2017年9月5日星期二 上午10:28:42 To remove an object, use delete: ==========
Code
require 'clippings' clippings = Clippings::Parse.new("test.txt") notes = clippings.parseForNote p notes
Output
{ "HTTP权威指南 (图灵程序设计丛书)"=> { :title=>"HTTP权威指南 (图灵程序设计丛书)", :author=>"[美]David Gourley Brian Totty Marjorie Sayer Sailu Reddy Aushu Aggarwal", :fragment=> [ { :content=>"HTTP 是个应用层协议\r\n", :type=>"标注", :date=>" 2017年6月16日星期五 下午8:22:18" }, { :content=>"解析相对url 的算法\r\n", :type=>"笔记", :date=>" 2017年6月16日星期五 下午9:02:31" }, { :content=>"RFC 2396 中\r\n", :type=>"标注", :date=>" 2017年6月16日星期五 下午9:02:31" } ] }, "The Well-Grounded Rubyist, Second Edition"=> { :title=>"The Well-Grounded Rubyist, Second Edition", :author=>"David A. Black", :fragment=> [ { :content=>"Ranges have begin and end methods,\r\n", :type=>"标注", :date=>" 2017年9月5日星期二 上午10:13:28" }, { :content=>"To remove an object, use delete:\r\n", :type=>"标注", :date=>" 2017年9月5日星期二 上午10:28:42" } ] } }
评论
KindleNote-Rails管理你的 Kindle 标记与笔记
KindleNoteKindleNote可以导出您Kindle中的标注与笔记,并支持将它们转换为MarkDown文件。您可以选择将导出的标记与笔记存储于Evernote、有道云笔记等云笔记平台,或者K
KindleNote-Rails管理你的 Kindle 标记与笔记
0
DeltaQtDELTA 文件解析
DeltaQt是一个跨平台的C++类库和函数用于解析DELTA(DEscriptionLanguageforTAxonomy)文件。
DeltaQtDELTA 文件解析
0
excel2dbexcel 转换和解析 ndb 文件工具
目的:游戏开放中有原型数据,而原型数据经常都是通过excel进行编写,关于程序如何去读取excel中的数据,方法有很多种,比如:1.将excel导入mysql中,然后由程序去读取数据库,但是客户端无法
excel2dbexcel 转换和解析 ndb 文件工具
0
IOS中解析并显示Gif文件
在iOS中加载gif图片的类库。使用ImageIO解析Gif文件,使用QuzrtzCore完成gif动画的显示。能够控制gif图片中每帧的播放时间。作者说:本工具类最大的特点就是考虑到Gif中每一帧画
IOS中解析并显示Gif文件
0