Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Kindle clippings converted to OPML for Tinderbox (Read 9054 times)
Paul Walters
Ex Member




Kindle clippings converted to OPML for Tinderbox
May 23rd, 2009, 8:12am
 
I put together a BBEdit text factory that converts the clippings file created on an Amazon Kindle ("My Clippings.txt") into an OPML document, which can then be imported into Tinderbox.  If anyone is interested in a copy, send me an email at the link below.  The document created is not strict OPML -- the <head> is blank, which is OK for Tinderbox, but not for other OPML uses.  (With a bit of coding, this limitation can be overcome.)

Paul
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Kindle clippings converted to OPML for Tinderbox
Reply #1 - May 23rd, 2009, 9:18am
 
Very nice!  

I'd like to play  Smiley
Back to top
 
 
WWW   IP Logged
Richard Healey
Full Member
*
Offline



Posts: 1

Re: Kindle clippings converted to OPML for Tinderbox
Reply #2 - Aug 16th, 2009, 11:16pm
 
I pull the clippings file from the Kindle into Tinderbox and explode the highlights. What is the advantage of going through OPML?
Back to top
 
 
WWW   IP Logged
Ioa Petra-ka
Full Member
*
Offline



Posts: 103
Portland, Oregon, USA
Re: Kindle clippings converted to OPML for Tinderbox
Reply #3 - Oct 16th, 2009, 6:56pm
 
I'm of the same mind as Mr. Healey. I see no obvious reason for using OPML here as explode does everything I need---after a little touch-up.

I have a little TextMate command that I use for cleaning up Kindle log files to a format that is optimised for Explode. Sure, you can explode by ten equal signs right out of the box, but there are a few things about a raw Kindle file that I'd prefer different. For one, it doesn't seem to save carriage returns properly in clipped text. It outputs them as a double-space. So my script converts double-spaces to carriage returns. It also places a period after the first line of each entry, so that if you choose to do so, you can have Tinderbox use the "Resource (Author)" line for the note titles. Without the period, part of the loc reference gets presumed to be a part of the first sentence.

Here is the link to the command. To install it into TextMate, just unarchive it and then double-click it.

If you are not a user of TextMate, the Bundle is really just a very short Ruby script, source below:

Code:
#!/usr/bin/ruby -w
fline = true
lines = STDIN.read.split("\n").map! do |line|
	next unless line
	if fline
		line.concat('.')
		fline = false
	elsif line == '=' * 10
		fline = true
	end
	line.strip!
	line.gsub!(/\s\s/, "\n")
	line
end

STDOUT.puts lines.join("\n")
 



To use it, just pipe a Kindle log file to the script in Terminal:

Code:
cat kindle_text.txt | ./clean_kindle.rb 




P.S. This script was written for first gen Kindle log files. I have no idea if second generation devices produce identical log files, so if you have a second gen device your results may vary.
Back to top
 
« Last Edit: Oct 16th, 2009, 6:59pm by Ioa Petra-ka »  

Av
  IP Logged
Pages: 1
Send Topic Print