urban 0.1.3 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,3 @@
1
1
  rvm:
2
2
  - 1.8.7
3
3
  - 1.9.2
4
- - rbx
5
- - rbx-2.0
6
- - ree
7
- - jruby
8
- - ruby-head
@@ -0,0 +1,25 @@
1
+ === 1.0.0
2
+
3
+ * Major enhancements:
4
+
5
+ * Change `list` flag to the `all` flag for more clarity
6
+ * Remove query from Urban::Web replace with random and search
7
+ * Add `url` flag to print the url of the definition
8
+
9
+ * Minor enhancements:
10
+
11
+ * Add this history file
12
+ * Add Urban::Web#fetch for fetching pages from urban dictionary
13
+ * Add examples to help
14
+ * Remove require 'rubygems' from program and lib
15
+ * Test now only stubs singleton instead of class
16
+ * Use ~> instead of >= on dependencies
17
+ * Replace OpenStruct in Urban::Dictionary with plain Struct
18
+ * Move Nokogiri call to Dictionary#process
19
+
20
+ * Bug fix:
21
+
22
+ * Passing -v or --version no longer prints help
23
+ * Undefined words now show a clean error
24
+ * No internet connection now shows a clean error
25
+ * Invalid options now show a clean error
@@ -1,5 +1,5 @@
1
1
  = Urban
2
- {https://secure.travis-ci.org/tmiller/urban.png}[http://travis-ci.org/tmiller/urban]
2
+ {<img src="https://secure.travis-ci.org/tmiller/urban.png"/>}[http://travis-ci.org/tmiller/urban]
3
3
 
4
4
  Urban is a command line tool that allows you to look up definitions or pull a
5
5
  random definition from {Urban Dictionary}[http://www.urbandictionary.com].
@@ -23,7 +23,7 @@ With git and local working copy
23
23
  $ cd urban
24
24
  $ sudo rake install
25
25
 
26
- == Usage
26
+ == CLI Usage
27
27
 
28
28
  === 1. Look up a definition
29
29
 
@@ -32,21 +32,45 @@ With git and local working copy
32
32
  === 2. Random definition
33
33
 
34
34
  $ urban -r
35
+ $ urban --random
35
36
 
36
37
  === 3. Print all definitons
37
38
 
38
- $ urban -l cookie monster
39
+ $ urban -a cookie monster
40
+ $ urban -ra
39
41
 
40
- === 4. Print help and version
42
+ === 4. Print the url of the definition at the end of the output
43
+
44
+ $ urban -u cookie monster
45
+ $ urban -ru
46
+
47
+ === 5. Print help and version
41
48
 
42
49
  $ urban --help
43
50
  $ urban --version
44
-
51
+
52
+ == API Ussage
53
+
54
+ requre 'urban'
55
+
56
+ # Search for a word
57
+ entry = Urban::Dictionary.search('impromtpu')
58
+
59
+ # Get a random word
60
+ entry = Urban::Dictionary.random
61
+
62
+
63
+ puts entry.phrase # print the phrase
64
+ puts entry.url # print the url of the phrase
65
+
66
+ # print all of the definitions
67
+ entry.definitions.each do |definition|
68
+ puts definition
69
+ end
70
+
45
71
  == To Do
46
72
 
47
- * Refactor cli.rb
48
- * Document with {YARD}[http://yardoc.org]
49
- * Print better looking output
73
+ * Add YARD documentation for API
50
74
 
51
75
  ---
52
76
 
data/Rakefile CHANGED
@@ -12,3 +12,27 @@ Rake::TestTask.new do |t|
12
12
  t.verbose = true
13
13
  t.warning = true
14
14
  end
15
+
16
+ Rake::TestTask.new do |t|
17
+ t.name = 'test:cli'
18
+ t.libs << "test"
19
+ t.test_files = FileList['test/**/cli_test.rb']
20
+ t.verbose = true
21
+ t.warning = true
22
+ end
23
+
24
+ Rake::TestTask.new do |t|
25
+ t.name = 'test:dictionary'
26
+ t.libs << "test"
27
+ t.test_files = FileList['test/**/dictionary_test.rb']
28
+ t.verbose = true
29
+ t.warning = true
30
+ end
31
+
32
+ Rake::TestTask.new do |t|
33
+ t.name = 'test:web'
34
+ t.libs << "test"
35
+ t.test_files = FileList['test/**/web_test.rb']
36
+ t.verbose = true
37
+ t.warning = true
38
+ end
data/bin/urban CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'rubygems'
4
3
  require 'urban/version'
5
4
  require 'urban/cli'
6
5
 
@@ -1,5 +1,6 @@
1
1
  require 'optparse'
2
2
  require 'ostruct'
3
+ require 'socket'
3
4
  require 'urban/dictionary'
4
5
 
5
6
  module Urban
@@ -8,65 +9,108 @@ module Urban
8
9
  attr_accessor :dictionary
9
10
 
10
11
  def initialize
11
- @dictionary = Urban::Dictionary.new
12
+ @dictionary = Urban::Dictionary
12
13
  end
13
14
 
14
15
  def run(args = ARGV)
15
- options = parse(args)
16
- results = case
17
- when options.exit then return
18
- when options.random then dictionary.random
19
- when !options.phrase.empty? then dictionary.search(options.phrase)
16
+ begin
17
+ options = parse(args)
18
+ output = case
19
+ when options.help ; options.help_screen
20
+ when options.version ; "Urban #{Urban::VERSION} (c) Thomas Miller"
21
+ when options.random ; dictionary.random
22
+ when !options.phrase.empty? ; dictionary.search(options.phrase)
23
+ else ; options.help_screen
24
+ end
25
+
26
+ if output.respond_to?(:phrase)
27
+ if output.definitions
28
+ print_entry(output, options)
29
+ else
30
+ $stderr.puts "urban: no definitions found for #{entry.phrase.upcase}."
31
+ end
32
+ else
33
+ puts output
34
+ end
35
+
36
+ rescue SocketError
37
+ $stderr.puts 'urban: no internet connection available.'
38
+ rescue OptionParser::InvalidOption => e
39
+ $stderr.puts "urban: #{e.message}\nTry `urban --help' for more information."
40
+ rescue Exception => e
41
+ $stderr.puts e.message
20
42
  end
21
- output_results(results, options.list)
22
43
  end
23
44
 
24
45
  private
25
46
 
26
- def output_results(results, list)
27
- puts "\n#{results.word.upcase}\n\n"
28
- if list
29
- results.definitions.each { |definition| puts "#{definition}\n\n" }
47
+ def print_error(entry)
48
+ end
49
+
50
+ def print_entry(entry, options)
51
+ puts "WARNING: --list and -l are deprecated please use --all or -a instead" if options.list
52
+ puts "\n#{entry.phrase.upcase}\n\n"
53
+ if options.all
54
+ entry.definitions.each { |definition| puts "#{definition}\n\n" }
30
55
  else
31
- puts "#{results.definitions.first}\n\n"
56
+ puts "#{entry.definitions.first}\n\n"
32
57
  end
58
+ puts "URL: #{entry.url}\n\n" if options.url
33
59
  end
34
60
 
35
61
  def parse(args)
36
62
  options = OpenStruct.new
37
- options.random = false
38
- options.list = false
39
- options.phrase = ''
63
+ options.random = options.all = options.version = options.help = false
64
+
40
65
  opts = OptionParser.new do |o|
41
- o.banner = "Usage: urban [OPTION]... [PHRASE]"
42
- o.separator "Search http://urbandictionary.com for definitions"
66
+ o.banner = <<-EOB
67
+ Usage: urban [OPTION]... [PHRASE]
68
+ Search http://urbandictionary.com for definitions of phrases
43
69
 
44
- o.separator ''
45
- o.on('-l', '--list', 'List all definitions') do
46
- options.list = true
70
+ EOB
71
+
72
+ o.separator "Options:"
73
+ o.on('-a', '--all', 'List all definitions') do
74
+ options.all = true
47
75
  end
48
76
 
49
- o.on('-r', '--random', 'Find random word on urban dictionary') do
77
+ o.on('-r', '--random', 'Return a random phrase and definition') do
50
78
  options.random = true
51
79
  end
52
80
 
81
+ o.on('-u', '--url', "Print the definition's url after the definition") do
82
+ options.url = true
83
+ end
84
+
53
85
  o.on('-h', '--help', 'Show this message') do
54
- options.exit = true
86
+ options.help = true
55
87
  end
56
88
 
57
- o.on('--version', 'Show version') do
58
- puts "Urban #{Urban::VERSION} (c) Thomas Miller"
59
- options.exit = true
89
+ o.on('-v', '--version', 'Show version information') do
90
+ options.version = true
60
91
  end
61
- end
62
- opts.parse!(args)
63
- options.phrase = args.join(' ')
64
92
 
65
- if (options.exit || !options.random && options.phrase.empty?)
66
- puts opts
67
- options.exit = true
93
+ o.on('-l', '--list', 'DEPRECATED please use --all or -a instead') do
94
+ options.list = true
95
+ options.all = true
96
+ end
68
97
  end
69
98
 
99
+ examples = <<-EOE
100
+
101
+ Examples:
102
+ urban cookie monster Search for "cookie monster" and print its
103
+ first definition
104
+ urban -a cookie monster Search for "cookie monster" and print all of
105
+ its available definitions
106
+ urban -r Print a random phrase and its first definition
107
+ urban -ra Print a random phrase and all of its available
108
+ definitions
109
+
110
+ EOE
111
+ opts.parse!(args)
112
+ options.phrase = args.join(' ')
113
+ options.help_screen = opts.help + examples
70
114
  options
71
115
  end
72
116
  end
@@ -1,40 +1,44 @@
1
- require 'rubygems'
2
1
  require 'nokogiri'
3
- require 'ostruct'
4
2
  require 'urban/version'
5
3
  require 'urban/web'
6
4
 
7
5
  module Urban
8
- class Dictionary
6
+ module Dictionary
7
+ extend self
9
8
 
10
- attr_accessor :web_service
11
-
12
- def initialize
13
- @web_service = Urban::Web.new
14
- end
9
+ Entry = Struct.new(:phrase, :definitions, :url)
10
+ attr_writer :web_service
15
11
 
16
12
  def random
17
- document = Nokogiri::HTML(@web_service.query(:random))
18
- process(document)
13
+ process(web_service.random)
19
14
  end
20
15
 
21
16
  def search(phrase)
22
- document = Nokogiri::HTML(@web_service.query(:define, phrase))
23
- process(document)
17
+ process(web_service.search(phrase))
18
+ end
19
+
20
+ def web_service
21
+ @web_service ||= Urban::Web
24
22
  end
25
23
 
26
24
  private
27
- def process(document)
28
- OpenStruct.new({
29
- :word => document.at_xpath('//td[@class="word"][1]').content.strip,
30
- :definitions => parse_definitions(document) })
25
+
26
+ def process(response)
27
+ document = Nokogiri::HTML(response.stream)
28
+ if not_defined = document.at_xpath('//div[@id="not_defined_yet"]/i')
29
+ Entry.new(not_defined.content.strip, nil, nil)
30
+ else
31
+ Entry.new( document.at_xpath('//td[@class="word"][1]').content.strip ,
32
+ parse_definitions(document),
33
+ response.url)
34
+ end
31
35
  end
32
36
 
33
37
  def parse_definitions(document)
34
38
  definitions = document.xpath('//td/div[@class="definition"]').map do |node|
35
39
  node.xpath('//br').each { |br| br.replace(Nokogiri::XML::Text.new("\n", node.document)) };
36
40
  node.content.strip
37
- end || []
41
+ end
38
42
  end
39
43
  end
40
44
  end
@@ -1,3 +1,3 @@
1
1
  module Urban
2
- VERSION = '0.1.3'
2
+ VERSION = '1.0.0'
3
3
  end
@@ -1,13 +1,27 @@
1
- require 'urban/version'
2
1
  require 'open-uri'
2
+ require 'urban/version'
3
3
 
4
4
  module Urban
5
- class Web
5
+ module Web
6
+ extend self
7
+
8
+ Response = Struct.new(:url, :stream)
9
+
6
10
  URL = 'http://www.urbandictionary.com'
7
11
 
8
- def query(type, word = nil)
9
- query = "#{type.to_s}.php" << (word ? "?term=#{word}" : '')
10
- open(escape_uri("#{URL}/#{query}"))
12
+ def search(phrase)
13
+ result = fetch "define.php", :term => phrase
14
+ Response.new(result.base_uri.to_s, result)
15
+ end
16
+
17
+ def random
18
+ result = fetch "random.php"
19
+ Response.new(result.base_uri.to_s, result)
20
+ end
21
+
22
+ def fetch(page, parameters = {})
23
+ params = '?' + parameters.map { |k,v| "#{k}=#{v}" }.join('&') unless parameters.empty?
24
+ open(escape_uri("#{URL}/#{page}#{params}"))
11
25
  end
12
26
 
13
27
  private
@@ -0,0 +1,272 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html lang='en-US' xml:lang='en-US' xmlns='http://www.w3.org/1999/xhtml'>
3
+ <head>
4
+ <title>Urban Dictionary: gubble</title>
5
+ <script type='text/javascript'>
6
+ //<![CDATA[
7
+ var MobileDetector={redirect:function(b,a){if(b&&b.match(/(iPhone|iPod|Android|webOS|Opera Mini|PlayStation Portable)/)){this.go(a)}},go:function(a){window.location=a}};
8
+ MobileDetector.redirect(navigator.userAgent, "/iphone/#define?term=gubble");
9
+ //]]>
10
+ </script>
11
+
12
+
13
+ <!--[if (!IE)|(gte IE 8)]><!-->
14
+ <link href="http://static0.urbandictionary.com/rel-d5ca9bc/assets/base-datauri.css" media="screen" rel="stylesheet" type="text/css" />
15
+ <!--<![endif]-->
16
+ <!--[if lte IE 7]>
17
+ <link href="http://static2.urbandictionary.com/rel-d5ca9bc/assets/base.css" media="screen" rel="stylesheet" type="text/css" />
18
+ <![endif]-->
19
+ <link href="http://feeds.urbandictionary.com/UrbanWordOfTheDay" rel="alternate" title="Urban Word of the Day" type="application/rss+xml" />
20
+ <link href="http://static0.urbandictionary.com/rel-d5ca9bc/favicon.ico" rel="shortcut icon" /><link href="http://static0.urbandictionary.com/rel-d5ca9bc/favicon.ico" rel="icon" />
21
+
22
+
23
+ <link href='http://static2.urbandictionary.com/rel-d5ca9bc/osd.xml' rel='search' title='Urban Dictionary Search' type='application/opensearchdescription+xml' />
24
+ <meta content='gubble' property='og:title' />
25
+ <meta content="http://static1.urbandictionary.com/rel-d5ca9bc/images/og_image.png" property="og:image" />
26
+ <script type="text/javascript">
27
+ //<![CDATA[
28
+ var Record={setRecordingCookie:function(a){document.cookie="recording="+a},getRecordingCookie:function(){var a=document.cookie.match("recording=(true|false)");return a?(a[1]=="true"):null},start:function(a){if(Record.getRecordingCookie()===null){Record.setRecordingCookie(Math.random()<a/100)}if(Record.getRecordingCookie()){document.write(unescape("%3Cscript src='"+(("https:"==document.location.protocol)?"https":"http")+"://c.mouseflow.com/projects/38f33478-b73a-4335-a2df-b0f221197471.js' type='text/javascript'%3E%3C/script%3E"))}}};
29
+ //]]>
30
+ </script>
31
+ <script type='text/javascript'>
32
+ //<![CDATA[
33
+ Record.start(0.001);
34
+ //]]>
35
+ </script>
36
+ <meta content='Urban Dictionary' property='og:site_name' />
37
+ </head>
38
+ <body class='define_controller'>
39
+ <div id='header_background'>
40
+ <div id='header_width'>
41
+ <div id='header'>
42
+ <a href="/" id="logo_anchor"><img alt="" id="logo" src="http://static1.urbandictionary.com/rel-d5ca9bc/images/logo-holiday.png" /></a>
43
+ <div id='like_button'>
44
+ <iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Ffacebook.com%2Furbandictionary&amp;send=false&amp;layout=button_count&amp;width=100&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe>
45
+ </div>
46
+ <div id='form'>
47
+ <form action="/define.php" method="get">
48
+ <table>
49
+ <tr>
50
+ <td></td>
51
+ <td class='look_up'>look up anything, like <a href="/local.php">your city</a>:</td>
52
+ </tr>
53
+ <tr>
54
+ <td>
55
+ <div id='autocompleter_spinner' style='display: none'></div>
56
+ </td>
57
+ <td><input id="term" name="term" tabindex="1" type="text" value="gubble" /></td>
58
+ <td>
59
+ <input type='submit' value='search' />
60
+ </td>
61
+ </tr>
62
+ </table>
63
+ </form>
64
+ </div>
65
+ <div id='topnav'>
66
+ <a href="/">word of the day</a> <a class="active" href="/popular.php?character=A">dictionary</a> <a href="/thesaurus.php">thesaurus</a> <a href="/names.php">names</a> <a href="/video.list.php">media</a> <a href="/products.php">store</a> <a href="/add.php">add</a> <a href="/editor/staygo.php">edit</a> <a href="http://blog.urbandictionary.com/">blog</a>
67
+ </div>
68
+ </div>
69
+ </div>
70
+ </div>
71
+ <div class='autocomplete' id='term_list' style='display:none'></div>
72
+
73
+ <div id='outer'>
74
+ <div class='' id='whole'>
75
+ <div class='innernav' id='subnav'>
76
+ <a accesskey="1" href="/random.php" title="hot key + 1">random</a> <a href="/popular.php?character=A">A</a> <a href="/popular.php?character=B">B</a> <a href="/popular.php?character=C">C</a> <a href="/popular.php?character=D">D</a> <a href="/popular.php?character=E">E</a> <a href="/popular.php?character=F">F</a> <a href="/popular.php?character=G">G</a> <a href="/popular.php?character=H">H</a> <a href="/popular.php?character=I">I</a> <a class="active" href="/browse.php?word=gubble">J</a> <a href="/popular.php?character=K">K</a> <a href="/popular.php?character=L">L</a> <a href="/popular.php?character=M">M</a> <a href="/popular.php?character=N">N</a> <a href="/popular.php?character=O">O</a> <a href="/popular.php?character=P">P</a> <a href="/popular.php?character=Q">Q</a> <a href="/popular.php?character=R">R</a> <a href="/popular.php?character=S">S</a> <a href="/popular.php?character=T">T</a> <a href="/popular.php?character=U">U</a> <a href="/popular.php?character=V">V</a> <a href="/popular.php?character=W">W</a> <a href="/popular.php?character=X">X</a> <a href="/popular.php?character=Y">Y</a> <a href="/popular.php?character=Z">Z</a> <a href="/browse.php?character=%2A">#</a> <a href="/yesterday.php?date=2011-09-09">new</a> <a href="/favorites.php">favorites</a>
77
+ </div>
78
+ <table cellpadding='0' cellspacing='0' id='tablist'>
79
+ <tr>
80
+ <td id='leftist'>
81
+ <div class='prev_next_buttons'>
82
+ <a href="#" id="prev_titles" onclick="nearby.go('prev'); return false;" onmouseout="$(this).down().src = &quot;http://static3.urbandictionary.com/rel-d5ca9bc/images/uparrow.gif&quot;" onmouseover="$(this).down().src = &quot;http://static3.urbandictionary.com/rel-d5ca9bc/images/uparrow_dark.gif&quot;"><img src="http://static3.urbandictionary.com/rel-d5ca9bc/images/uparrow.gif" /></a>
83
+ <a href="#" id="next_titles" onclick="nearby.go('next'); return false;" onmouseout="$(this).down().src = &quot;http://static2.urbandictionary.com/rel-d5ca9bc/images/downarrow.gif&quot;" onmouseover="$(this).down().src = &quot;http://static2.urbandictionary.com/rel-d5ca9bc/images/downarrow_dark.gif&quot;"><img src="http://static2.urbandictionary.com/rel-d5ca9bc/images/downarrow.gif" /></a>
84
+ </div>
85
+ <ul id='nearby_titles'>
86
+ <li><a href="/define.php?term=Jeron" class="urbantip">Jeron</a></li><li><a href="/define.php?term=jeronder" class="urbantip">jeronder</a></li><li><a href="/define.php?term=jeronimo" class="urbantip">jeronimo</a></li><li><a href="/define.php?term=Jeroo" class="urbantip">Jeroo</a></li><li><a href="/define.php?term=Jeropa" class="urbantip">Jeropa</a></li><li><a href="/define.php?term=Jerott" class="urbantip">Jerott</a></li><li><a href="/define.php?term=jerowz" class="urbantip">jerowz</a></li><li><a href="/define.php?term=jeroyd" class="urbantip">jeroyd</a></li><li><a href="/define.php?term=Jeroz" class="urbantip">Jeroz</a></li><li><b><a href="/define.php?term=jerp" class="urbantip">jerp</a></b></li><li><a href="/define.php?term=Jerper" class="urbantip">Jerper</a></li><li><a href="/define.php?term=Jerpes" class="urbantip">Jerpes</a></li><li><a href="/define.php?term=jerph" class="urbantip">jerph</a></li><li><a href="/define.php?term=Jerpies" class="urbantip">Jerpies</a></li><li><a href="/define.php?term=JERPIN" class="urbantip">JERPIN</a></li><li class="active"><b>gubble</b></li><li><a href="/define.php?term=Jerquan" class="urbantip">Jerquan</a></li><li><a href="/define.php?term=Jerque%20du%20Soleil" class="urbantip">Jerque du Soleil</a></li><li><a href="/define.php?term=jerr" class="urbantip">jerr</a></li><li><a href="/define.php?term=Jerra" class="urbantip">Jerra</a></li><li><a href="/define.php?term=Jerrad" class="urbantip">Jerrad</a></li><li><a href="/define.php?term=Jerrael" class="urbantip">Jerrael</a></li><li><a href="/define.php?term=Jerralise" class="urbantip">Jerralise</a></li><li><a href="/define.php?term=Jerramy%20Stevens" class="urbantip">Jerramy Stevens</a></li><li><a href="/define.php?term=Jerred" class="urbantip">Jerred</a></li><li><a href="/define.php?term=Jerrel" class="urbantip">Jerrel</a></li><li><a href="/define.php?term=Jerrell" class="urbantip">Jerrell</a></li><li><a href="/define.php?term=Jerremy" class="urbantip">Jerremy</a></li><li><a href="/define.php?term=jerrera" class="urbantip">jerrera</a></li><li><a href="/define.php?term=Jerreth" class="urbantip">Jerreth</a></li><li><a href="/define.php?term=Jerrett" class="urbantip">Jerrett</a></li><li><a href="/define.php?term=Jerri" class="urbantip">Jerri</a></li><li><a href="/define.php?term=Jerri%27" class="urbantip">Jerri'</a></li><li><a href="/define.php?term=Jerrian" class="urbantip">Jerrian</a></li><li><a href="/define.php?term=Jerric" class="urbantip">Jerric</a></li><li><b><a href="/define.php?term=JERRICA" class="urbantip">JERRICA</a></b></li><li><a href="/define.php?term=Jerrican" class="urbantip">Jerrican</a></li><li><a href="/define.php?term=Jerricca" class="urbantip">Jerricca</a></li><li><a href="/define.php?term=Jerrick" class="urbantip">Jerrick</a></li><li><a href="/define.php?term=jerries" class="urbantip">jerries</a></li><li><a href="/define.php?term=jerrihogoil" class="urbantip">jerrihogoil</a></li>
87
+ </ul>
88
+ <script type='text/javascript'>
89
+ //<![CDATA[
90
+ window.onDomLoaded = window.onDomLoaded || [];
91
+ window.onDomLoaded.push(function() {
92
+ window.nearby = new Nearby(new NearbyView(), "Jeron", "jerrihogoil");
93
+ });
94
+ //]]>
95
+ </script>
96
+
97
+ <div class='prev_next_buttons'>
98
+ <a href="#" id="prev_titles_bottom" onclick="nearby.go('prev'); return false;" onmouseout="$(this).down().src = &quot;http://static3.urbandictionary.com/rel-d5ca9bc/images/uparrow.gif&quot;" onmouseover="$(this).down().src = &quot;http://static3.urbandictionary.com/rel-d5ca9bc/images/uparrow_dark.gif&quot;"><img src="http://static3.urbandictionary.com/rel-d5ca9bc/images/uparrow.gif" /></a>
99
+ <a href="#" id="next_titles_bottom" onclick="nearby.go('next'); return false;" onmouseout="$(this).down().src = &quot;http://static2.urbandictionary.com/rel-d5ca9bc/images/downarrow.gif&quot;" onmouseover="$(this).down().src = &quot;http://static2.urbandictionary.com/rel-d5ca9bc/images/downarrow_dark.gif&quot;"><img src="http://static2.urbandictionary.com/rel-d5ca9bc/images/downarrow.gif" /></a>
100
+ </div>
101
+
102
+ </td>
103
+ <td>
104
+ <div id='content'><div id='not_defined_yet'>
105
+ <i>gubble</i> isn't defined <a href="/add.php?word=gubble">yet</a>.
106
+ </div>
107
+ <div style='margin: 50px auto 0 auto; width: 300px; height: 250px'>
108
+ <script type="text/javascript">
109
+ //<![CDATA[
110
+ var googletag = googletag || {};
111
+ googletag.cmd = googletag.cmd || [];
112
+ googletag.cmd.push(function() {
113
+ googletag.defineUnit('/1031683/ca-pub-4733233155277872/HP_ATF_300x250', [300, 250], 'dfp_homepage_medium_rectangle').addService(googletag.pubads());
114
+ googletag.defineUnit('/1031683/ca-pub-4733233155277872/HP_BTF_300x250', [300, 250], 'dfp_homepage_medium_rectangle_below').addService(googletag.pubads());
115
+ googletag.defineUnit('/1031683/ca-pub-4733233155277872/ROS_BTF_728x90', [728, 90], 'dfp_every_page_leaderboard').addService(googletag.pubads());
116
+ googletag.defineUnit('/1031683/ca-pub-4733233155277872/ROS_Right_160x60', [160, 600], 'dfp_skyscraper').addService(googletag.pubads());
117
+ googletag.defineUnit('/1031683/ca-pub-4733233155277872/Define_300x250', [300, 250], 'dfp_define_rectangle').addService(googletag.pubads());
118
+ googletag.defineUnit('/1031683/ca-pub-4733233155277872/ROS_500x250', [475, 250], 'dfp_define_double_rectangle').addService(googletag.pubads());
119
+
120
+ googletag.pubads().set("alternate_ad_url", "http://www.urbandictionary.com/google_alternate_ad.html");
121
+ googletag.pubads().setTargeting("safe_word", "false");
122
+
123
+ googletag.pubads().enableSingleRequest();
124
+ googletag.enableServices();
125
+ });
126
+
127
+ (function() {
128
+ var gads = document.createElement('script');
129
+ gads.async = true;
130
+ gads.type = 'text/javascript';
131
+ gads.src = "http://www.googletagservices.com/tag/js/gpt.js";
132
+ var node = document.getElementsByTagName('script')[0];
133
+ node.parentNode.insertBefore(gads, node);
134
+ })();
135
+
136
+ //]]>
137
+ </script><div id="dfp_define_rectangle" style="width: 300px; height: 250px"><script type="text/javascript">
138
+ //<![CDATA[
139
+ googletag.cmd.push(function() { googletag.display('dfp_define_rectangle'); });
140
+ //]]>
141
+ </script></div>
142
+ </div>
143
+ </div>
144
+ </td>
145
+ <td id='rightist'>
146
+ <div id="dfp_skyscraper" style="width: 160px; height: 600px"><script type="text/javascript">
147
+ //<![CDATA[
148
+ googletag.cmd.push(function() { googletag.display('dfp_skyscraper'); });
149
+ //]]>
150
+ </script></div>
151
+ </td>
152
+ </tr>
153
+ </table>
154
+
155
+ <div id='bottomad'>
156
+ <div id="dfp_every_page_leaderboard" style="width: 728px; height: 90px; margin: 0 auto"><script type="text/javascript">
157
+ //<![CDATA[
158
+ googletag.cmd.push(function() { googletag.display('dfp_every_page_leaderboard'); });
159
+ //]]>
160
+ </script></div>
161
+ </div>
162
+ </div>
163
+ <div id='copyright'>
164
+ <a href="/">Urban Dictionary</a>
165
+ <span id='years'>
166
+ &copy;1999-2011
167
+ </span>
168
+ <a href='/tos.php'>terms of service</a>
169
+ <a href='/privacy.php'>privacy</a>
170
+ <a href='/feedback.php'>feedback</a>
171
+ <a href='/editor/remove.php'>remove</a>
172
+ <a href='/ads.php'>advertise</a>
173
+ <a href='/poweredby.php'>technology</a>
174
+ <a href='http://jobs.urbandictionary.com/'>jobs</a>
175
+ <a href="/live_support.php" id="live_support" onclick="popAndFocus(&quot;/live_support.php&quot;, &quot;live support&quot;); return false;" style="display: none">live support</a>
176
+ </div>
177
+
178
+ <table class='offsite'>
179
+ <tr>
180
+ <td>
181
+ <table class='facebook'>
182
+ <tr>
183
+ <td>
184
+ <a href="http://feeds.urbandictionary.com/UrbanWordOfTheDay" onclick="urchinTracker(&quot;/outgoing/http_feeds_urbandictionary_com_UrbanWordOfTheDay&quot;)"><div class="rss_image"></div></a>
185
+ </td>
186
+ <td>
187
+ <a href="http://feeds.urbandictionary.com/UrbanWordOfTheDay" onclick="urchinTracker(&quot;/outgoing/http_feeds_urbandictionary_com_UrbanWordOfTheDay&quot;)">add via <b>rss</b></a>
188
+ <br />
189
+ <a href="http://www.google.com/calendar/render?cid=http%3A%2F%2Fwww.urbandictionary.com%2Fdaily.ics" onclick="urchinTracker(&quot;/outgoing/http_www_google_com_calendar_render_cid_http_A_F_Fwww_urbandictionary_com_Fdaily_ics&quot;)">or <b>google calendar</b></a>
190
+ </td>
191
+ </tr>
192
+ </table>
193
+ </td>
194
+ <td>
195
+ <table class='facebook'>
196
+ <tr>
197
+ <td>
198
+ <a href="http://www.facebook.com/profile.php?id=6295613171" onclick="urchinTracker(&quot;/outgoing/http_www_facebook_com_profile_php_id&quot;)"><div class="facebook_image"></div></a>
199
+ </td>
200
+ <td>
201
+ <a href="http://www.facebook.com/profile.php?id=6295613171" onclick="urchinTracker(&quot;/outgoing/http_www_facebook_com_profile_php_id&quot;)">add <b>urban dictionary</b><br/>on <b>facebook</b></a>
202
+ </td>
203
+ </tr>
204
+ </table>
205
+ </td>
206
+ <td>
207
+ <table class='facebook'>
208
+ <tr>
209
+ <td>
210
+ <div class='iphone_image'></div>
211
+ </td>
212
+ <td>
213
+ search ud
214
+ <br />
215
+ <a href="http://iphone.urbandictionary.com/" onclick="urchinTracker(&quot;/outgoing/http_iphone_urbandictionary_com&quot;)">from your <b>phone</b></a>
216
+ <br />
217
+ <a href="/sms.php" onclick="urchinTracker(&quot;/outgoing/sms_php&quot;)">or via <b>txt</b></a>
218
+ </td>
219
+ </tr>
220
+ </table>
221
+ </td>
222
+ <td>
223
+ <table class='facebook'>
224
+ <tr>
225
+ <td>
226
+ <a href="http://twitter.com/urbandaily/" onclick="urchinTracker(&quot;/outgoing/http_twitter_com_urbandaily&quot;)"><div class="twitter_image"></div></a>
227
+ </td>
228
+ <td>
229
+ <a href="http://twitter.com/urbandaily/" onclick="urchinTracker(&quot;/outgoing/http_twitter_com_urbandaily&quot;)"><b>follow urbandaily</b><br/>on twitter</a>
230
+ </td>
231
+ </tr>
232
+ </table>
233
+ </td>
234
+ </tr>
235
+ </table>
236
+
237
+ </div>
238
+ <script src="http://static3.urbandictionary.com/rel-d5ca9bc/assets/base.js" type="text/javascript"></script>
239
+ <script type='text/javascript'>
240
+ //<![CDATA[
241
+ var host_env = new HostEnv(document.location.hostname);
242
+ Uncacheable.instance.load([], host_env.uncacheableUrl());
243
+ //]]>
244
+ </script>
245
+
246
+
247
+
248
+ <script type="text/javascript">
249
+
250
+ var _gaq = _gaq || [];
251
+ _gaq.push(['_setAccount', "UA-31805-1"]);
252
+ _gaq.push(['_trackPageview']);
253
+
254
+ (function() {
255
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
256
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
257
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
258
+ })();
259
+
260
+ </script>
261
+
262
+ <!-- Start Quantcast tag -->
263
+ <script type="text/javascript" src="http://edge.quantserve.com/quant.js"></script>
264
+ <script type="text/javascript">
265
+ _qacct="p-77H27_lnOeCCI";quantserve();</script>
266
+ <noscript>
267
+ <img src="http://pixel.quantserve.com/pixel/p-77H27_lnOeCCI.gif" style="display: none" height="1" width="1" alt=""/></noscript>
268
+ <!-- End Quantcast tag -->
269
+
270
+
271
+ </body>
272
+ </html>