zerobin-1.5.1: Post to 0bin services

Safe HaskellNone
LanguageHaskell2010

Web.ZeroBin

Description

High-level functions for posting to 0bin services like http://0bin.net or http://paste.ec.

>>> import Web.ZeroBin
>>> import Data.ByteString.Char8
>>> share "http://0bin.net" Day (pack "hello")
"http://0bin.net/paste/ZH6VyKXjDHAiPT8J#C6LLidGyHO7xt3xuDtsNHjZ77luualukEuJ25S6w/K1m"

Synopsis

Documentation

data Expiration Source

Expiration of a paste. "Burn after reading" really means "burn after two readings", because we do not redirect to the paste like a browser does. You can verify your paste before sharing the link. Original http://0bin.net does not support Week.

Constructors

Once

burn after reading

Day

keep for 24 hours

Week

for 7 days

Month

for 30 days

Never

for 100 years

share Source

Arguments

:: String

the address of 0bin, e. g. http://0bin.net or https://paste.ec

-> Expiration 
-> ByteString

the plain data to encrypt and paste

-> IO String

the URI of paste

Encrypts the plain data with a random password, post to 0bin and return the URI of a new paste. Can throw ZeroBinError or HttpException.