psbdmp

package module
v0.0.0-...-b9a23e0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2019 License: MIT Imports: 8 Imported by: 0

README

psbdmp

Unofficial API Wrapper for https://psbdmp.ws written in Go. Allows searching through pastebin dumps by keyword, domain, email, or date ranges.

Installation
$> go get github.com/traviscampbell/psbdmp/...
CLI Examples

Fetch a specific dump by it's ID. (prints it to stdout)

$> psbdmp -dl f1GH3ySG

Search all the dumps for mentions of the domain github.com. By itself like this it only returns a list of dump IDs that matched, to get the actual dump content you can add the -fetch flag.

$> psbdmp -domain github.com (-fetch)?

Download all the pastebin dumps posted in the last 3 days storing them in /tmp by default.

$> psbdmp -since 3 -fetch

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dump

type Dump struct {
	ID   string `json:"id"`
	Tags string `json:"tags"`
	Time string `json:"time"`
}

Dump holds the id, date added, and the associated tags in some cases of a given dump

type DumpClient

type DumpClient struct {
	// contains filtered or unexported fields
}

DumpClient facilitates interaction with the psbdmp service

func NewDumpClient

func NewDumpClient() *DumpClient

NewDumpClient returns a dumpclient instance initialized with sane defaults

func (*DumpClient) GetByDate

func (dc *DumpClient) GetByDate(from, to time.Time) ([]Dump, error)

GetByDate returns a list of the dumps that we're posted between the given dates

func (*DumpClient) GetDumpContent

func (dc *DumpClient) GetDumpContent(id string) (string, error)

GetDumpContent returns the full dump as a string

func (*DumpClient) Search

func (dc *DumpClient) Search(keyword string) ([]Dump, error)

Search performs a generalized search across the dumps for the provided key word

func (*DumpClient) SearchByDomain

func (dc *DumpClient) SearchByDomain(domain string) ([]Dump, error)

SearchByDomain searches for dumps containing the provided domain

func (*DumpClient) SearchByEmail

func (dc *DumpClient) SearchByEmail(email string) ([]Dump, error)

SearchByEmail searches for dumps containing the provided email

func (*DumpClient) SetHTTPClient

func (dc *DumpClient) SetHTTPClient(client *http.Client) *DumpClient

SetHTTPClient allows a custom HTTP Client to be used

func (*DumpClient) SetUserAgent

func (dc *DumpClient) SetUserAgent(useragent string) *DumpClient

SetUserAgent allows a custom User-Agent to be applied

type Dumplings

type Dumplings struct {
	Search    string `json:"search"`
	Count     int    `json:"count"`
	Dumps     []Dump `json:"data"`
	Error     int    `json:"error"`
	ErrorInfo string `json:"error_info"`
}

Dumplings represents server response containing a list dump IDs

Directories

Path Synopsis
cmd
psbdmp command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL