Pinboard Hackage Build Status

The Pinboard API is a way to interact programatically with your bookmarks, notes and other Pinboard data. This library wraps the API exposing functions and data structures suitable for usage in Haskell programs.

Hackage documentation

http://hackage.haskell.org/package/pinboard

Stackage documentation

https://www.stackage.org/package/pinboard

Pinboard Api documentation

https://pinboard.in/api/

Examples:

getPostsRecent

{-# LANGUAGE OverloadedStrings #-}

import Pinboard

main :: IO ()
main = do
  let config = fromApiToken "api token"
  result <- runPinboard config $ getPostsRecent Nothing Nothing
  case result of
    Right details -> print details
    Left pinboardError -> print pinboardError

output:

Posts{postsDate = 2015 - 10 - 24 16 : 17 : 12 UTC,
       postsUser = "jonschoning",
       postsPosts =
         [Post{postHref = "http://www.reddit.com/r/haskell/comments/25vj62/adventure_with_types_in_haskell_simon_peyton/",
               postDescription = "Adventure with Types in Haskell - Simon Peyton Jones [1:33:36] : haskell",
               postExtended = "", 
               postMeta = "3fe9fb05c7c37f7bb66be7b9d85599eb",
               postHash = "c46b717604ef8b126dabeba97b27a36f",
               postTime = 2014 - 5 - 19 3 : 35 : 55 UTC, 
               postShared = True,
               postToRead = False,
               postTags = ["spj", "video", "haskell", "typetheory"]}]}

getPostsRecent (using Lenses)

{-# LANGUAGE OverloadedStrings #-}

import Pinboard
import Control.Lens

main :: IO ()
main = do
  let config = fromApiToken "api token"
  result <- runPinboard config $ getPostsRecent (Just ["haskell"]) (Just 3)
  mapM_ print (result ^.. _Right . postsPostsL . traverse . postHrefL)

output:

"http://www.stephendiehl.com/posts/production.html"
"https://mail.haskell.org/mailman/listinfo"
"https://en.wikibooks.org/wiki/Haskell/Applicative_functors#A_sliding_scale_of_power"

Modules

Pinboard.Types

Pinboard typeclasses and type aliases

Pinboard.Client

Executes the methods defined in Pinboard.Api

Pinboard.Api

Provides Pinboard Api Methods

Pinboard.ApiTypes

Pinboard Data Structures returned by the Api

Pinboard.ApiTypesLens

Lens accessors for Pinboard.ApiTypes

Changes

__v0.9.12.4

fix for aeson [] instances in 1.0.0.0

__v0.9.12.2

vector bounds

__v0.9.12.1

bug fixes

v0.9.12

add runPinboardE

add ability to delay the thread if the time since the previous request exceeds the configured maxRequestRateMills (rename requestDelayMills to maxRequestRateMills)

v0.9.11

add logging

add option to delay between requests (requestDelayMills)

v0.9.10

avoid pre-lifting IO into MonadIO

extend aeson upper-bound

v0.9.9

generalize (Either PinboardError a) to (MonadErrorPinboard)

v0.9.8

use safe-exception

avoid use of 'error' to communicate failure when parsing json

includes a few changes to the types/api in Pinboard.Client

v0.9.7

add http-client-0.5.0 support

add PVP bounds

v0.9.6

add http-client bound

v0.9.5

add JSON roundtrip tests

v0.9.4

derive generic

v0.9.3

Add lenses

v0.9.2

Make data fields strict

v0.9.1

rename field: postToread -> postToRead

v0.9.0

refactored Client.hs to simplify parameters

promote types under .Client subtree to top-level

v0.8.5

replace Pinboard stack with PinboardT transfomer (use mtl style constraints instead of a fixed monad transformer stack)

v0.7.5

replacing/removing io-streams in favor of http-client

v0.6.5

compatability with both time < 1.5 and time >= 1.5

v0.6.4

add ability to update a post directly from a Post record (save an existing post)

v0.6.3

add ToJson instances add pretty print function

comments powered byDisqus