Skip to content

Instantly share code, notes, and snippets.

@bityob
Created July 6, 2017 22:52
Show Gist options
  • Save bityob/d7d228e555f36b5a07bc9258999a6c5c to your computer and use it in GitHub Desktop.
Save bityob/d7d228e555f36b5a07bc9258999a6c5c to your computer and use it in GitHub Desktop.
Move all list to archive (Pocket)
# https://pypi.python.org/pypi/pocket-api/
from pocket import Pocket, PocketException
from sys import exit
# see link above, how to set key and token
key = ""
token = ""
p = Pocket(key, token)
print("Connected")
listp = p.retrieve(offset=0)
while len(listp['list']) > 0:
print("%d articles left" % len(listp['list']))
for idp in listp['list'].keys():
p.archive(int(idp))
print(idp)
p.commit()
listp = p.retrieve(offset=0)
print("Done")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment