Created
July 6, 2017 22:52
-
-
Save bityob/d7d228e555f36b5a07bc9258999a6c5c to your computer and use it in GitHub Desktop.
Move all list to archive (Pocket)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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