Project

urban

0.01
No commit activity in last 3 years
No release in over 3 years
Urban is a command line utility with an API to query definitions from Urban Dictionary.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.14
~> 5.8
~> 10.0
~> 4.0

Runtime

~> 1.5.0
 Project Readme

Urban¶ ↑

Description:¶ ↑

Urban is a command line utility with an API to query definitions from Urban Dictionary.

BADGES¶ ↑

<img src=“https://secure.travis-ci.org/tmiller/urban.png”/> <img src=“https://codeclimate.com/github/tmiller/urban.png” />

REQUIREMENTS¶ ↑

  • Ruby >= 1.8.7

INSTALLATION¶ ↑

With Rubygems:

$ sudo gem install urban

With git and local working copy

$ git clone git://github.com/tmiller/urban.git
$ cd urban
$ sudo rake install

CLI USAGE¶ ↑

1. Look up a definition¶ ↑

$ urban cookie monster

2. Random definition¶ ↑

$ urban -r
$ urban --random

3. Print all definitons¶ ↑

$ urban -a cookie monster
$ urban -ra

4. Print the url of the definition at the end of the output¶ ↑

$ urban -u cookie monster
$ urban -ru

5. Print help and version¶ ↑

$ urban --help
$ urban --version

API USAGE¶ ↑

require 'urban'

# Search for a word
entry = Urban::Dictionary.search('impromtpu')

# Get a random word
entry = Urban::Dictionary.random

puts entry.phrase     # print the phrase
puts entry.url        # print the url of the phrase

# print all of the definitions
entry.definitions.each do |definition|
  puts definition
end

Copyright © 2011 Thomas Miller. See LICENSE for details.