Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 02-08-2013, 09:18 PM   #1
ezyang
Junior Member
ezyang began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Feb 2013
Location: Stanford, CA
Device: Kindle Paperwhite
Convert links into "Send to Kindle/etc" actions

Suppose that you are using Calibre's news recipes to send articles to your Kindle. Now, most blog posts have lots of links in them, and if you click on them, you will open up your browser (if you have one) and the reading experience will generally not be very pleasant. What we would actually like is for the links to cause some external party to convert the destination of the link into a nice ebook format which then gets sent to my device. E.g. "Send to Kindle"ify all my links.

I'm wondering: has anyone already created this? (For example, converting links to use Readability to Send To Kindle)
ezyang is offline   Reply With Quote
Old 02-08-2013, 10:42 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If you want to convert links to any other form it's trivial, just implement postprocess_html in the recipe and overwrite the links however you like.
kovidgoyal is offline   Reply With Quote
Advert
Old 02-15-2013, 02:51 AM   #3
ezyang
Junior Member
ezyang began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Feb 2013
Location: Stanford, CA
Device: Kindle Paperwhite
Yeah, it seems the actual hard bit is figuring out how to make a link that actually "sends to Kindle." Readability's API seems pretty opaque here...
ezyang is offline   Reply With Quote
Old 02-18-2013, 04:50 PM   #4
atordo
Connoisseur
atordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to behold
 
Posts: 89
Karma: 19669
Join Date: Apr 2012
Device: Kindle Touch
If you have an account in sendtoreader.com, you can achieve that by prepending "s2r.me/" to the URL, that is, changing "http://whatever" by "http://s2r.me/whatever". Note that this will open the browser anyway, as you need to contact sendtoreader to pass it the link, but you should have it converted to ebook next time you sync content.

http://sendtoreader.com/blog/tips/s2...dle-to-kindle/
atordo is offline   Reply With Quote
Old 02-23-2013, 09:25 PM   #5
ezyang
Junior Member
ezyang began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Feb 2013
Location: Stanford, CA
Device: Kindle Paperwhite
OK, at the moment, I have this horrible hack:

Code:
    def postprocess_html(self, soup, first_fetch):
        for e in soup.findAll('a'):
            e['href'] = "http://s2r.me/" + e['href']
        return soup
Probably could be made more robust...
ezyang is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
change "send to kindle" e-mail addresses? franklekens Amazon Kindle 7 09-25-2012 05:28 PM
Kindle for iOS updates with "Send to Kindle" and PDF support. Nexutix Apple Devices 9 01-02-2012 12:37 PM
Quick links "Book" for your kindle Harry_Y Amazon Kindle 9 08-24-2011 09:05 PM
"Send to Kindle" app =X= Android Devices 10 03-14-2011 05:50 PM
Chrome Browser "send to Kindle" app Bic Amazon Kindle 5 02-12-2011 06:38 AM


All times are GMT -4. The time now is 06:03 PM.


MobileRead.com is a privately owned, operated and funded community.