{"id":841,"date":"2010-10-11T18:43:00","date_gmt":"2010-10-11T22:43:00","guid":{"rendered":"http:\/\/patorjk.com\/blog\/?p=841"},"modified":"2014-01-25T17:40:55","modified_gmt":"2014-01-25T21:40:55","slug":"image-definitions-for-dictionaries","status":"publish","type":"post","link":"https:\/\/patorjk.com\/blog\/2010\/10\/11\/image-definitions-for-dictionaries\/","title":{"rendered":"Google Dictionary + Urban Dictionary + Flickr API"},"content":{"rendered":"<p>One of the characteristics of web browser extensions that excites me is that you can write plug-ins for your favorite websites. For my next extension I wanted to create something that was a plug-in to a specific website or websites. After mulling over possible ideas, I decided to create an extension would augment the definitions from dictionary websites with relevant images. The result is <a href=\"https:\/\/chrome.google.com\/extensions\/detail\/hopbcoekbobekknajpmfefbadcoolded?hl=en\">Image Definitions for Dictionaries<\/a>, which is a Chrome web browser extension that augments the results of <a href=\"http:\/\/www.google.com\/dictionary\">Google Dictionary<\/a>, <a href=\"http:\/\/www.google.com\/search?hl=en&#038;safe=off&#038;site=webhp&#038;q=define:example&#038;btnG=Search\">Google Search<\/a>, and <a href=\"http:\/\/www.urbandictionary.com\/\">Urban Dictionary<\/a> with images from <a href=\"http:\/\/www.flickr.com\/\">Flickr<\/a>.<\/p>\n<p><figure style=\"width: 175px\" class=\"wp-caption alignright\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" src=\"http:\/\/patorjk.com\/images\/blog-2010\/homer.png\" title=\"Homer Defined\" width=\"175\" height=\"124\" \/><figcaption class=\"wp-caption-text\">Image From <a href=\"http:\/\/simpsons.wikia.com\/wiki\/Homer_Defined\">Homer Defined<\/a><\/figcaption><\/figure>The idea for this extension came from an episode of the Simpsons where Homer is repeatedly defined in the dictionary, with his picture appearing next to certain words. I thought it would be interesting if that&#8217;s how all dictionaries worked. They would have an image next to the word they were defining and that image would be determined by what the web thought was most relevant. I thought this would especially be interesting for the more eccentric dictionaries like Urban Dictionary. Urban Dictionary does already have an image feature, but it&#8217;s based on user uploads and isn&#8217;t heavily used.<\/p>\n<p>After playing around for a little bit, I had an extension that worked for the previously mentioned sites. Below you can see a slideshow which lets you see how the Flickr thumbnails are integrated into the dictionary webpages (clicking on a thumbnail within a dictionary site will take you to the image&#8217;s Flickr page):<\/p>\n\n\t<ul id=\"slideshow841\" class=\"slideshow841\" style=\"display:none;\">\n\t\t\t\t\t<!-- From a WordPress post\/page -->\n\t\t\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t\t<h3 style=\"opacity:70;\">Google Dictionary<\/h3>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t<span data-alt=\"google-dictionary\">https:\/\/patorjk.com\/blog\/wp-content\/uploads\/bfi_thumb\/google-dictionary-2o9jzvvdtbrepgw93va1ai.png<\/span>\n\t\t\t\t\t\t\t\t\t\t<p>One of the characteristics of web browser extensions that excites me is that you can write plug-ins for your favorite websites. For my next extension I wanted to create something that was a plug-in to a specific website or websites. After mulling over possible ideas, I decided to create an extension would augment the definitions &hellip; &lt;a href=&quot;https:\/\/patorjk.com\/blog\/2010\/10\/11\/image-definitions-for-dictionaries\/&quot; class=&quot;more-link&quot;&gt;Continue reading &lt;span class=&quot;screen-reader-text&quot;&gt;Google Dictionary + Urban Dictionary + Flickr API&lt;\/span&gt; &lt;span class=&quot;meta-nav&quot;&gt;&rarr;&lt;\/span&gt;&lt;\/a&gt;<\/p>\n\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/patorjk.com\/blog\/wp-content\/uploads\/2010\/10\/google-dictionary.png\" id=\"841imglink848\" class=\"colorboxslideshow841\" data-rel=\"slideshowgroup841\" title=\"Google Dictionary\">\n\t\t\t\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t\t<h3 style=\"opacity:70;\">Google Search<\/h3>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t<span data-alt=\"google-search\">https:\/\/patorjk.com\/blog\/wp-content\/uploads\/bfi_thumb\/google-search-2o9jzx03dyk3pwm3knxxqi.png<\/span>\n\t\t\t\t\t\t\t\t\t\t<p>One of the characteristics of web browser extensions that excites me is that you can write plug-ins for your favorite websites. For my next extension I wanted to create something that was a plug-in to a specific website or websites. After mulling over possible ideas, I decided to create an extension would augment the definitions &hellip; &lt;a href=&quot;https:\/\/patorjk.com\/blog\/2010\/10\/11\/image-definitions-for-dictionaries\/&quot; class=&quot;more-link&quot;&gt;Continue reading &lt;span class=&quot;screen-reader-text&quot;&gt;Google Dictionary + Urban Dictionary + Flickr API&lt;\/span&gt; &lt;span class=&quot;meta-nav&quot;&gt;&rarr;&lt;\/span&gt;&lt;\/a&gt;<\/p>\n\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/patorjk.com\/blog\/wp-content\/uploads\/2010\/10\/google-search.png\" id=\"841imglink849\" class=\"colorboxslideshow841\" data-rel=\"slideshowgroup841\" title=\"Google Search\">\n\t\t\t\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t\t<h3 style=\"opacity:70;\">Urban Dictionary<\/h3>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t<span data-alt=\"urban-dictionary\">https:\/\/patorjk.com\/blog\/wp-content\/uploads\/bfi_thumb\/urbandictionary-2o9jzze1diooitsnw4ge8a.png<\/span>\n\t\t\t\t\t\t\t\t\t\t<p>One of the characteristics of web browser extensions that excites me is that you can write plug-ins for your favorite websites. For my next extension I wanted to create something that was a plug-in to a specific website or websites. After mulling over possible ideas, I decided to create an extension would augment the definitions &hellip; &lt;a href=&quot;https:\/\/patorjk.com\/blog\/2010\/10\/11\/image-definitions-for-dictionaries\/&quot; class=&quot;more-link&quot;&gt;Continue reading &lt;span class=&quot;screen-reader-text&quot;&gt;Google Dictionary + Urban Dictionary + Flickr API&lt;\/span&gt; &lt;span class=&quot;meta-nav&quot;&gt;&rarr;&lt;\/span&gt;&lt;\/a&gt;<\/p>\n\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/patorjk.com\/blog\/wp-content\/uploads\/2010\/10\/urbandictionary.png\" id=\"841imglink850\" class=\"colorboxslideshow841\" data-rel=\"slideshowgroup841\" title=\"Urban Dictionary\">\n\t\t\t\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t\t\t<\/ul>\n\t\n\t<div id=\"slideshow-wrapper841\" class=\"slideshow-wrapper\">\n\t\t\t\n\t\t<div class=\"slideshow-fullsize\" id=\"fullsize841\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div id=\"imgprev841\" class=\"slideshow-imgprev imgnav\" title=\"Previous Image\">Previous Image<\/div>\n\t\t\t\t\t\t<a id=\"imglink841\" class=\"slideshow-imglink imglink\"><!-- link --><\/a>\n\t\t\t\t\t\t\t\t\t\t\t<div id=\"imgnext841\" class=\"slideshow-imgnext imgnav\" title=\"Next Image\">Next Image<\/div>\n\t\t\t\t\t\t<div id=\"image841\" class=\"slideshow-image\"><\/div>\n\t\t\t<div class=\"slideshow-information infobottom\" id=\"information841\">\n\t\t\t\t<h3 class=\"slideshow-info-heading\">info heading<\/h3>\n\t\t\t\t<p class=\"slideshow-info-content\">info content<\/p>\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t\n\t\t\t<\/div>\n\t\n\t\n\t<!-- Slideshow Gallery Javascript BEG -->\t\t<script type=\"text\/javascript\">\tjQuery.noConflict();\ttid('slideshow841').style.display = \"none\";\ttid('slideshow-wrapper841').style.display = 'block';\ttid('slideshow-wrapper841').style.visibility = 'hidden';\tvar spinnerDiv = document.createElement('div');\tspinnerDiv.setAttribute('id', 'spinner841');\tspinnerDiv.innerHTML = '<i class=\"fa fa-cog fa-spin\"><\/i>';\tjQuery(spinnerDiv).appendTo('#fullsize841');\ttid('spinner841').style.visibility = 'visible';\tvar slideshow841 = new TINY.slideshow(\"slideshow841\");\tjQuery(document).ready(function() {\t\tslideshow841.auto = true;\t\tslideshow841.speed = 10;\t\tslideshow841.effect = \"fade\";\t\tslideshow841.slide_direction = \"lr\";\t\tslideshow841.easing = \"swing\";\t\tslideshow841.alwaysauto = true;\t\tslideshow841.autoheight = false;\t\tslideshow841.autoheight_max = false;\t\tslideshow841.imgSpeed = 10;\t\tslideshow841.navOpacity = 25;\t\tslideshow841.navHover = 70;\t\tslideshow841.letterbox = \"#000000\";\t\tslideshow841.linkclass = \"linkhover\";\t\tslideshow841.imagesid = \"images841\";\t\tslideshow841.info = \"information841\";\t\tslideshow841.infoonhover = 0;\t\tslideshow841.infoSpeed = 10;\t\tslideshow841.infodelay = 0;\t\tslideshow841.infofade = 0;\t\tslideshow841.infofadedelay = 0;\t\tslideshow841.thumbs = \"\";\t\tslideshow841.thumbOpacity = 70;\t\tslideshow841.left = \"slideleft841\";\t\tslideshow841.right = \"slideright841\";\t\tslideshow841.scrollSpeed = 5;\t\tslideshow841.spacing = 5;\t\tslideshow841.active = \"#ffffff\";\t\tslideshow841.imagesthickbox = \"false\";\t\tjQuery(\"#spinner841\").remove();\t\tslideshow841.init(\"slideshow841\",\"image841\",\"imgprev841\",\"imgnext841\",\"imglink841\");\t\ttid('slideshow-wrapper841').style.visibility = 'visible';\t\tjQuery(window).trigger('resize');\t\t\t\t\t\t\tslideshow841.touch(tid('fullsize841'));\t\t\t\t\t\t\t\t\t});\t\t<\/script>\t\t<!-- Slideshow Gallery Javascript END --><!-- Slideshow Gallery CSS BEG --><style id=\"style-841\">        ul.slideshow841 { list-style:none !important; color:#fff; }\n        ul.slideshow841 span { display:none; }\n        #slideshow-wrapper841 { overflow:hidden; position:relative; width:450px; background:#000000; padding:0 0 0 0; border:1px solid #CCCCCC; margin:0; display:none; }\n        #slideshow-wrapper841 * { margin:0; padding:0; }\n        #slideshow-wrapper841 #fullsize841 { position:relative; z-index:1; overflow:hidden; width:450px; height:250px; clear:both; border: none; }\n        #slideshow-wrapper841 #information841 { text-align:left; font-family:Verdana, Arial, Helvetica, sans-serif !important; position:absolute; bottom:0; width:450px; height:0; background:#000000; color:#FFFFFF; overflow:hidden; z-index:300; opacity:.7; filter:alpha(opacity=70); }\n        #slideshow-wrapper841 #information841 h3 { color:#FFFFFF; padding:4px 8px 3px; margin:0 !important; font-size:16px; font-weight:bold; }\n        #slideshow-wrapper841 #information841 a { color:#FFFFFF; }\n        #slideshow-wrapper841 #information841 p { color:#FFFFFF; padding:0 8px 8px; margin:0 !important; font-size: 14px; font-weight:normal; }\n        #slideshow-wrapper841 .infotop { margin-bottom:8px !important; top:0; }\n        #slideshow-wrapper841 .infobottom { margin-top:8px !important; bottom:0; }\n                    #slideshow-wrapper841 #image841 { width:450px; }\n            #slideshow-wrapper841 #image841 img { border:none; border-radius:0; box-shadow:none; position:absolute; height:auto; max-width:100%; margin:0 auto; display:block; }\n                #slideshow-wrapper841 .imgnav { position:absolute; width:25%; height:100%; cursor:pointer; z-index:250; }\n        #slideshow-wrapper841 #imgprev841:before { font-family:FontAwesome; content:\"\\f053\"; font-size:30px; color:white; visibility:visible; left:0; text-align:left; width: auto; height:auto; line-height:160%; top:50%; margin:-30px 0 0 0; border-radius:0 10px 10px 0; background:black; padding:3px 10px 0 10px; position: absolute; display: inline-block; }\n        #slideshow-wrapper841 #imgprev841 { display:none; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -o-user-select: none; left:0; font-size:0px; }\n        #slideshow-wrapper841 #imgnext841:before { font-family:FontAwesome; content:\"\\f054\"; font-size:30px; color:white; visibility:visible; right:0; text-align:right; width: auto; height:auto; line-height:160%; top:50%; margin:-30px 0 0 0; border-radius:10px 0 0 10px; background:black; padding:3px 10px 0 10px; position: absolute; display: inline-block; }\n        #slideshow-wrapper841 #imgnext841 { display:none; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -o-user-select: none; right:0; font-size:0px; }\n        #slideshow-wrapper841 #imglink841 { position:absolute; zoom:1; background-color:#ffffff; height:100%; width:100%; left:0; z-index:149; opacity:0; filter:alpha(opacity=0); }\n        #slideshow-wrapper841 .linkhover:before { font-family:FontAwesome; content:\"\\f14c\"; font-size:30px; text-align:center; height:auto; line-height:160%; width:auto; top:50%; left:auto; right:auto; margin:-30px 0 0 0; padding:0px 12px; display: inline-block; position: relative; background:black; color:white; border-radius:10px; }\n        #slideshow-wrapper841 .linkhover { background:transparent !important; opacity:.4 !important; filter:alpha(opacity=40) !important; text-align:center; font-size:0px; }\n        #slideshow-wrapper841 #thumbnails841 { background:#000000; }\n        #slideshow-wrapper841 .thumbstop { margin-bottom:8px !important; }\n        #slideshow-wrapper841 .thumbsbot { margin-top:8px !important; }\n        #slideshow-wrapper841 #slideleft841:before { font-family:FontAwesome; content: \"\\f104\"; color:#999; position: absolute; height: auto; line-height:160%; width: auto; display: inline-block; top: 50%; font-size: 30px; margin: -30px 0 0 0; padding: 0 5px; }\n        #slideshow-wrapper841 #slideleft841 { text-align:left; float:left; position:relative; width:20px; height:89px; background:#222; }\n        #slideshow-wrapper841 #slideleft841:hover { background-color:#333; }\n        #slideshow-wrapper841 #slideright841:before { font-family:FontAwesome; content: \"\\f105\"; color:#999; position: absolute; height: auto; line-height:160%; width: auto; display: inline-block; top: 50%; font-size: 30px; margin: -30px 0 0 0; padding: 0 5px; }\n        #slideshow-wrapper841 #slideright841 { text-align:left; float:right; position:relative; width:20px; height:89px; background:#222; }\n        #slideshow-wrapper841 #slideright841:hover { background-color:#333; }\n        #slideshow-wrapper841 #slidearea841 { float:left; position:relative; background:#000000; width:395px; margin:0 5px; height:89px; overflow:hidden; }\n        #slideshow-wrapper841 #slider841 { position:absolute; width:393px !important; left:0; height:89px; }\n        #slideshow-wrapper841 #slider841 img { width:100px; height:75px; cursor:pointer; border:1px solid #666; padding:2px; float:left !important; }\n        #slideshow-wrapper841 #spinner841 { position:relative; top:50%; left:45%; text-align:left; font-size:30px; }\n        #slideshow-wrapper841 #spinner841 img { border:none; }\n                @media (max-width:480px) { \t.slideshow-information { display: none !important; } }\n                        @media (max-width:480px) { \t.slideshow-thumbnails { display: none !important; } }\n            <\/style><!-- Slideshow Gallery CSS END -->\n<p>Using the <a href=\"http:\/\/www.flickr.com\/services\/api\/\">Flickr API<\/a> turned out to be a breeze, though most of the functionality I needed was already <a href=\"http:\/\/src.chromium.org\/viewvc\/chrome\/trunk\/src\/chrome\/common\/extensions\/docs\/examples\/tutorials\/getstarted\/popup.html?content-type=text\/plain\">provided in an example<\/a> created by Google. I did briefly look into using other APIs, or having the option for multiple APIs to be used, however, I wasn&#8217;t able to find a service comparable to Flickr&#8217;s API. Google&#8217;s has <a href=\"http:\/\/code.google.com\/apis\/ajaxsearch\/multimedia.html\">Google AJAX Search API<\/a>, but that appears to be aimed at providing searching services and it doesn&#8217;t seem to give you access to individual thumbnails. I looked into some other services too, but nothing jumped out at me. <\/p>\n<p>Anyway, I hope this extension can be of use to some of you or provide you with some entertainment value. If anyone has any requests for sites I should support, or has any suggestions for the extension, please let me know.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the characteristics of web browser extensions that excites me is that you can write plug-ins for your favorite websites. For my next extension I wanted to create something that was a plug-in to a specific website or websites. After mulling over possible ideas, I decided to create an extension would augment the definitions &hellip; <a href=\"https:\/\/patorjk.com\/blog\/2010\/10\/11\/image-definitions-for-dictionaries\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Google Dictionary + Urban Dictionary + Flickr API<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"class_list":["post-841","post","type-post","status-publish","format-standard","hentry","category-web-browser-extensions"],"_links":{"self":[{"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/posts\/841","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/comments?post=841"}],"version-history":[{"count":29,"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/posts\/841\/revisions"}],"predecessor-version":[{"id":878,"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/posts\/841\/revisions\/878"}],"wp:attachment":[{"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/media?parent=841"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/categories?post=841"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/patorjk.com\/blog\/wp-json\/wp\/v2\/tags?post=841"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}