Python script that converts Twitter thread based on URL link into a PDF to be used as a LinkedIn carousel.
- Create new environment:
conda create --name thread
- Activate new environment:
conda activate thread
- Install python and poetry
conda install python poetry
- Let poetry install all dependencies
poetry install
Create an .env
file and copy-paste:
BEARER_TOKEN=1234qwer
CONSUMER_KEY=1234qwer
CONSUMER_SECRET=1234qwer
ACCESS_TOKEN=1234qwer
ACCESS_TOKEN_SECRET=1234qwer
with 1234qwer
being replaced by your own keys and tokens extracted from Twitter Developer.
BEARER_TOKEN
,ACCESS_TOKEN
andACCESS_TOKEN_SECRET
can be found under the Authentication Tokens section of the Keys and Tokens tab of your appCONSUMER_KEY
andCONSUMER_SECRET
can be found under the Consumer Keys section of the Keys and Tokens tab of your app
python convert2carousel.py https://twitter.com/didier_lopes/status/1570731358204600323
where the tweet to be input needs to be the first of the thread, e.g. https://twitter.com/didier_lopes/status/1570731358204600323
- Parse emojis (both on text and username)
- Parse @username
- Change box size based on text
- Adapt text based on media attached
- Adapt URL links