News for hackers. Stuff that matters.
Re:Show HN: Build a Kindle book of PG's essays by phreeza on Sunday November 18, 2012 @08:05AM (#4800518)
I did a script like this a while back, and asked pg before releasing it. He asked me not to do it so I refrained.

edit: just checked my email, i actually asked him about putting up the epub, not the script. but same difference I suppose.

Re:Show HN: Build a Kindle book of PG's essays by reitzensteinm on Sunday November 18, 2012 @08:56AM (#4800569)
I can't speak for how pg feels, but that is a very different kettle of fish.

In your case, you'd have been modifying and distributing his content, rather than providing users a tool for consuming content they have obtained directly from pg.

Think hosting mirrored ad free sites vs creating AdBlock.

He might still have a problem with this (if only because of server load), and it would have been a good idea to check first, but your experience isn't evidence one way or another.

Re:Show HN: Build a Kindle book of PG's essays by PanMan on Sunday November 18, 2012 @08:02AM (#4800510)
Impressive how short this can be with the right libraries: 40 lines of code to scrape an index, download the pages, get the right parts, and make them an ebook.

However, wouldn't it be more efficient if one person would do this, and publish it? Now everybody has to scrape PG's site. Thanks for the code tho!

What is the licence on the articles?

[deleted]
Re:Show HN: Build a Kindle book of PG's essays by gbraad on Sunday November 18, 2012 @08:34AM (#4800551)
The result is an invalid ePub book since some pages do not follow strict xhtml rules; tag mismatch. iBooks and some other readers fail to render them.

This page contains the following errors: error on line 13 at column 7: Opening and ending tag mismatch: font line 0 and p

Re:Show HN: Build a Kindle book of PG's essays by wslh on Sunday November 18, 2012 @11:18AM (#4800820)
Use lxml.html instead of BeautifulSoup
Re:Show HN: Build a Kindle book of PG's essays by kami8845 on Sunday November 18, 2012 @12:04PM (#4800924)
Re:Show HN: Build a Kindle book of PG's essays by harpb on Sunday November 18, 2012 @03:27PM (#4801552)
+1 for PyQuery - it is definitely my favorite out of them all.
Re:Show HN: Build a Kindle book of PG's essays by chongli on Sunday November 18, 2012 @08:25AM (#4800538)
I tried running it and it chokes on "Chapter 1 of ANSI Common Lisp". I think that's due to the link being a txt file rather than html, causing an exception to be thrown: "Error: URL doesn't exist".
Re:Show HN: Build a Kindle book of PG's essays by olasitarska on Sunday November 18, 2012 @08:59AM (#4800573)
Fixed, thanks!
Re:Show HN: Build a Kindle book of PG's essays by tangue on Sunday November 18, 2012 @10:19AM (#4800687)
Those essays are available for free on his site. If you want to scrap it for yourself, you're in a grey zone, but it will be fine. But hey, authors deserve respect : if an author wants to publish an ebook, he will.
Re:Show HN: Build a Kindle book of PG's essays by georgeorwell on Sunday November 18, 2012 @11:10AM (#4800804)
Why am I in a grey zone for manipulating a bunch of bytes that I have downloaded into a format I find convenient?

The bytes were distributed legally by the copyright holder.

I downloaded the bytes legally using an ISP that I paid for.

The author did not use a robots.txt indicating his wishes that I not download the bytes using an automatic tool.

The bytes are unprotected by DRM.

I have no intention to distribute the bytes to anyone else.

I have not broken the DRM on my ebook reader.

Re:Show HN: Build a Kindle book of PG's essays by tangue on Sunday November 18, 2012 @02:06PM (#4801232)
You can scrap for yourself (or in Instapaper, but that's another story), but sharing a script and telling the others to do so is bad.

Call me old fashioned, but I'm thinking that an author has his word to say on the way to structure and distribute his works.

Re:Show HN: Build a Kindle book of PG's essays by cowsaysoink on Sunday November 18, 2012 @01:23PM (#4801121)
Scraping content isn't bad if you aren't redistributing it, technically your web browser is scraping content in the same sense.

http://paulgraham.com/robots.txt doesn't disallow robots from reading the essays.

Re:Show HN: Build a Kindle book of PG's essays by tangue on Sunday November 18, 2012 @02:16PM (#4801261)
Let's not be naïve. This is geek-clad redistribution.
Re:Show HN: Build a Kindle book of PG's essays by riffraff on Sunday November 18, 2012 @08:06AM (#4800520)
isn't kindle's format different from epub?
Re:Show HN: Build a Kindle book of PG's essays by davidw on Sunday November 18, 2012 @08:41AM (#4800556)
Yes, but if you email an epub to yourself, or use KindleGen, it can convert ePubs. Under the hood, they're pretty similar.
Re:Show HN: Build a Kindle book of PG's essays by sebcioz on Sunday November 18, 2012 @08:01AM (#4800508)
Could you upload result - epub file?
Re:Show HN: Build a Kindle book of PG's essays by dirkk0 on Sunday November 18, 2012 @11:23AM (#4800828)
This is the resulting ebook file: https://dl.dropbox.com/u/728316/Paul%20Graham%27s%20Essays.e...

And this is the (Kindle compatible) .mobi conversion: https://dl.dropbox.com/u/728316/Paul%20Graham%27s%20Essays.m...

The conversion was done through this service: http://www.2epub.com/

Re:Show HN: Build a Kindle book of PG's essays by paulovsk on Friday November 23, 2012 @11:10AM (#4822635)
Thank you, I always wanted to read it on my kindle.
Re:Show HN: Build a Kindle book of PG's essays by smartial_arts on Sunday November 18, 2012 @05:45AM (#4800367)
Ola, this is brilliant!
Re:Show HN: Build a Kindle book of PG's essays by olasitarska on Sunday November 18, 2012 @07:24AM (#4800451)
Thanks ;) It's rather a simple script, but I've always wanted to read PG essays on my Kindle.
Re:Show HN: Build a Kindle book of PG's essays by denzil_correa on Sunday November 18, 2012 @07:03AM (#4800433)
Super cool stuff. :-)
Re:Show HN: Build a Kindle book of PG's essays by olasitarska on Sunday November 18, 2012 @07:23AM (#4800450)
Thanks! :)