pocket-lib.el
This is a simple library for accessing the getpocket.com API. It should be considered in late alpha/early beta status at the moment: there are no known bugs, and some features may still be added. The API is not expected to change significantly, but backward-incompatible changes might still be made (although this is unlikely).
Installation
MELPA
Just install the pocket-lib package. :)
Manual
Put pocket-lib.el in your load-path.
Usage
Authorize
First you must authorize this library to access your Pocket account.
- Open your web browser to the Pocket web site, and log out of Pocket. (It seems to only work if you are logged out.)
- Run
pocket-lib-get(this is not an interactive command, so you should call it in the minibuffer like(pocket-lib-get); typically this will be handled for you by packages that use this library). A URL will be copied to the clipboard and kill-ring. - Visit that URL in your browser, and authorize it.
- Run
pocket-lib-getagain. If it worked, you should see an ugly list of data containing the first 10 items on your list.
Now you can use the library.
Functions
For more detailed information on each function, use describe-function.
pocket-lib-getGet items on the reading list. Call with keyword arguments, as listed in the API docs, to get different kinds of items (e.g. archived, favorited, tagged, etc).pocket-lib-add-urlsAdd one or more URLs to reading list.
These functions operate on one or more items, which should be alists, structured like items retrieved with pocket-lib-get, having at least the item_id property.
pocket-lib-archiveArchive items.pocket-lib-readdRe-add items to reading list (not a new URL).pocket-lib-deleteDelete items from reading list.pocket-lib-favoriteMark items as a favorite.pocket-lib-unfavoriteUnmark items as a favorite.pocket-lib--tags-actionExecute ACTION with TAGS on ITEMS. ACTION should be a tags action from the API. (Specific tags actions may be added separately in the future, in which case this function would be considered private, so it will remain named with a double-hyphen.)pocket-lib--process-tagsReturn simple list of strings for TAGS structure as returned by Pocket API. The Pocket API returns items’ tags in a peculiar structure. This function turns that structure into a simple list of tags. This is probably useful for users of this library, but the double-hyphen name will remain for now.
Changelog
0.1-pre
Initial release.
Credits
This package is based on pocket-api.el by DarkSun/lujun9972, which is based on el-pocket by Tod Davies. It has essentially been completely written; no code remains except pocket-lib-default-extra-headers, a few lines in the call to request, and the consumer key is currently the same.
License
GPLv3