Skip to content

jpvillaisaza/pocket-haskell

Repository files navigation

Haskell bindings for the Pocket API

See Pocket and the Pocket API.

Usage

Authentication

See Pocket API: Authentication.

Example

  1. Go to your Pocket applications and get a consumer key:

    let consumerKey = "1234-abcd1234abcd1234abcd1234"
  2. Obtain a request token from Pocket:

    let
      authRequestReq =
        AuthRequestReq "<consumerKey>" "<redirectUri>" Nothing
    authRequest authRequestReq
  3. Redirect the user to Pocket:

    makeRedirect authRequestReq authRequestRsp
  4. Receive the callback from Pocket.

  5. Convert the request token into an access token:

    let
      authAuthorizeReq =
        AuthAuthorizeReq "<consumerKey>" "<requestToken>"
    authAuthorize authAuthorizeReq

Add

See Pocket API: Add.

Example

Use your application’s consumer key and a user’s access token to add items to Pocket:

let
  addReq =
    makeAddReq "<consumerKey>" "<accessToken>" "<url>"
add addReq

Modify

See Pocket API: Modify.

TODO

Retrieve

See Pocket API: Retrieve.

Example

Use your application’s consumer key and a user’s access token to retrieve data from Pocket:

let
  getReq =
    (makeGetReq "<consumerKey>" "<accessToken>")
      { getReqCount = Just 1
      , getReqSort = Just "newest"
      }
get getReq

About

Haskell bindings for the Pocket API

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published