Steven Li
Created June 3, 2017

Ferret Facts

Fun facts for fuzzy, furry ferrets!

Showcase (no instructions)38
Ferret Facts

Things used in this project

Hardware components

Amazon Echo
Amazon Alexa Amazon Echo
×1

Software apps and online services

AWS Lambda
Amazon Web Services AWS Lambda

Story

Read more

Schematics

Alexa Voice User Interface

Code

index.js

JavaScript
Main AWS Lambda code in node.js.
'use strict';
var Alexa = require('alexa-sdk');
var APP_ID = undefined;  // TODO replace with your app ID (OPTIONAL).

var languageStrings = {
    "en-GB": {
        "translation": {
            "FACTS": [
"The word 'ferret' is from the Latin fur, meaning 'little thief.' Indeed, one of the ferrets favorite activities is stealing and hiding things.",
"Ferrets belong to the weasel (Mustelidae) family. Besides weasels and ferrets, this group of animals also includes minks, otters, and badgers as well as polecats and sables.",
"An endangered species of ferrets previously thought to extinct, the black-footed ferret, was recently rediscovered in America.",
"Like cats, pet ferrets use litter boxes to go to the bathroom, though they are not quite as easily trained as cats.",
"It is illegal to own a ferret in California, Hawaii, New York City, and Washington D.C. as well as in some communities in other states.",
"Ferrets are still used for hunting rabbits in some parts of the world.",
"The ferret was domesticated several thousand years ago to help hunters flush rabbits from their holes ('ferreting out') and also to catch small animals such as rats and mice.",
"Ferrets that are neutered very young may not grow as big as those neutered after they reach 6 months old.",
"Ferrets are considered to be geriatric by the time they reach 4 years old.",
"Baby ferrets are called kits, adult males are called hobs, and adult females are called jills. Hobs are up to 50% larger than jills.",
"There are about 5 to 7 million pet ferrets in the U.S.",
"Though the ferret has been domesticated for over 2,000 years, it has only been a popular pet in the U.S. for the last 30 years.",
"A group of ferrets is called a 'business.'",
"While most ferrets in the U.S. are sold de-scented, other parts of the world consider de-scenting unnecessary.",
"Like all members of the weasel family, ferrets are closely related to skunks and, like skunks, they can emit an odorous smell when excited or afraid. Consequently, many ferret owners decide to have their ferrets de-scented.",
"'Ferret legging' is a contest in which participants drop 2 live ferrets into their pants (without underwear) that are tied off at the waist and the ankles. The animals then claw and bite to try to get free. The winner of the contest is the participant who can keep the ferret in his pants the longest. While most people can only last a few minutes, in 2010 two men kept the ferrets in their pants for over 5 hours.",
"Ferrets are prone to several medical conditions, including adrenal diseases and intestinal blockage (from gobbling inedible objects). They also carry the same afflictions as a cat or dog, such as canine distemper, rabies, and heartworm.",
"There are several populations of feral ferrets throughout the world. The most notable and destructive population lives in New Zealand. They were initially imported from England from 1879 to 1883 to help control the rabbit population. When that population was under control, the hybrids began eating New Zealands native birds which, until that time, had no natural predators.",
"When ferrets are excited, they perform what is called a 'weasel war dance,' which is a series of leaps, sideways hops, and bumping into nearby objects. Such a display is not a sign of aggression but rather an invitation to play.",
"Ferrets imprint on their food at about 6 months old, which makes introducing new food to older ferrets difficult.",
"The ferret is the most popular companion mammal in the U.S. behind the dog and cat.",
"Queen Elizabeth owned an albino ferret, which appears in one of her portraits.",
"Ferrets are closer to cats and dogs than they are to mice or rats.",
"Ferrets can live up to 15 years, though most live 6 to 10 years.",
"Ferrets come in a variety of colors, including sable, chocolate, cream, cinnamon, silver, and albino. All ferrets are white at birth and begin to turn their adult color at 3 months old.",
"Ferrets sleep for about 1520 hours a day, usually for about 4 hours at a time. A ferrets sleep is also known as 'ferret dead sleep' because ferrets sleep so deeply.",
"Ferrets prefer to sleep in an enclosed area.",
"Baby ferrets are born both deaf and blind and begin to hear and see at around 34 days old.",
"Because ferrets are domesticated and their estrous cycle is similar to humans, they have become important in reproduction research. Ferrets have also been used for auditory research, flu vaccine research, and ant-emetics research for cancer patients.",
"While not as common as with dogs, ferrets will wag their tail when happy. They will also make a chortling or clucking sound known as 'dooking.'",
"In the past, ferrets have been trained to carry cables through tunnels, pipes, and other places too small for humans.",
"Ferrets have very flexible ribs that allow them to flatten themselves and crawl through very small spaces.",
"In recent years, people have begun breeding ferrets with specialized colors, such as 'badger' and 'panda.' Unfortunately, these patterns make them more susceptible to a congenital defect called Waardenburg syndromewhich in ferrets leads to deafness. Most ferrets that have a white blaze or stripe on their head are at least partially deaf.",
"Ferrets were domesticated around 2,500 years ago.",
"Ferrets are the only members of the weasel family that have been domesticated by people to become pets.",
"Just as a wolf can breed with a domestic dog, ferrets and European polecats can breed. In fact, there are some polecat/ferret hybrids living in the wild in England. Ferrets and polecats can also interbreed with the European mink, though their male offspring will be sterile.",
"While most ferrets pose little real danger to humans, some ferrets have been known to attack. In June 2000, a pair of pet ferrets attacked a 10-year-old girl in Wisconsin. Luckily, the family dog leapt to her rescue, and she required only stitches.",
"Experts believe that because babies smell like milk, ferrets view them as prey.",
"Female ferrets who do not mate or are not spayed can overproduce estrogen, which can lead to anemia, clotting, and even death.",
"In England, hunting rabbits with ferrets is a sport. Ferrets can burrow and track a rabbit underground. The ferret wears a special collar so its owner can find them and dig them out.",
"In Argentina, someone drugged ferrets with growth hormones and sold them as poodles at swap meets.",
"Falconers have used ferrets to help bring prey closer to the hawk. If ferrets are introduced early in its life, a hawk will accept it as a hunting partner.",
"White ferrets were favoured in the Middle Ages because white was easily seen in thick undergrowth.",
"The most famous ferret is probably the one in Leonardo da Vincis painting Lady with an Ermine. While 'ermine' is actually the name of a weasel or stoat, scholars believe the animal in the painting is a ferret.",
"According to the American Veterinary Medicine Association, approximately 334,000 households in American own a pet ferret.",
"Newborn ferrets are very small and can fit inside a teaspoon. While a full-grown ferret can reach 20 inches long and weigh 1.5 to 4.0 pounds, a newborn ferret weighs just 1 ounce.",
"Ferrets are very nearsighted, but they compensate with a keen sense of hearing and smell.",
"Bathing a ferret often results in a smellier pet. A ferrets oil glands will over produce in an attempt to replace the oils that have been washed down the drain. Ferrets usually need to be bathed only a few times a year."
            ],
            "SKILL_NAME" : "Ferret Facts",
            "GET_FACT_MESSAGE" : "Here's your fact: ",
            "HELP_MESSAGE" : "You can say tell me a ferret fact, or, you can say exit... What can I help you with?",
            "HELP_REPROMPT" : "What can I help you with?",
            "STOP_MESSAGE" : "Goodbye!"
        }
    },
    "en-US": {
        "translation": {
            "FACTS": [
"The word 'ferret' is from the Latin fur, meaning 'little thief.' Indeed, one of the ferrets favorite activities is stealing and hiding things.",
"Ferrets belong to the weasel (Mustelidae) family. Besides weasels and ferrets, this group of animals also includes minks, otters, and badgers as well as polecats and sables.",
"An endangered species of ferrets previously thought to extinct, the black-footed ferret, was recently rediscovered in America.",
"Like cats, pet ferrets use litter boxes to go to the bathroom, though they are not quite as easily trained as cats.",
"It is illegal to own a ferret in California, Hawaii, New York City, and Washington D.C. as well as in some communities in other states.",
"Ferrets are still used for hunting rabbits in some parts of the world.",
"The ferret was domesticated several thousand years ago to help hunters flush rabbits from their holes ('ferreting out') and also to catch small animals such as rats and mice.",
"Ferrets that are neutered very young may not grow as big as those neutered after they reach 6 months old.",
"Ferrets are considered to be geriatric by the time they reach 4 years old.",
"Baby ferrets are called kits, adult males are called hobs, and adult females are called jills. Hobs are up to 50% larger than jills.",
"There are about 5 to 7 million pet ferrets in the U.S.",
"Though the ferret has been domesticated for over 2,000 years, it has only been a popular pet in the U.S. for the last 30 years.",
"A group of ferrets is called a 'business.'",
"While most ferrets in the U.S. are sold de-scented, other parts of the world consider de-scenting unnecessary.",
"Like all members of the weasel family, ferrets are closely related to skunks and, like skunks, they can emit an odorous smell when excited or afraid. Consequently, many ferret owners decide to have their ferrets de-scented.",
"'Ferret legging' is a contest in which participants drop 2 live ferrets into their pants (without underwear) that are tied off at the waist and the ankles. The animals then claw and bite to try to get free. The winner of the contest is the participant who can keep the ferret in his pants the longest. While most people can only last a few minutes, in 2010 two men kept the ferrets in their pants for over 5 hours.",
"Ferrets are prone to several medical conditions, including adrenal diseases and intestinal blockage (from gobbling inedible objects). They also carry the same afflictions as a cat or dog, such as canine distemper, rabies, and heartworm.",
"There are several populations of feral ferrets throughout the world. The most notable and destructive population lives in New Zealand. They were initially imported from England from 1879 to 1883 to help control the rabbit population. When that population was under control, the hybrids began eating New Zealands native birds which, until that time, had no natural predators.",
"When ferrets are excited, they perform what is called a 'weasel war dance,' which is a series of leaps, sideways hops, and bumping into nearby objects. Such a display is not a sign of aggression but rather an invitation to play.",
"Ferrets imprint on their food at about 6 months old, which makes introducing new food to older ferrets difficult.",
"The ferret is the most popular companion mammal in the U.S. behind the dog and cat.",
"Queen Elizabeth owned an albino ferret, which appears in one of her portraits.",
"Ferrets are closer to cats and dogs than they are to mice or rats.",
"Ferrets can live up to 15 years, though most live 6 to 10 years.",
"Ferrets come in a variety of colors, including sable, chocolate, cream, cinnamon, silver, and albino. All ferrets are white at birth and begin to turn their adult color at 3 months old.",
"Ferrets sleep for about 1520 hours a day, usually for about 4 hours at a time. A ferrets sleep is also known as 'ferret dead sleep' because ferrets sleep so deeply.",
"Ferrets prefer to sleep in an enclosed area.",
"Baby ferrets are born both deaf and blind and begin to hear and see at around 34 days old.",
"Because ferrets are domesticated and their estrous cycle is similar to humans, they have become important in reproduction research. Ferrets have also been used for auditory research, flu vaccine research, and ant-emetics research for cancer patients.",
"While not as common as with dogs, ferrets will wag their tail when happy. They will also make a chortling or clucking sound known as 'dooking.'",
"In the past, ferrets have been trained to carry cables through tunnels, pipes, and other places too small for humans.",
"Ferrets have very flexible ribs that allow them to flatten themselves and crawl through very small spaces.",
"In recent years, people have begun breeding ferrets with specialized colors, such as 'badger' and 'panda.' Unfortunately, these patterns make them more susceptible to a congenital defect called Waardenburg syndromewhich in ferrets leads to deafness. Most ferrets that have a white blaze or stripe on their head are at least partially deaf.",
"Ferrets were domesticated around 2,500 years ago.",
"Ferrets are the only members of the weasel family that have been domesticated by people to become pets.",
"Just as a wolf can breed with a domestic dog, ferrets and European polecats can breed. In fact, there are some polecat/ferret hybrids living in the wild in England. Ferrets and polecats can also interbreed with the European mink, though their male offspring will be sterile.",
"While most ferrets pose little real danger to humans, some ferrets have been known to attack. In June 2000, a pair of pet ferrets attacked a 10-year-old girl in Wisconsin. Luckily, the family dog leapt to her rescue, and she required only stitches.",
"Experts believe that because babies smell like milk, ferrets view them as prey.",
"Female ferrets who do not mate or are not spayed can overproduce estrogen, which can lead to anemia, clotting, and even death.",
"In England, hunting rabbits with ferrets is a sport. Ferrets can burrow and track a rabbit underground. The ferret wears a special collar so its owner can find them and dig them out.",
"In Argentina, someone drugged ferrets with growth hormones and sold them as poodles at swap meets.",
"Falconers have used ferrets to help bring prey closer to the hawk. If ferrets are introduced early in its life, a hawk will accept it as a hunting partner.",
"White ferrets were favoured in the Middle Ages because white was easily seen in thick undergrowth.",
"The most famous ferret is probably the one in Leonardo da Vincis painting Lady with an Ermine. While 'ermine' is actually the name of a weasel or stoat, scholars believe the animal in the painting is a ferret.",
"According to the American Veterinary Medicine Association, approximately 334,000 households in American own a pet ferret.",
"Newborn ferrets are very small and can fit inside a teaspoon. While a full-grown ferret can reach 20 inches long and weigh 1.5 to 4.0 pounds, a newborn ferret weighs just 1 ounce.",
"Ferrets are very nearsighted, but they compensate with a keen sense of hearing and smell.",
"Bathing a ferret often results in a smellier pet. A ferrets oil glands will over produce in an attempt to replace the oils that have been washed down the drain. Ferrets usually need to be bathed only a few times a year."
            ],
            "SKILL_NAME" : "Ferret Facts",
            "GET_FACT_MESSAGE" : "Here's your fact: ",
            "HELP_MESSAGE" : "You can say tell me a ferret fact, or, you can say exit... What can I help you with?",
            "HELP_REPROMPT" : "What can I help you with?",
            "STOP_MESSAGE" : "Goodbye!"
        }
    }
};

exports.handler = function(event, context, callback) {
    var alexa = Alexa.handler(event, context);
    alexa.APP_ID = APP_ID;
    // To enable string internationalization (i18n) features, set a resources object.
    alexa.resources = languageStrings;
    alexa.registerHandlers(handlers);
    alexa.execute();
};

var handlers = {
    'LaunchRequest': function () {
        this.emit('GetFact');
    },
    'GetNewFactIntent': function () {
        this.emit('GetFact');
    },
    'GetFact': function () {
        // Get a random ferret fact from the ferret facts list
        // Use this.t() to get corresponding language data
        var factArr = this.t('FACTS');
        var factIndex = Math.floor(Math.random() * factArr.length);
        var randomFact = factArr[factIndex];

        // Create speech output
        var speechOutput = this.t("GET_FACT_MESSAGE") + randomFact;
        this.emit(':tellWithCard', speechOutput, this.t("SKILL_NAME"), randomFact)
    },
    'AMAZON.HelpIntent': function () {
        var speechOutput = this.t("HELP_MESSAGE");
        var reprompt = this.t("HELP_MESSAGE");
        this.emit(':ask', speechOutput, reprompt);
    },
    'AMAZON.CancelIntent': function () {
        this.emit(':tell', this.t("STOP_MESSAGE"));
    },
    'AMAZON.StopIntent': function () {
        this.emit(':tell', this.t("STOP_MESSAGE"));
    }
};

Credits

Steven Li

Steven Li

1 project • 0 followers

Comments