Skip to content

Commit

Permalink
replace core file with usage examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Spuffynism committed Oct 31, 2017
1 parent 0e248f4 commit 6315fae
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 7 deletions.
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
[clj-http "3.7.0"]
[cheshire "5.8.0"]
[camel-snake-kebab "0.4.0"]]
:main hibp-client.core)
:main hibp-client.examples)
3 changes: 2 additions & 1 deletion src/hibp_client/breach.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(ns hibp-client.breach
(:require [hibp-client.api :as api]))
(:require [hibp-client.api :as api]
[clojure.set :as set]))

(defn get-for-account
":domain, :truncate-response and :include-unverified can be used to filter
Expand Down
5 changes: 0 additions & 5 deletions src/hibp_client/core.clj

This file was deleted.

39 changes: 39 additions & 0 deletions src/hibp_client/examples.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
(ns hibp-client.examples
(:require [hibp-client.pwned-password :as pwned-password]
[hibp-client.breach :as breach]
[hibp-client.paste :as paste]))

(defn -main [& args]

;; Checking if a password is pwned
(println (pwned-password/pwned? "12345"))
;; => true

;; Getting breaches for a specific account
(println (breach/get-for-account "[email protected]"))
;; => ({:description In approximately March 2015, the free web hosting prov...

;; Getting breaches for a specific account, filtering the results
(println (breach/get-for-account "[email protected]"
{:truncate-response true}))
;; => ({:name 000webhost} {:name Adobe} {:name BitcoinTalk} {:name Bitly} {...

;; Getting all breaches
(println (breach/get-all))
;; => ({:description In approximately March 2015, the free web hosting prov...

;; Getting all breaches for a domain
(println (breach/get-all "adobe.com"))
;; => ({:description In October 2013, 153 million Adobe accounts were breac...

;; Getting a breach by its name
(println (breach/get-for-name "Adobe"))
;; => {:description In October 2013, 153 million Adobe accounts were breach...

;; Getting all breach data classes
(println (breach/get-data-classes))
;; => (Account balances Age groups Ages Astrological signs Auth tokens Avat...

;; Getting all pastes for a specific account
(println (paste/get-for-account "[email protected]")))
;; => ({:source Pastebin, :id suPshHZ1, :title nil, :date 2017-09-06T03:41:...

0 comments on commit 6315fae

Please sign in to comment.