No description
Find a file
2016-11-10 18:05:01 -06:00
gen update gen 2016-11-07 11:18:49 -06:00
samples log status code in runPinboardSingleRawBS 2016-11-08 13:05:26 -06:00
src 'refactor' 2016-11-10 18:05:01 -06:00
tests hfmt 2016-11-07 11:30:28 -06:00
.gitignore update .gitignore 2016-09-13 15:32:09 -05:00
.travis.yml add travis 2016-06-20 15:13:49 -05:00
changelog.md add option to delay between requests (requestDelayMills) 2016-11-05 18:02:59 -05:00
LICENSE init 2015-03-13 22:56:27 -05:00
pinboard.cabal extract logging module 2016-11-08 13:42:32 -06:00
README.md fix readme 2016-07-11 23:38:48 -05:00
Setup.lhs init 2015-03-13 22:56:27 -05:00
stack-7.10.yaml catch pinboarderrors 2016-08-10 12:24:20 -05:00
stack-8.0.yaml add option to delay between requests (requestDelayMills) 2016-11-05 18:02:59 -05:00
stack.yaml 'refactor' 2016-11-10 18:05:01 -06:00

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