codepad-0.1: Submit and retrieve paste output from CodePad.org.

Web.Codepad

Description

Simple pasting API for CodePad.org.

Synopsis

Documentation

type URL = StringSource

A URL.

type Code = StringSource

Code to be pasted.

type PasteId = StringSource

A CodePad paste id e.g. HZPquoIO.

type PasteOutput = StringSource

Paste output

type LangName = StringSource

Alias for supported CodePad languages.

codepadUrl :: URLSource

CodePad's domain.

codepadLangsURL :: URLSource

A CodePad URL of a page containing a list of supported languages.

pasteURLSource

Arguments

:: PasteId

ID of the CodePad paste to construct a URL for.

-> URL

A CodePad URL to the paste.

Make a CodePad URL for the given paste id.

pasteAndRunSource

Arguments

:: MonadIO m 
=> Code

Code to paste.

-> LangName

Language of the code.

-> Bool

Private?

-> m (Maybe (PasteId, PasteOutput))

The paste id and the run output.

Paste some code and get the run output too.

pasteCodeSource

Arguments

:: MonadIO m 
=> Code

Code to paste.

-> LangName

Language of the code.

-> Bool

Run it?

-> Bool

Private?

-> m (Maybe PasteId)

The pasted id.

Perform a paste.

pasteOutputSource

Arguments

:: MonadIO m 
=> PasteId

A CodePad paste id.

-> m (Maybe PasteOutput)

Maybe the run output of that paste.

Get the run output for a paste id.

supportedLangs :: MonadIO m => m (Maybe [LangName])Source

Get the list of supported languages.

parseOutputSource

Arguments

:: String

Parse a paste page for the output.

-> Maybe PasteOutput

Maybe the paste output.

Get the paste output.

parseLangsSource

Arguments

:: String

The HTML page.

-> [LangName]

Any parsed language names.

Extract the available languages from the CodePad page.