CrossClj

0.1.0 docs

SourceDocs



RECENT

    adblockblock

    Clojars

    May 10, 2014


    OWNER
    Dima Shapoval
    Zaporizhia, Ukraine

    Readme

    Index of all namespaces


    The README below is fetched from the published project artifact. Some relative links may be broken.

    AdBlock Block

    Library can check URL for is blocked parts of site in AdBlock and what block rules are applied.

    How works

    AdBlockBlock (ABB) runs phantomjs, where collect http-requests and applied CSS block rules. Then data analyzed and formated in nice map.

    Prerequisite

    1. installed http://phantomjs.org/
    2. saved netlog.js to any directory

    Example usage

    Add to dependies [adblockblock "0.1.0"]

    (require 'adblockblock.api)
    (def block-list (adblockblock.api/get-block-list))
    (adblockblock.api/check-url "/home/user/netlog.js" block-list "http://youtube.com")
    

    Example output

    {:css ["#footer-ads" ".ad-div" "#feed-pyv-container" "#ad_creative_3"],
     :http (
      {:data
        {:url "http://ad.doubleclick.net/",
         :is-script false,
         :is-style false,
         :is-image false},
         :result (
          {:rule "||ad.doubleclick.net^$~object-subrequest,third-party",
          :blocking true,
          :options {:switches #{}, :domain nil},
          :regexp #"^https?://[a-zA-Z0-9.]*ad\.doubleclick\.net([^\w_%\.-]|$).*"})}
      {:data
        {:url "https://accounts.google.com/ServiceLogin",
         :is-script false,
         :is-style false,
         :is-image false},
         :result ()})}
    

    Additional docs