Skip to content

Instantly share code, notes, and snippets.

@shriphani shriphani/core.clj
Last active Aug 29, 2015

Embed
What would you like to do?
HtmlCleaner loading
(ns cleaner-fuck-up.core
(:import (org.htmlcleaner HtmlCleaner)))
(defn process-page
[page-src]
(let [cleaner (new HtmlCleaner)
props (.getProperties cleaner)]
(.clean cleaner page-src)))
(defn blah
[]
(.getInnerHtml (process-page "<html><body>Hello</body></html>")))
;; (defn blah2
;; []
;; (HtmlCleaner/getInnerHtml
;; (process-page "<html><body>Hello</body></html>")))
user=> (require '[clojure.reflect :as r])
nil
user=> (use '[clojure.pprint :only [print-table]])
nil
user=> (print-table (:members (r/reflect (new HtmlCleaner)))
#_=> )
CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: HtmlCleaner, compiling:(/private/var/folders/wn/styd1v4145g6s52kz6726tpc0000gn/T/form-init6247019744881879745.clj:1:35)
user=> (print-table (:members (r/reflect (new HtmlCleaner))))
CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: HtmlCleaner, compiling:(/private/var/folders/wn/styd1v4145g6s52kz6726tpc0000gn/T/form-init6247019744881879745.clj:1:35)
user=> (import (org.htmlcleaner HtmlCleaner DomSerializer CleanerProperties))
org.htmlcleaner.CleanerProperties
user=> (print-table (:members (r/reflect (new HtmlCleaner))))
| :name | :return-type | :declaring-class | :parameter-types | :exception-types | :flags |
|------------------------------+------------------------------------------+-----------------------------+------------------------------------------------------------------------------------------------------+-----------------------+----------------------------|
| saveToLastOpenTag | void | org.htmlcleaner.HtmlCleaner | [java.util.List java.lang.Object org.htmlcleaner.CleanTimeValues] | [] | #{:private} |
| getTagInfoProvider | org.htmlcleaner.ITagInfoProvider | org.htmlcleaner.HtmlCleaner | [] | [] | #{:public} |
| clean | org.htmlcleaner.TagNode | org.htmlcleaner.HtmlCleaner | [java.io.Reader] | [java.io.IOException] | #{:public} |
| markNodesToPrune | boolean | org.htmlcleaner.HtmlCleaner | [java.util.List org.htmlcleaner.CleanTimeValues] | [] | #{:private} |
| org.htmlcleaner.HtmlCleaner | | org.htmlcleaner.HtmlCleaner | [] | [] | #{:public} |
| clean | org.htmlcleaner.TagNode | org.htmlcleaner.HtmlCleaner | [java.net.URL java.lang.String] | [java.io.IOException] | #{:public} |
| getChildBreaks | org.htmlcleaner.HtmlCleaner$ChildBreaks | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.CleanTimeValues] | [] | #{:private} |
| clean | org.htmlcleaner.TagNode | org.htmlcleaner.HtmlCleaner | [java.io.InputStream] | [java.io.IOException] | #{:public} |
| addPruneNode | void | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.TagNode org.htmlcleaner.CleanTimeValues] | [] | #{:protected} |
| isStartToken | boolean | org.htmlcleaner.HtmlCleaner | [java.lang.Object] | [] | #{:private} |
| createDocumentNodes | void | org.htmlcleaner.HtmlCleaner | [java.util.List org.htmlcleaner.CleanTimeValues] | [] | #{:private} |
| MARKER_ATTRIBUTE | | org.htmlcleaner.HtmlCleaner | | | #{:private :static :final} |
| setInnerHtml | void | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.TagNode java.lang.String] | [] | #{:public} |
| createTagNode | org.htmlcleaner.TagNode | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.TagNode] | [] | #{:private} |
| clean | org.htmlcleaner.TagNode | org.htmlcleaner.HtmlCleaner | [java.io.File] | [java.io.IOException] | #{:public} |
| properties | | org.htmlcleaner.HtmlCleaner | | | #{:private} |
| isAllowedAsForeignMarkup | boolean | org.htmlcleaner.HtmlCleaner | [java.lang.String org.htmlcleaner.CleanTimeValues] | [] | #{:private} |
| isFatalTagSatisfied | boolean | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.TagInfo org.htmlcleaner.CleanTimeValues] | [] | #{:private} |
| getPruneTagSet | java.util.Set | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.CleanTimeValues] | [] | #{:protected} |
| makeTree | void | org.htmlcleaner.HtmlCleaner | [java.util.List java.util.ListIterator org.htmlcleaner.CleanTimeValues] | [] | #{} |
| reopenBrokenNode | void | org.htmlcleaner.HtmlCleaner | [java.util.ListIterator org.htmlcleaner.TagNode org.htmlcleaner.CleanTimeValues] | [] | #{:private} |
| getAllTags | java.util.Set | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.CleanTimeValues] | [] | #{:protected} |
| closeSnippet | java.util.List | org.htmlcleaner.HtmlCleaner | [java.util.List org.htmlcleaner.HtmlCleaner$TagPos java.lang.Object org.htmlcleaner.CleanTimeValues] | [] | #{:private} |
| getInnerHtml | java.lang.String | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.TagNode] | [] | #{:public} |
| popNesting | org.htmlcleaner.HtmlCleaner$NestingState | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.CleanTimeValues] | [] | #{:private} |
| org.htmlcleaner.HtmlCleaner | | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.ITagInfoProvider] | [] | #{:public} |
| getProperties | org.htmlcleaner.CleanerProperties | org.htmlcleaner.HtmlCleaner | [] | [] | #{:public} |
| initCleanerTransformations | void | org.htmlcleaner.HtmlCleaner | [java.util.Map] | [] | #{:public} |
| addIfNeededToPruneSet | boolean | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.TagNode org.htmlcleaner.CleanTimeValues] | [] | #{:private} |
| addPossibleHeadCandidate | void | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.TagInfo org.htmlcleaner.TagNode org.htmlcleaner.CleanTimeValues] | [] | #{:private} |
| getTransformations | org.htmlcleaner.CleanerTransformations | org.htmlcleaner.HtmlCleaner | [] | [] | #{:public} |
| clean | org.htmlcleaner.TagNode | org.htmlcleaner.HtmlCleaner | [java.io.File java.lang.String] | [java.io.IOException] | #{:public} |
| addAttributesToTag | void | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.TagNode java.util.Map] | [] | #{:private} |
| org.htmlcleaner.HtmlCleaner | | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.ITagInfoProvider org.htmlcleaner.CleanerProperties] | [] | #{:public} |
| pushNesting | org.htmlcleaner.HtmlCleaner$NestingState | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.CleanTimeValues] | [] | #{:private} |
| mustAddRequiredParent | boolean | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.TagInfo org.htmlcleaner.CleanTimeValues] | [] | #{:private} |
| clean | org.htmlcleaner.TagNode | org.htmlcleaner.HtmlCleaner | [java.io.Reader org.htmlcleaner.CleanTimeValues] | [java.io.IOException] | #{:protected} |
| clean | org.htmlcleaner.TagNode | org.htmlcleaner.HtmlCleaner | [java.lang.String] | [] | #{:public} |
| clean | org.htmlcleaner.TagNode | org.htmlcleaner.HtmlCleaner | [java.io.InputStream java.lang.String] | [java.io.IOException] | #{:public} |
| org.htmlcleaner.HtmlCleaner | | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.CleanerProperties] | [] | #{:public} |
| clean | org.htmlcleaner.TagNode | org.htmlcleaner.HtmlCleaner | [java.net.URL] | [java.io.IOException] | #{:public} |
| isRemovingNodeReasonablySafe | boolean | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.TagNode] | [] | #{:protected} |
| calculateRootNode | void | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.CleanTimeValues java.util.Set] | [] | #{:private} |
| newTagNode | org.htmlcleaner.TagNode | org.htmlcleaner.HtmlCleaner | [java.lang.String] | [] | #{:private} |
| getAllowTagSet | java.util.Set | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.CleanTimeValues] | [] | #{:protected} |
| closeAll | void | org.htmlcleaner.HtmlCleaner | [java.util.List org.htmlcleaner.CleanTimeValues] | [] | #{:private} |
| getOpenTags | org.htmlcleaner.HtmlCleaner$OpenTags | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.CleanTimeValues] | [] | #{:private} |
| isAllowedInLastOpenTag | boolean | org.htmlcleaner.HtmlCleaner | [org.htmlcleaner.BaseToken org.htmlcleaner.CleanTimeValues] | [] | #{:private} |
| getTagInfo | org.htmlcleaner.TagInfo | org.htmlcleaner.HtmlCleaner | [java.lang.String org.htmlcleaner.CleanTimeValues] | [] | #{:private} |
| transformations | | org.htmlcleaner.HtmlCleaner | | | #{:private} |
nil
user=>
(defproject cleaner_fuck_up "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[net.sourceforge.htmlcleaner/htmlcleaner "2.8"]])
user=> (use 'cleaner-fuck-up.core :reload)
nil
user=> (blah)
IllegalArgumentException No matching field found: getInnerHtml for class org.htmlcleaner.TagNode clojure.lang.Reflector.getInstanceField (Reflector.java:271)
user=>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.