Liking cljdoc? Tell your friends :D

reaver


attrclj

(attr attribute)
(attr x attribute)

Convenience function allowing:

(chain (attr :href) ..)

instead of requiring:

(chain #(attr* % :href) ..)

Convenience function allowing:

  (chain (attr :href) ..)

instead of requiring:

  (chain #(attr* % :href) ..)
sourceraw docstring

chainclj

(chain & fns)

Executes the supplied functions in left to right order on an element.

(chain text parse-date)

Executes the supplied functions in left to right order
on an element.

  (chain text parse-date)
sourceraw docstring

EDNablecljprotocol

to-ednclj

(to-edn jsoup)

Converts Jsoup into an edn representation of HTML.

{:type Keyword :tag Keyword|nil :attrs {Keyword String, ...}|nil :content Vector|Map|String|nil}

Converts Jsoup into an edn representation of HTML.

{:type    Keyword
 :tag     Keyword|nil
 :attrs   {Keyword String, ...}|nil
 :content Vector|Map|String|nil}
source

extractclj

(extract source ks & extractions)

ks is a vector of keys that will be zipped into a map with the extracted data, ie:

{(first ks) (first (run-extractions source extractions))}

If ks is nil or empty, a sequence of extracted data will be returned instead.

Extractions are a selector (see select) followed by an extractor (see Extractable).

(extract (parse subreddit) [:headlines] ".sitetable .thing .title a.title" text)

ks is a vector of keys that will be zipped into a map
with the extracted data, ie:

  {(first ks) (first (run-extractions source extractions))}

If ks is nil or empty, a sequence of extracted data will
be returned instead.

Extractions are a selector (see `select`) followed by an
extractor (see `Extractable`).

  (extract (parse subreddit)
           [:headlines]
           ".sitetable .thing .title a.title" text)
sourceraw docstring

extract-fromclj

(extract-from source selector ks & extractions)

Behaves like extract, but prior to running extractions uses the provided selector to narrow down the data to be searched.

This is useful, for instance, when one wants to select a sequence of items, then extract identical information from each.

Behaves like extract, but prior to running extractions
uses the provided selector to narrow down the data to
be searched.

This is useful, for instance, when one wants to select
a sequence of items, then extract identical information
from each.
sourceraw docstring

Extractablecljprotocol

attr*clj

(attr* x a)

Returns a string representing the node's value for the supplied attribute (or nil, if it has no value)

Returns a string representing the node's value for the
supplied attribute (or nil, if it has no value)

attrsclj

(attrs x)

Returns a map of keyword/string pairs representing the node's attributes.

Returns a map of keyword/string pairs representing the node's
attributes.

dataclj

(data x)

Returns a string representing all the data (ie. from scripts) contained by the node.

Returns a string representing all the data (ie. from scripts)
contained by the node.

ednclj

(edn x)

Returns data in edn format.

Returns data in edn format.

jsoupclj

(jsoup x)

Returns data in Jsoup types.

Returns data in Jsoup types.

tagclj

(tag x)

Returns a keyword representing the node's html tag (if it has one)

Returns a keyword representing the node's html tag (if it has one)

textclj

(text x)

Returns a string representing all the text contained by the node.

Returns a string representing all the text contained by the node.
source

one?clj

(one? elements)
source

parseclj

(parse html)

Parses a string representing a full HTML document into Jsoup.

Parses a string representing a full HTML document
into Jsoup.
sourceraw docstring

parse-fragmentclj

(parse-fragment html)

Parses a string representing a fragment of HTML into Jsoup.

Parses a string representing a fragment of HTML
into Jsoup.
sourceraw docstring

reduce-intoclj

(reduce-into empty-coll xs)

Imperfectly mimics 'into' with 'reduce' and 'conj' for better performance.

Imperfectly mimics 'into' with 'reduce' and 'conj'
for better performance.
sourceraw docstring

run-extractionclj

(run-extraction source sel extraction)
source

run-extractionsclj

(run-extractions source extractions)
source

selectclj

(select node css-selector)

Given HTML parsed to Jsoup and a string representing a CSS-esque selector, select* returns Jsoup representing any successfully selected data.

For more on selector syntax, see: http://jsoup.org/cookbook/extracting-data/selector-syntax

Given HTML parsed to Jsoup and a string representing
a CSS-esque selector, select* returns Jsoup representing
any successfully selected data.

For more on selector syntax, see:
http://jsoup.org/cookbook/extracting-data/selector-syntax
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close