https://github.com/conanchou/kce_clj
Kindle Clipping Extractor in Clojure
https://github.com/conanchou/kce_clj
clojars clojure clojure-library kindle-clippings kindle-highlights
Last synced: 3 months ago
JSON representation
Kindle Clipping Extractor in Clojure
- Host: GitHub
- URL: https://github.com/conanchou/kce_clj
- Owner: ConanChou
- License: mit
- Created: 2017-05-20T19:02:01.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-21T04:57:09.000Z (over 8 years ago)
- Last Synced: 2025-06-08T22:31:38.325Z (7 months ago)
- Topics: clojars, clojure, clojure-library, kindle-clippings, kindle-highlights
- Language: Clojure
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Kindle Clipping Extractor in Clojure (kce-clj)
A simple library to extract Kindle generated `clipping.txt`.
[](https://clojars.org/kce-clj)
## Usage
kce_clj comes with 2 flavors. A hard-working version and a lazy version:
```
λ (time (nth (extract "clipping.txt" "EST") 42))
"Elapsed time: 35.68178 msecs"
{:category :highlight,
:page {:start 7, :end 7},
:title "Dance Music Manual: Tools, Toys, and Techniques",
:author "Snoman, Rick",
:timestamp #inst "2016-06-30T15:21:52.000-00:00",
:location {:start 274, :end 275},
:text "The harmonic minor scale is very similar to the natural minor scale
but with the seventh note increased, or augmented, up the scale by a
semitone."}
λ (time
(with-open [rdr (clojure.java.io/reader "clipping.txt")]
(nth (lazy-extract rdr "EST") 42)))
"Elapsed time: 6.201403 msecs"
{:category :highlight,
:page {:start 7, :end 7},
:title "Dance Music Manual: Tools, Toys, and Techniques",
:author "Snoman, Rick",
:timestamp #inst "2016-06-30T15:21:52.000-00:00",
:location {:start 274, :end 275},
:text "The harmonic minor scale is very similar to the natural minor scale
but with the seventh note increased, or augmented, up the scale by a
semitone."}
```
As you can see, you need to be a bit more hard-working if you want your code to be lazy :)
### Parameters
```
(use '[kce-clj.core :only [extract lazy-extract]])
(extract file_path_string tz_id)
(lazy-extract file_reader tz_id)
```
`tz_id` is a java `TimeZone` ID. `file_reader` should be a `clojure.java.io/reader`.
## License
MIT