A script that deletes things tagged with whatever you like, on Pocket.
Using the terminal on MacOS, given you have Python and Git (should come with MacOS).
Clone this project:
git clone https://github.com/david-mears/pocket-tag-delete.gitChange into the newly created directory:
cd pocket-tag-deleteMake sure geckodriver is intalled. (Might be fiddly for MacOS Catalina, the geckodriver devs are working on it. The below works on 21st December 2019.)
curl -OL https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-macos.tar.gz
tar -xvf geckodriver-v0.26.0-macos.tar.gzPut geckodriver on PATH. That means: take the filepath to the directory containing geckodriver, and add it to the environment variable called PATH. If the filepath to the directory containing geckodriver is /Users/david/random_directory, then:
export PATH=$PATH:/Users/david/random_directoryAlso make sure Firefox is installed.
Still/back in the directory pocket-tag-delete, create and activate the virtual environment:
python3 -m venv env(That's assuming you have Python 3.)
source env/bin/activateThen:
pip install -r requirements.txtCreate a file called '.env' in the root directory:
touch .envand open it:
open .env
Put in your pocket username and password, e.g., and save the file:
POCKET_USERNAME=my@username.com
POCKET_PASSWORD=secret_password
By default, this script deletes everything tagged 'hacker news'. To change this, just change the variable called tag in script.py before running it (line 12 at time of writing). Pocket turns whitespaces in the tags into hyphens for the purposes of this url.
To run, you'll have installed, and activated the virtual environment:
python script.pyIf it errors, try it again. Will probably fail for the last few of a tag, which you'll need to do manually.