twindle-co / twindle

Twindle - an open source project for beginners. Converting twitter threads to pdf, epub, and mobi format to be read by Kindle.
https://www.twindle.co
MIT License
134 stars 133 forks source link

Create mobi without Calibre #782

Closed Proful closed 3 years ago

johnjacobkenny commented 3 years ago

I took a look at the resources available for mobi format, and there seems to be very little in terms of code that we might reuse, especially in the nodejs space. One thing that I saw had potential was the software calibre. It has a mobi module written in python (https://github.com/kovidgoyal/calibre/tree/master/src/calibre/ebooks/mobi) and maybe we might need to port that functionality over to js if we want to consider it. But as far as I see, we might need to deep dive into understanding the mobi format.

Has anyone taken a look at this before? Any thoughts to add? @twindle-co/developer

tolgaerdonmez commented 3 years ago

We could together read the code to understand, and then implement it slowly in js, or we could copy the python code to lambda aws and use it.

johnjacobkenny commented 3 years ago

We need to take a call on how important .mobi is for our project and whether it is worth the effort taken to implement it by the following two options,

  1. Reimplement mobi support in js. This could be done two ways, if the mobi spec is open we could look at it and implement it. Otherwise we would need to take a look at the existing implementation by calibre and figure it out.

  2. Run a python lambda service which would mean additional costs. Also how does someone run this locally through the cli?

@proful @tolgaerdonmez

PuruVJ commented 3 years ago

It can be run locally using node's version of exec, thought it would require python installed on their system, and this is just a whole new level of complexity.

Or could use puppeteer(again!) to use one of the free pdf to mobi sites to do our work. These are free and simply do not care enough about scraping, as they aren't by huge companies with huge resources

PuruVJ commented 3 years ago

https://medium.com/swlh/run-python-script-from-node-js-and-send-data-to-browser-15677fcf199f This above would be very hard, but doable.

PuruVJ commented 3 years ago

I can write Python code, and I'm pretty sure there are those at Twindle who can too, but we should avoid doing it though, as it would unnecessarily introduce a dependency (Python itself).

PuruVJ commented 3 years ago

No interactions last 15 days. Anyone in @twindle-co/developer have fresh ideas?

PuruVJ commented 3 years ago

I believe we now have green flag to go ahead and look into the calibre approach, so this issue is irrelevant now? Should be closed @proful ?

tolgaerdonmez commented 3 years ago

I believe we now have green flag to go ahead and look into the calibre approach, so this issue is irrelevant now? Should be closed @proful ?

yep I'm going to implement that using calibre-cli