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

Safe HaskellNone
LanguageHaskell98

Web.Codepad

Description

Simple pasting API for CodePad.org.

Synopsis

Documentation

type URL = String Source

A URL.

type Code = String Source

Code to be pasted.

type PasteId = String Source

A CodePad paste id e.g. HZPquoIO.

type PasteOutput = String Source

Paste output

type LangName = String Source

Alias for supported CodePad languages.

codepadUrl :: URL Source

CodePad's domain.

codepadLangsURL :: URL Source

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

pasteURL Source

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.

pasteAndRun Source

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.

pasteCode Source

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.

pasteOutput Source

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.

parseOutput Source

Arguments

:: String

Parse a paste page for the output.

-> Maybe PasteOutput

Maybe the paste output.

Get the paste output.

parseLangs Source

Arguments

:: String

The HTML page.

-> [LangName]

Any parsed language names.

Extract the available languages from the CodePad page.