
Happy Talk Like a Pirate Day!
In honor of such a special day, let's look at the API (or should I say, ARRPI) created just for learning how to talk like a pirate.
The API is extremely simple. Just pass it the text you want to translate to pirate-speak, and it returns the translated text.
First you'll want to get the MSXML class module I created. Then paste the following function into a standard module.
Function PirateSpeak(normalText As String) As String
Const BASE_URL As String = "http://isithackday.com/arrpi.php?text="
Dim msxml As clsMSXML
Dim xml As Object ' MSXML2.XMLHTTP60
Dim result As String
Set msxml = New clsMSXML
Set xml = msxml.GetMSXML
result = msxml.GetResponse(xml, HTTP_GET, _
BASE_URL & normalText, False)
PirateSpeak = result
End Function
Sample Usage
Sub GetPirateTalk()
MsgBox PirateSpeak("Hello, is there gold on that island?")
End Sub
If you really want a laugh, have Excel speak pirate!
Application.Speech.Speak PirateSpeak("Hello, is there gold on that island?")
For the record, I was extremely tempted to convert my entire site to pirate-speak (just for today), but decided against it at the last minute.
Now go and translate your Excel workbooks into pirate-speak for a day.
(Thanks to ProgrammableWeb for letting us know about the API.)
Awesome. I couldn't get mine to work though.
GetResponse is not in the MSXML class module. So I changed it to GetXMLResponse, still not working with a 1004 error at:
Application.Speech.Speak PirateSpeak("Hello, is there gold on that island?")
Oops, sorry about that. You should be able to take the code from here and paste it into the class module.