Yahoo! Developer Network Blog

« Previous | Main | Next »


September 16, 2009

Ahoy, Mates! Convert ye pages to Pirate with YQL!

Avast, scurvy dogs!

As ye no doubt know "talk like a pirate day" will'n soon be upon us on September 19th in the year of our Lord two thousand and nine. The Yarhoo! Pirate Network know we be instrumental in converting those'n scurvy buccaneers to the ways of the sea. Our mistress be a tempest and Davey Jones be commandin' more bodies into her depths so we must be replenishing our numbers from the ranks of the landlubbers.

Using Ye Pirate Table

If'n yar wish to find more salty pirates use yonder YQL table to convert your web pages to pirate speak using these here commands. Simply add env=store://kid666.com/piratespeak to thar end of your console or request URL and ye be done. Ye pirate tables will appear as if by magic. Since you're likely a lot of lazy dogs here be a link.

Ye can also use yonder JavaScript on the bottom of your pages <script src="http://l.yimg.com/d/lib/ydn/js/pirate1252961643.js"></script> to automatically change them to pirate speak after thar page has loaded.

How we made thar Pirate Table

If'n ye be interested in how we be makin' yonder pirate table I shall explain thusly. First we take thar HTML that ye be giving to us or we be taking the <body> element from yonder URL parameter. Once we have that thar HTML we be splitting it into tags and text. We take ye text and split it some more until we be having only words. Then we be replacing the English words with good hearty Pirate words. No more bar only a tavern. O' course each word can have more than one translation, hello be either ahoy or avast. Finally we be stitching all the words and tags back together and we be returning that as the <results>.

Now to make this'n talk like a pirate day a success we need your help. We have entered some o' the translations for the piratespeak.dictionary but we be needing more, much more. If'n ye want to contribute to the dictionary ye can use the YQL statement thus insert into piratespeak.dictionary (english_term, pirate_term) values ("hello", "ahoy");. Add ye a translation now!

This pirate be made possible by the new yql.storage table and the set variables. It be giving us the chance to host some data in YQL relating to yonder pirate terms. We also be using it to store the tables and our secrets. If ye haven't tried storing data in YQL yet, mark this be your chance.

Tell us on Twitter if ye be building pirate widgets with yonder YQL pirate table and let us make this pirate day one the land lubbers will never forget.

Be converting any page

Of course if'n ye not be a developer ye can still use our piratize bookmarklet by simply saving thar link and then running on yonder page ye wish to piratize.

Cap'n Tom "Brown Beard" Hughes-Croucher (@sh1mmer)
Master of thar seven seas - Yarhoo! Pirate Network

P.S I be adding a secret to ye pirate.translate table. First one to find it and comment or tweet @ us might win some booty. Ye scurvy dogs will never find it though, because you fight like a dairy farmer.

Posted at September 16, 2009 2:27 AM | Permalink

Bookmark this on Delicious

Comments

What have you got against lawyers, Tom? :)

Posted by: Kent Brewster at September 16, 2009 6:53 AM

Holy awesome.

Posted by: Josh L at September 16, 2009 12:51 PM

The founders of Talk Like A Pirate Day salute you, and heartily endorse this tool. (-:

(I'll also promote it on our site this week...)

--
Jezebel
Webwench to the Pirate Guys

Posted by: Jezebel at September 16, 2009 2:31 PM

Arr! Vote for the pirate party. http://www.piratenpartei.de

Posted by: chrissie at September 16, 2009 2:43 PM

How appropriate. You fight like a cow.

Ah, Melee Island.


Posted by: Nicholas Hutchind at September 17, 2009 7:43 AM

And to make things a bit easier, here are some frontends to the YQL table:

* The Pirate Dictionary add-to form: http://isithackday.com/hacks/piratedictionary/
* The ARRPI - an API to translate from English to Pirate http://isithackday.com/arrpi.php
* The Pirate Translator form with tweet button http://isithackday.com/pirate-translator/

Posted by: Chris Heilmann at September 17, 2009 4:56 PM

Ahoy there me hartys, this be a great tool. Check out http://www.play-and-stay.co.uk/ for ye chance to win a brand spakin' new Pirate Ship. Arrrrr!!

Posted by: Captain Mcpentface at September 18, 2009 4:32 AM

Is there any way to add this to a PHBB forum? I've tried some various placements at the bottom of the forums, and it always results in making the forum think the user is not logged in and sends them to the log in page (even though they still are)... most likely because it's injecting a script into the header and refreshing the page?

Posted by: Jason Burns at September 18, 2009 11:01 AM

Yarr! Where be me recognition n' mug o' grog fer dicipherin' the inner workin's and secrets of ye magical box?

If'n I'm not mistakin' (and tis rare that I be), I found yer secret beguilin's hidden away and wantin' to redeem them, I am.

Look! Behind you! A three-headed monkey!

Posted by: Nicholas Hutchind at September 18, 2009 2:08 PM

Post a comment

Comment Policy: We encourage comments and look forward to hearing from you. Please note that Yahoo! may, in our sole discretion, remove comments if they are off topic, inappropriate, or otherwise violate our Terms of Service. Fields marked with asterisk '*' are required.

Remember Me?

Subscribe

YDN Blog: Get Yahoo! Developer Network Blog on your personalized My Yahoo! home page.

Add To My RSS Feed

YDN Link Blog: Get Yahoo! Developer Network Linkblog on your personalized My Yahoo! home page.

Add To My RSS Feed

Recent Readers

Copyright © 2010 Yahoo! Inc. All rights reserved. Copyright | Privacy Policy

Help us continue to improve the Yahoo! Developer Network: Send Your Suggestions