Documentation ¶
Overview ¶
Urban Go A Golang package to search urban dictionary.
Index ¶
Constants ¶
View Source
const Version = "0.0.2"
The version of the package.
Variables ¶
View Source
var Regexp = regexp.MustCompile("\\[([^\\][]+)\\]")
The regexp used to match [] boxes
View Source
var WS = regexp.MustCompile("\\s+")
Regexp to replace whitespaces with +
Functions ¶
func HTML ¶
HTML renders a given string to HTML style. [some term] => <a href="https://www.urbandictionary.com/define.php?term=some+term">some term</a> str is also HTML-escaped
func Markdown ¶
Markdown renders a given string to Markdown style. [some term] => [some term](https://www.urbandictionary.com/define.php?term=some+term)
Types ¶
type Entry ¶
type Entry struct { Definition string `json:"definition"` Example string `json:"example"` Author string `json:"author"` Word string `json:"word"` DefID int `json:"defid"` PermaLink string `json:"permalink"` SoundURLs []string `json:"sound_urls"` ThumbsUp int `json:"thumbs_up"` ThumbsDown int `json:"thumbs_down"` CurrentVote string `json:"current_vote"` WrittenOn time.Time `json:"written_on"` }
Entry represents an entry in the dictionary.
func DefineByID ¶
DefineByID returns definitions for a given defid
Click to show internal directories.
Click to hide internal directories.