This is a utility to keep your Pocket list small and
manageable. It will archive all items in your list except for the newest n
items.
WARNING: This will archive items. Something you can't just undo.
pocketcleaner keeps your pocket clean
Usage:
pocketcleaner [-d | --debug] [--keep=<keepCount>]
pocketcleaner -h | --help | -v | --version
Options:
-h --help Show this screen.
-d --debug Show debug information.
-v --version Show version.
--config=<config> Config file to use
--keep=<keepCount> Count of items to keep
Pocketcleaner doesn't come with any auth keys, so you will have to get your own. The following steps are taken from here.
1. Create an app in the developer portal
Make sure it has at least the retrieve
and modify
permissions.
curl https://getpocket.com/v3/oauth/request -X POST \
-H "Content-Type: application/json" -H "X-Accept: application/json" \
-d '{"consumer_key":"your-key-here","redirect_uri":"http://www.google.com"}'
Visit the following URL in your browser and authorize the app.
https://getpocket.com/auth/authorize?request_token=request-token-here&redirect_uri=http://www.google.com
curl https://getpocket.com/v3/oauth/authorize -X POST \
-H "Content-Type: application/json" -H "X-Accept: application/json" \
-d '{"consumer_key":"your-key-here","code":"request-token"}'
curl http://getpocket.com/v3/get -X POST -H "Content-Type: application/json" \
-H "X-Accept: application/json" \
-d '{"consumer_key":"your-key-here", "access_token":"access-token"}'
There are packages for linux up on packagecloud.io but you can also just clone the repo and build the binary yourself.
go get github.com/mrtazz/pocketcleaner
cd $GOPATH/src/github.com/mrtazz/pocketcleaner
make
There is also a docker image on docker hub which you can use to run pocketcleaner like this:
docker pull mrtazz/pocketcleaner
docker run -i -e "POCKETCLEANER_CONSUMER_SECRET=your_secret" -e "POCKETCLEANER_ACCESS_TOKEN=your_token" --rm mrtazz/pocketcleaner
pocketcleaner reads the configuration file $HOME/.pocketcleaner.ini
to get
consumer key, access token, and the number of items to keep. The format looks
like this:
consumer_key = consumer-key
access_token = access-token
keep_count = 100