PROBABLY BROKEN SO ARCHIVING THIS.
Converts Twitter provided advertiser list PDF to a CSV file of user-ids that can be imported as a blocklist.
- Python 3.x (I tested this on Python 3.6.1.)
You can install these via pip.
- PyPDF2
- python-twitter
To use this script you will need a set of Twitter API credentials.
This can be obtained via Twitter Application Management.
To use this script you will need a PDF list of your Twitter advertisers.
This can be obtained from Twitter themselves like so:
- Log into your Twitter account via twitter.com.
- Click on the user icon to the left of the "Tweet" button.
- Click on "Settings and privacy".
- Click on "Your Twitter data".
- Twitter will ask you to confirm your password, do so.
- Scroll to the bottom of the page, click a button marked "Request advertiser list" under the header "Tailored audiences".
- Twitter will generate the PDF file and e-mail it to the e-mail address associated with your Twitter account.
- Download said PDF file from the e-mail sent.
- Use said PDF file with this script.
This script outputs a new-line delimited file that can be imported via Twitter's blacklist import functionality.
This is how you do that:
- Log into your Twitter account via twitter.com.
- Click on the user icon to the left of the "Tweet" button.
- Click on "Settings and privacy".
- Click on "Blocked accounts".
- Click on "Advanced options".
- Click on "Import a list".
- Attach the script generated file and preview it before you follow through.
If you need help or run into issues running this script, please open a GitHub issue and I will try to help you.