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

Duplicate code removal from twitter.js and standardize everything #810

Closed PuruVJ closed 3 years ago

PuruVJ commented 3 years ago

After @Mira-Alf added the feature to merge multiple threads into one single PDF, there's been some duplication in the twitter.js file, which can be improved. We need to clean up stuff, and standardize one single function.

The function recently introduced, getTweetsFromThreads has similar logic as the getTweetFromID, and getting a single tweet is a special case of getting many threads, so I say, we make the getTweetsFromThreads function the de-facto function for appropriately getting tweets. This will eliminate lot of duplictated code, and reduce the surface area for bugs,

Your thoughts @proful @johnjacobkenny @Mira-Alf ?

PuruVJ commented 3 years ago

I'm nearly done with it. It was very easy to do.