The indieweb-algorithms package

[Tags:library, public-domain, test]

[Skip to Readme]

Properties

Versions 0.1.0
Dependencies aeson, base (>=4.0.0.0 && <5), bytestring, containers, data-default, either, http-link-header, lens, lens-aeson, microformats2-parser, network-uri, safe, text, time, transformers, unordered-containers, vector [details]
License PublicDomain
Copyright 2015 Greg V <greg@unrelenting.technology>
Author Greg V
Maintainer greg@unrelenting.technology
Stability Unknown
Category Web
Home page https://github.com/myfreeweb/indieweb-algorithms
Source repository head: git clone git://github.com/myfreeweb/indieweb-algorithms.git
Uploaded Tue Aug 25 21:33:22 UTC 2015 by myfreeweb
Distributions NixOS:0.1.0
Downloads 108 total (4 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2015-09-29 [all 3 reports]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for indieweb-algorithms

Readme for indieweb-algorithms-0.1.0

indieweb-algorithms Hackage Build Status unlicense

A collection of implementations of [IndieWeb]- and Microformats 2-related algorithms (based on microformats2-parser and http-link-header):

  • finding all microformats of a given type (while retaining the path to them), ie. flattening the tree
  • discovering authorship of an h-entry
  • discovering Webmention/Micropub/IndieAuth/etc. endpoints (HTTP Link header, a and link tags with the rel attribute)

Usage

Endpoints

{-# LANGUAGE OverloadedStrings #-}

import Network.HTTP.Link
import Data.Default
import Data.Maybe
import Data.Microformats2.Parser
import Data.IndieWeb.Endpoints

discoverEndpoints [ "micropub" ] (parseMf2 def $ documentRoot $ parseLBS "<link rel=micropub href='http://example.com/micropub2'>...") (fromMaybe [] $ parseLinkHeader "<http://example.com/micropub>; rel=\"micropub\"")

Development

Use stack to build.
Use ghci to run tests quickly with :test (see the .ghci file).

$ stack build

$ stack test && rm tests.tix

$ stack ghci --ghc-options="-fno-hpc"

Contributing

Please feel free to submit pull requests! Bugfixes and simple non-breaking improvements will be accepted without any questions :-)

By participating in this project you agree to follow the Contributor Code of Conduct.

The list of contributors is available on GitHub.

License

This is free and unencumbered software released into the public domain.
For more information, please refer to the UNLICENSE file or unlicense.org.