urbandictionary

package module
Version: v0.0.0-...-e5f649d Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: MIT Imports: 7 Imported by: 1

README

urbandictionary

Urban Dictionnary API wrapper in golang

Documentation

Index

Constants

View Source
const UrbanDictionaryAPI = "http://api.urbandictionary.com/v0/define?term="

UrbanDictionaryAPI contains the Urban Dictionary API URL for search results

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Author       string    `json:"author"`
	CurrentVote  string    `json:"current_vote"`
	Date         time.Time `json:"-"`
	Definition   string    `json:"definition"`
	DefinitionID int       `json:"defid"`
	Example      string    `json:"example"`
	Permalink    string    `json:"permalink"`
	ThumbsUp     int       `json:"thumbs_up"`
	ThumbsDown   int       `json:"thumbs_down"`
	Word         string    `json:"word"`

	WrittenOn string `json:"written_on"`
}

Result contains data regarding an Urban Dictionary definition

type SearchResult

type SearchResult struct {
	Results []Result `json:"list"`
}

SearchResult contains data regarding an Urban Dictionary search result

func Query

func Query(searchTerm string) (*SearchResult, error)

Query returns data from an Urban Dictionary search result

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL