For a long time we were missing “code example” for a popular programming language Ruby! Luck wanted me to be a guest speaker on a panel discussion during Web Industrija (last Thursday). Although the panel discussion was really interesting (From ideas to investments), and guests congratulated me, we have a much more interesting announcement 🙂
During the Web Industrija I met Alexander Rusa from Emerion. Alexander loves Ruby, and it was very kind of him to provide us with a code example for such a fantastic language! When he is not writing cool Ruby code for hot startups, he is working at Emerion, one of the hosting companies in Austria.
We’re going to check if the domain name “whoapi.com” is available. If error occurs it will be translated automatically, if not you should see “1” (domain taken) as a resulting string.
require ‘json’domain = “whoapi.com” # domain to check
r = “taken” # request type: domain availability
apikey = “demokey” # your API key
output = JSON.parse(open(
if output[“status”].to_i == 0