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

Make the -p flag irrelevant, just switch to to puppeteer if tweet older than 7 days #722

Closed PuruVJ closed 3 years ago

PuruVJ commented 3 years ago

Let's remove the need for the -p flag, and modify the code to switch to puppeteer if tweet is 7 days old.

Very easy to implement, no more than 5 lines needed.

Should it be done now, @johnjacobkenny @Mira-Alf @proful?

johnjacobkenny commented 3 years ago

I'm okay with it, I don't think there is any other option if the tweet is older than 7 days old. But in terms of testing out code, could you think through it how the developer might run puppeteer code explicitly?

I'm thinking not just about puppeteer, but overall. Someone working on the EPUB should be able to run that flow without hitting the api (say) multiple times?

Every flow of the code if it can be exposed to developers easily, then it would be very nice. In this case we can test using older tweet. Maybe have a few npm scripts to go through each flow?

PuruVJ commented 3 years ago

I say, we leave the -p there, but by default implement the switching. Most users simply would not care about the 7 day limit, they would just want their PDF.

PuruVJ commented 3 years ago

I'm thinking not just about puppeteer, but overall. Someone working on the EPUB should be able to run that flow without hitting the api (say) multiple times?

I don't get it? Wouldn't all the rendering flows have to first go through fetching the tweets, with API or with puppeteer?

johnjacobkenny commented 3 years ago

@PuruVJ Could you think about the flows and how we might make it easy for someone without the twitter api?

Mira-Alf commented 3 years ago

Switching to scraping if tweet is older is done by PR #727. Please take a look and approve it @johnjacobkenny and @PuruVJ . I have not done anything to the -p flag. Left it alone for now as discussed in the call.