When trying to import my pocket library I got a lot of ` KeyError` on Python. Pocket API has a few idiosyncrasies, such as sometimes returning the keys on json, sometimes not.
` ` ` sh
archivebox add --parser pocket_api pocket://my_username
` ` `
Gave me this errors
` ` `
File "/app/archivebox/parsers/pocket_api.py", line 54, in link_from_article
title = article['resolved_title'] or article['given_title'] or url
KeyError: 'resolved_title'
` ` `
This commit are the patches I've changed to successfully import my library
Pass a url like `pocket://Username` to import that username's archived Pocket
library. Tokens need to be stored in ArchveBox.conf with the following keys:
```
POCKET_CONSUMER_KEY = key-from-custom-pocket-app
POCKET_ACCESS_TOKENS = {"YourUsername": "pocket-token-for-app"}
```
`POCKET_ACCESS_TOKENS` MUST be on a single line, or the JSON will be
misinterpreted by the parser as a new key/value pair.