Skip to content

Instantly share code, notes, and snippets.

@IndianGuru
Created September 27, 2016 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IndianGuru/7717659f664ea8e30238ab247d858e56 to your computer and use it in GitHub Desktop.
Save IndianGuru/7717659f664ea8e30238ab247d858e56 to your computer and use it in GitHub Desktop.
A Go program that uses the pwned.go library
package main
import (
"fmt"
"time"
"github.com/SatishTalim/pwned"
)
func main() {
var result string
// Getting all breaches for an account
result = pwned.GetService("satish.talim@gmail.com", "breachedaccount/", "" )
fmt.Println("First request: " + result)
// 1500 milliseconds delay
time.Sleep(time.Millisecond * 1500)
// Getting all breaches for an account, filtered by domain
result = pwned.GetService("satish.talim@gmail.com", "breachedaccount/", "adobe.com" )
fmt.Println("\nSecond request " + result)
// 1500 milliseconds delay
time.Sleep(time.Millisecond * 1500)
// Getting all breached sites in the system
result = pwned.GetService("", "breaches/", "" )
fmt.Println("\nThird request: " + result)
// 1500 milliseconds delay
time.Sleep(time.Millisecond * 1500)
// Getting all breached sites in the system, filtered by domain
result = pwned.GetService("", "breaches/", "adobe.com" )
fmt.Println("\nFourth request: " + result)
// 1500 milliseconds delay
time.Sleep(time.Millisecond * 1500)
// Getting a single breached site
result = pwned.GetService("", "breach/", "Adobe" )
fmt.Println("\nFifth request: " + result)
// 1500 milliseconds delay
time.Sleep(time.Millisecond * 1500)
// Getting a single breached site
result = pwned.GetService("", "dataclasses/", "" )
fmt.Println("\nSixth request: " + result)
// 1500 milliseconds delay
time.Sleep(time.Millisecond * 1500)
// Getting a single breached site
result = pwned.GetService("test@example.com", "pasteaccount/", "" )
// https://blog.golang.org/slices
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment