SAMUEL BROWNE
Created December 19, 2016

India Book

Teaches you about India in a fun filled way. India is a blessed country Use this app to find mor about India.

19
India Book

Things used in this project

Story

Read more

Schematics

How Alexa and the User are connected

Code

index.js

JavaScript
/**Jesus is Lord**//**    Copyright SAMUEL BROWNE. All Rights Reserved.    Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.*//** * This example has no external dependencies or session management, and shows the most basic way to create a Lambda function for handling Alexa Skill requests. * * Examples: * One-shot model: *  User: "Alexa, ask IndiaBook for a India fact" *  Alexa: "Here's your India Fact: ..." *//** * App ID for the skill */var APP_ID = undefined; //OPTIONAL: replace with "amzn1.echo-sdk-ams.app.[your-unique-value-here]";/** * Array containing INDIA FACTS. */var INDIA_FACTS = [                "India is very close to the heart of Jesus Christ",	                "The book of Micah in The Holy Bible is regarded by some as for India",	                "Dr. D.G.S Dhinakaran is a humble and true servant of God from India.",	                "India has the world’s third largest church in terms of members.",     	                "If you have read Bhagvad Gita, Ramayan, Mahabharata then you will realize that there is not even a single text which mentions the word "Hindu". It was a name which was given by foreigners because our land was on other side of river "Indus" and hence came the name "Hindu". But eventually, some people made it a religion. ",	            "The word Hindu is derived from the Indo-Aryan and Sanskrit, Sanskrit word Sindhu, which means "a large body of water", covering "river, ocean". It was used as the name of the Indus river and also referred to its tributaries. ",	                "Though India is a country of multiple regional and local languages but in terms of English speaking countries in the world, it ranks number 2, yes, India is second largest English speaking country in the world, 10% of Indians can speak in English which is about 125 million people.",	                "According to the Guinness Book of World Records, India ranks third behind the USA and the UK in the number of records claimed each year. ",	                "In 2011, India made the third greatest number of record applications to Guinness World Records – behind only U.S. and United Kingdom.",	             "Mahatma Gandhi is not the Father of the nation.",	                "Indians widely describe Gandhi as the father of the nation. The title "The Father of the Nation" for Gandhi is not an official title and has not been officially accorded by Government of India. An RTI query filed by a 10-year-old girl from Lucknow in February 2012 revealed that PMO has no records of ever according such title to Gandhi. MHA and National Archives of India also communicated of not having any records. Origin of this title is traced back to a radio address (on Singapore radio) on 6 Jul 1944 by Subhash Chandra Bose where Bose addressed Gandhi as "The Father of the Nation". On 28 Apr 1947, Sarojini Naidu during a conference also referred Gandhi as "Father of the Nation". The RTI applicant had also pleaded for Gandhi to be officially declared as "Father of the Nation" to which the MHA informed that Gandhi cannot be accorded with the title by Government of India since the Indian constitution does not permit any titles except educational and military titles.",          "India has an Ice Hockey team and they are even member of International Ice Hockey Federation.",    "The India national ice hockey team is the national ice hockey team of India, and a member of the International Ice Hockey Federation.",                "first mail account system Hotmail was also created by an Indian by Mr. Sabeer Bhatia",                "That it is illegal for a child in India to neglect their parents after their retirement.)",          "Right to maintenance— Maintenance is a right to livelihood when one is incapable of sustaining oneself. Right to maintenance forms a part of the personal law. Obligation of a husband to maintain his wife arises out of the status of the marriage. Hindu law, one of the most ancient systems of law, recognizes right of any dependent person including wife, children, aged parents and widowed daughter or daughter-in-law to maintenance. The Hindu Adoptions and Maintenance Act, 1956, provides for this right.",              "Kerala tops the "Highest liquor consuming State" list in India, not Punjab.",                "Kerala accounts for the country's highest consumption of alcohol followed by Maharashtra and Punjab.",                "Only 3% of Indians pay income tax, in a population of 1.2bn. One explanation for this is that agriculture is exempt and two-thirds of Indians live in rural areas. A large chunk of the economy is also informal, unorganized labor, for which it's harder to collect taxes. Many argue that some of the country's financial problems would be solved in one fell swoop, if this massive tax hole could be filled.",                "The first rocket in India was transported on a cycle.",                "The first rocket was so light and small that it was transported on a bicycle to the Thumba Launching Station in Thiruvananthapuram, Kerala.",                "India’s first floating Post office is on Dal Lake in Srinagar, the first of its kind in the country. It was inaugurated by Minister of State for Communications and IT Mr. Sachin Pilot and Chief Minister of Jammu and Kashmir Mr. Omar Abdullah on August 22'2011.",                "This innovation by India Post is the star attraction for the tourists visiting the lake. Besides offering normal services, the place will also have a philately museum and a shop that will sell postage stamps and other products. It functions from 10 am to 6 pm on all days including Sundays during the tourist season.",                "The world's biggest family: The man with 39 wives, 94 children and 33 grandchildren, India. He is head of the world's biggest family – and says he is ‘blessed’ to have his 39 wives. Ziona Chana also has 94 children, 14-daughters-in-law and 33 grandchildren. They live in a 100-room, four storey house set amidst the hills of Baktwang village in the Indian state of Mizoram, where the wives sleep in giant communal dormitories.",                "A polling station is set up in a forest for a lone voter in every election since 2004. He remains one of India's most prized voters. Mahant Bharatdas Darshandas is the lone voter in the midst of Gujarat's Gir forest, home to the Asiatic lion, for whom an entire election team sets up a polling booth every election – and will do so again on April 30.",                "Largest Funeral attended: Funeral of CN Annadurai, India, 1969 Widely thought to be the largest funeral attendance in history, 15 million people took to the streets of Chennai in memory of the former chief minister of Tamil Nadu, a southern Indian state. He was widely respected as a writer and speaker and also extremely popular after he made Tamil the official language of the state, rejecting Hindi.",                "HINDI is not the national language of India.",                "Infact there is no national language in India. Rather we have many regional languages. The Union Of India has Hindi (devnagri script) and English as Official languages. And every state legislature has these two plus the regional language as the official language. English is a more popular language in South India than Hindi.",                "Takshila is said to be the first every university in the world; it started around 700 BC.",               "Today, India has the world’s largest school in terms of students, the City Montessori School in Lucknow. It has more than 45 thousand students!",                "India has the largest postal network in the world with over 1, 55,015 post offices. A single post office on an average serves a population of 7,175 people. The floating post office in Dal Lake, Srinagar, was inaugurated in August 2011.",                "Mawsynram, a village on the Khasi Hills, Meghalaya, receives the highest recorded average rainfall in the world. Cherrapunji, also a part of Meghalaya, holds the record for the most rainfall in the calendar year of 1861.",                "Bandra Worli Sealink has steel wires equal to the earth's circumference",                "It took a total of 2,57,00,000 man hours for completion and also weighs as much as 50,000 African elephants. A true engineering and architectural marvel.",                "The highest cricket ground in the world",                "At an altitude of 2,444 meters, the Chail Cricket Ground in Chail, Himachal Pradesh, is the highest in the world. It was built in 1893 and is a part of the Chail Military School.",               "Shampooing is an Indian concept",                "Shampoo was invented in India, not the commercial liquid ones but the method by use of herbs. The word 'shampoo' itself has been derived from the Sanskrit word  champu,  which means to massage.",               "The Indian national Kabaddi team has won all World Cups",                "India has won all 5 men's Kabaddi World Cups held till now and have been undefeated throughout these tournaments. The Indian women's team has also won all Kabaddi World Cups held till date.",               "Water on the moon was discovered by India",                "In September 2009, India's ISRO Chandrayaan- 1 using its Moon Mineralogy Mapper detected water on the moon for the first time.",                "Science day in Switzerland is dedicated to Ex-Indian President, APJ Abdul Kalam",                "The father of India's missile programme had visited Switzerland back in 2006. Upon his arrival, Switzerland declared May 26th as Science Day.",                "India's first President only took 50% of his salary",                "When Dr Rajendra Prasad was appointed the President of India, he only took 50% of his salary, claiming he did not require more than that. Towards the end of his 12-year tenure he only took 25% of his salary. The salary of the President was Rs 10,000 back then.",                "The first rocket in India was transported on a cycle",                "The first rocket was so light and small that it was transported on a bicycle to the Thumba Launching Station in Thiruvananthapuram, Kerala.",                "India is the world's second-largest English speaking country",                "India is second only to the USA when it comes to speaking English with around 125 million people speaking the language, which is only 10% of our population. This is expected to grow by quite a margin in the coming years.",                "Largest number of vegetarians in the world",                "Be it because of religious reasons or personal choices or both, around 20-40% of Indians are vegetarians, making it the largest vegetarian-friendly country in the world.",                "The world's largest producer of milk",                "India recently overtook the European Union with production reaching over 132.4m tonnes in 2014.",               "The first country to consume sugar",                "India was the first country to develop extraction and purifying techniques of sugar. Many visitors from abroad learnt the refining and cultivation of sugar from us.",                "Rabindranath Tagore also wrote the national anthem for Bangladesh",                "Rabindranath Tagore is credited not only for writing the Indian national anthem,  Jana Gana Mana,  but the Bangladeshi national anthem,  Amar Sonar Bangla,  as well. He was also offered knighthood by the British but refused the honour after the Jalianwala Bagh massacre.",                "Dhyan Chand was offered German citizenship",                "After defeating Germany 8-1 in the 1936 Berlin Olympics, Major Dhyan Chand, the wizard of hockey, was summoned by Hitler. He was promised German citizenship, a high post in the German military and the chance to play for the German national side. Dhyan Chand however declined the offer.",                "Freddie Mercury and Ben Kingsley are both of Indian descent",                "Freddie Mercury, the legendary singer of the rock band 'Queen' was born a Parsi with the name Farrokh Bulsara while the famous Oscar winning Hollywood star Ben Kingsley was born Krishna Pandit Bhanji.",                "Astronaut Rakesh Sharma said India looks  saare jahaan se achcha  from space",                "Former Prime Minister Indira Gandhi asked the first Indian in space, Rakesh Sharma, about how India looked from space. His response was our famous patriotic song, "Saare Jahaan Se Achcha."",                "Havell's is purely an Indian brand & named after its first owner",                "Though the company was bought for just 10 lakh Rupees a long time ago and is now a multi-billion electrical goods company, it's an Indian company and is still named after its original owner, Haveli Ram Gupta.",                "diamonds were first mined in India",                "Initially, diamonds were only found in the alluvial deposits in Guntur and Krishna District of the Krishna River Delta. Until diamonds were found in Brazil during the 18th century, India led the world in diamond production.",                "East or west, India is the best :)",                "Around a 100 million years ago, India was an island.",                "India’s name is derived from the “Indus” river.",                "Indus Valley Civilization is the world’s oldest civilization.",                "India, hence, is the world’s oldest, most advanced and continuous civilization.",                "India has been the largest troop contributor to the United Nations Peacekeeping Missions since its inception.",                "India has the world’s third largest active army, after China and USA.",                "Varanasi is the oldest, continuously inhabited city in the world today.",                "India has more mosques (300,000 mosques) than any other nation in the world.",                "And the third largest Muslim population in the world.",                "Takshila is said to be the first every university in the world; it started around 700 BC.",                "Today, India has the world’s largest school in terms of students, the City Montessori School in Lucknow. It has more than 45 thousand students!",                "Indian Railways employs more than 1.3 million people. That’s more than the population of many nations.",                "More than 54 crore people voted in the 2014 General Election – more people than the population of USA, UK, Australia and Japan combined.",                "Number of births in India every year is more than the total population of Australia, and many other nations.",                "India has the largest English speaking population in the world.",                "At an estimate, 25% of the total workforce of the world’s population will be from India in the next year or so.",                "India’s first rocket was brought on cycle and a satellite on bullock cart.",                "And despite budgetary constraints, India’s space program is one of the top 5 space programs in the world.",                "English Actor Sir Ben Kingsley’s birth name is Krishna Pandit Bhanji and he is of Indian descent.",            "Lonar Lake, a saltwater lake in Maharashtra, was created by a meteor hitting the Earth and is one of its kind in India.",                "Magnetic Hill is a gravity hill located near Leh in Ladakh, India. The hill is alleged to have magnetic properties strong enough to pull cars uphill and force passing aircraft to increase their altitude in order to escape magnetic interference.",                "Viswanathan Anand is the first player in chess history to have won the World Championship in three different formats: knockout, tournament, and match.",                "Chess was invented in India.",                "Buttons were invented in India. Yes, your shirt’s buttons.",                "Indians invented the ruler.",                "Indians invented the shampoo.",                "Indians invented the number zero.",                "Indians invented the value of pi.",                "Indians invented the trigonometry, algebra, calculus.",                "Indians invented the cataract surgery.",                "Indians invented the plastic surgery.",                "Indians invented the diamond mining.",                "Indians invented the water on the moon.",                "Until 1986, the only place where diamonds had been officially found was in India.",                "India has banned all captive dolphins, stating that dolphins should be viewed of non-human persons.",               "India’s tech capital, Bangalore, has increased its office supply by six times since 2006, and now has more Grade-A offices than Singapore.",                "India is the largest producer of films in the world.",                "India is the largest milk producer in the world.",                "Chail in Himachal Pradesh is the highest cricket pitch in the world. It is situated at an elevation of 2444 meters (above the sea level).",                "The India-Pakistan World Cup semi-final match in Mohali drew 150 million viewers worldwide.",                "Sachin Tendulkar is an Indian.",                "Around the 17th century, India was one of the richest countries in the world.",                "Today, India is the world’s third largest economy.",                "India is one of the only three countries that makes supercomputers (the US and Japan are the other two).",                "The world’s largest road network is in India—over 1.9 million miles of roads cover the country.",                "India has the largest amount of vegetarians in the world.",              "So much so that Pizza Hut had to open their first pure vegetarian restaurant in the country.",                "And KFC had to introduce a “vegetarian” menu for India.",                "And so did McDonalds, the world’s largest fast-food manufacturer.",                "Chai is India’s national drink.",                "India grows 1.2 million tons of mangoes every year, weight equivalent to 80,000 blue whales.",         "The state of Meghalaya is the wettest inhabited place of earth.",                "May 26 is celebrated as the Science Day in Switzerland in honour of former President Dr. APJ Abdul Kalam, because on the day, Kalam visited the country :)",                "Martial Arts was first created in India.",                "The world’s biggest family lives in India. One man, 39 wives and 94 children.",                "India is the world’s largest importer of arms.",                "But India has never invaded or attacked a country.",                "Only 3% of Indians pay income tax.",                "India’s Has floating Post office"],            "SKILL_NAME" : "British IndiaBook",            "GET_FACT_MESSAGE" : "Here's your fact: ",            "HELP_MESSAGE" : "You can say IndiaBook tell me a India 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": [                "India is very close to the heart of Jesus Christ",	                
"The book of Micah in The Holy Bible is regarded by some as for India",	                "Dr. D.G.S Dhinakaran is a humble and true servant of God from India.",                "India has the world’s third largest church in terms of members.",     	                "If you have read Bhagvad Gita, Ramayan, Mahabharata then you will realize that there is not even a single text which mentions the word "Hindu". It was a name which was given by foreigners because our land was on other side of river "Indus" and hence came the name "Hindu". But eventually, some people made it a religion. ",	            "The word Hindu is derived from the Indo-Aryan and Sanskrit, Sanskrit word Sindhu, which means "a large body of water", covering "river, ocean". It was used as the name of the Indus river and also referred to its tributaries. ",	                "Though India is a country of multiple regional and local languages but in terms of English speaking countries in the world, it ranks number 2, yes, India is second largest English speaking country in the world, 10% of Indians can speak in English which is about 125 million people.",	                "According to the Guinness Book of World Records, India ranks third behind the USA and the UK in the number of records claimed each year. ",	                "In 2011, India made the third greatest number of record applications to Guinness World Records – behind only U.S. and United Kingdom.",	               "Mahatma Gandhi is not the Father of the nation.",	                "Indians widely describe Gandhi as the father of the nation  The title "The Father of the Nation" for Gandhi is not an official title and has not been officially accorded by Government of India. An RTI query filed by a 10-year-old girl from Lucknow in February 2012 revealed that PMO has no records of ever according such title to Gandhi. MHA and National Archives of India also communicated of not having any records. Origin of this title is traced back to a radio address (on Singapore radio) on 6 Jul 1944 by Subhash Chandra Bose where Bose addressed Gandhi as "The Father of the Nation". On 28 Apr 1947, Sarojini Naidu during a conference also referred Gandhi as "Father of the Nation". The RTI applicant had also pleaded for Gandhi to be officially declared as "Father of the Nation" to which the MHA informed that Gandhi cannot be accorded with the title by Government of India since the Indian constitution does not permit any titles except educational and military titles.",          "India has an Ice Hockey team and they are even member of International Ice Hockey Federation.",    "The India national ice hockey team is the national ice hockey team of India, and a member of the International Ice Hockey Federation.",                "first mail account system Hotmail was also created by an Indian by Mr. Sabeer Bhatia",                "That it is illegal for a child in India to neglect their parents after their retirement.( Thank god it exists )",          "Right to maintenance— Maintenance is a right to livelihood when one is incapable of sustaining oneself. Right to maintenance forms a part of the personal law. Obligation of a husband to maintain his wife arises out of the status of the marriage. Hindu law, one of the most ancient systems of law, recognizes right of any dependent person including wife, children, aged parents and widowed daughter or daughter-in-law to maintenance. The Hindu Adoptions and Maintenance Act, 1956, provides for this right.",              "Kerala tops the "Highest liquor consuming State" list in India, not Punjab.",                "Kerala accounts for the country's highest consumption of alcohol followed by Maharashtra and Punjab.",                "Only 3% of Indians pay income tax, in a population of 1.2bn. One explanation for this is that agriculture is exempt and two-thirds of Indians live in rural areas. A large chunk of the economy is also informal, unorganized labor, for which it's harder to collect taxes. Many argue that some of the country's financial problems would be solved in one fell swoop, if this massive tax hole could be filled.",                "The first rocket in India was transported on a cycle.",                "The first rocket was so light and small that it was transported on a bicycle to the Thumba Launching Station in Thiruvananthapuram, Kerala.",                "India’s first floating Post office is on Dal Lake in Srinagar, the first of its kind in the country. It was inaugurated by Minister of State for Communications and IT Mr. Sachin Pilot and Chief Minister of Jammu and Kashmir Mr. Omar Abdullah on August 22'2011.",                "This innovation by India Post is the star attraction for the tourists visiting the lake. Besides offering normal services, the place will also have a philately museum and a shop that will sell postage stamps and other products. It functions from 10 am to 6 pm on all days including Sundays during the tourist season.",                "The world's biggest family: The man with 39 wives, 94 children and 33 grandchildren, India. He is head of the world's biggest family – and says he is ‘blessed’ to have his 39 wives. Ziona Chana also has 94 children, 14-daughters-in-law and 33 grandchildren. They live in a 100-room, four storey house set amidst the hills of Baktwang village in the Indian state of Mizoram, where the wives sleep in giant communal dormitories.",                "A polling station is set up in a forest for a lone voter in every election since 2004. He remains one of India's most prized voters. Mahant Bharatdas Darshandas is the lone voter in the midst of Gujarat's Gir forest, home to the Asiatic lion, for whom an entire election team sets up a polling booth every election – and will do so again on April 30.",                "Largest Funeral attended: Funeral of CN Annadurai, India, 1969 Widely thought to be the largest funeral attendance in history, 15 million people took to the streets of Chennai in memory of the former chief minister of Tamil Nadu, a southern Indian state. He was widely respected as a writer and speaker and also extremely popular after he made Tamil the official language of the state, rejecting Hindi.",                "HINDI is not the national language of India.",                "Infact there is no national language in India. Rather we have many regional languages. The Union Of India has Hindi (devnagri script) and English as Official languages. And every state legislature has these two plus the regional language as the official language. English is a more popular language in South India than Hindi.",                "Takshila is said to be the first every university in the world; it started around 700 BC.",                "Today, India has the world’s largest school in terms of students, the City Montessori School in Lucknow. It has more than 45 thousand students!",                "India has the largest postal network in the world with over 1, 55,015 post offices. A single post office on an average serves a population of 7,175 people. The floating post office in Dal Lake, Srinagar, was inaugurated in August 2011.",                "Mawsynram, a village on the Khasi Hills, Meghalaya, receives the highest recorded average rainfall in the world. Cherrapunji, also a part of Meghalaya, holds the record for the most rainfall in the calendar year of 1861.",                "Bandra Worli Sealink has steel wires equal to the earth's circumference",                "It took a total of 2,57,00,000 man hours for completion and also weighs as much as 50,000 African elephants. A true engineering and architectural marvel.",                "The highest cricket ground in the world",                "At an altitude of 2,444 meters, the Chail Cricket Ground in Chail, Himachal Pradesh, is the highest in the world. It was built in 1893 and is a part of the Chail Military School.",                "Shampooing is an Indian concept",                "Shampoo was invented in India, not the commercial liquid ones but the method by use of herbs. The word 'shampoo' itself has been derived from the Sanskrit word  champu,  which means to massage.",               "The Indian national Kabaddi team has won all World Cups",                "India has won all 5 men's Kabaddi World Cups held till now and have been undefeated throughout these tournaments. The Indian women's team has also won all Kabaddi World Cups held till date.",               "Water on the moon was discovered by India",                "In September 2009, India's ISRO Chandrayaan- 1 using its Moon Mineralogy Mapper detected water on the moon for the first time.",                "Science day in Switzerland is dedicated to Ex-Indian President, APJ Abdul Kalam",                "The father of India's missile programme had visited Switzerland back in 2006. Upon his arrival, Switzerland declared May 26th as Science Day.",                "India's first President only took 50% of his salary",                "When Dr Rajendra Prasad was appointed the President of India, he only took 50% of his salary, claiming he did not require more than that. Towards the end of his 12-year tenure he only took 25% of his salary. The salary of the President was Rs 10,000 back then.",                "The first rocket in India was transported on a cycle",                "The first rocket was so light and small that it was transported on a bicycle to the Thumba Launching Station in Thiruvananthapuram, Kerala.",                "India is the world's second-largest English speaking country",                "India is second only to the USA when it comes to speaking English with around 125 million people speaking the language, which is only 10% of our population. This is expected to grow by quite a margin in the coming years.",                "Largest number of vegetarians in the world",                "Be it because of religious reasons or personal choices or both, around 20-40% of Indians are vegetarians, making it the largest vegetarian-friendly country in the world.",                "The world's largest producer of milk",                "India recently overtook the European Union with production reaching over 132.4m tonnes in 2014.",               The first country to consume sugar",                "India was the first country to develop extraction and purifying techniques of sugar. Many visitors from abroad learnt the refining and cultivation of sugar from us.",                "Rabindranath Tagore also wrote the national anthem for Bangladesh",                "Rabindranath Tagore is credited not only for writing the Indian national anthem,  Jana Gana Mana,  but the Bangladeshi national anthem,  Amar Sonar Bangla,  as well. He was also offered knighthood by the British but refused the honour after the Jalianwala Bagh massacre.",                "Dhyan Chand was offered German citizenship",                "After defeating Germany 8-1 in the 1936 Berlin Olympics, Major Dhyan Chand, the wizard of hockey, was summoned by Hitler. He was promised German citizenship, a high post in the German military and the chance to play for the German national side. Dhyan Chand however declined the offer.",                "Freddie Mercury and Ben Kingsley are both of Indian descent",                "Freddie Mercury, the legendary singer of the rock band 'Queen' was born a Parsi with the name Farrokh Bulsara while the famous Oscar winning Hollywood star Ben Kingsley was born Krishna Pandit Bhanji.",                "Astronaut Rakesh Sharma said India looks  saare jahaan se achcha  from space",                "Former Prime Minister Indira Gandhi asked the first Indian in space, Rakesh Sharma, about how India looked from space. His response was our famous patriotic song, "Saare Jahaan Se Achcha."",                "Havell's is purely an Indian brand & named after its first owner",                "Though the company was bought for just 10 lakh Rupees a long time ago and is now a multi-billion electrical goods company, it's an Indian company and is still named after its original owner, Haveli Ram Gupta.",                "Diamonds were first mined in India",                "Initially, diamonds were only found in the alluvial deposits in Guntur and Krishna District of the Krishna River Delta. Until diamonds were found in Brazil during the 18th century, India led the world in diamond production.",                "East or west, India is the best :)",                "Around a 100 million years ago, India was an island.",                "Indias name is derived from the Indus river.",                "Indus Valley Civilization is the worlds oldest civilization.",                "India, hence, is the worlds oldest, most advanced and continuous civilization.",                "India has been the largest troop contributor to the United Nations Peacekeeping Missions since its inception.",                "India has the worlds third largest active army, after China and USA.",                "Varanasi is the oldest, continuously inhabited city in the world today.",                "India has more mosques (300,000 mosques) than any other nation in the world.",                "And the third largest Muslim population in the world.",                "Takshila is said to be the first every university in the world; it started around 700 BC.",                "Today, India has the worlds largest school in terms of students, the City Montessori School in Lucknow. It has more than 45 thousand students!",                "Indian Railways employs more than 1.3 million people. Thats more than the population of many nations.",                "More than 54 crore people voted in the 2014 General Election  more people than the population of USA, UK, Australia and Japan combined.",                "Number of births in India every year is more than the total population of Australia, and many other nations.",                "India has the largest English speaking population in the world.",                "At an estimate, 25% of the total workforce of the worlds population will be from India in the next year or so.",                "Indias first rocket was brought on cycle and a satellite on bullock cart.",                "And despite budgetary constraints, Indias space program is one of the top 5 space programs in the world.",                "English Actor Sir Ben Kingsleys birth name is Krishna Pandit Bhanji and he is of Indian descent.",            "Lonar Lake, a saltwater lake in Maharashtra, was created by a meteor hitting the Earth and is one of its kind in India.",                "Magnetic Hill is a gravity hill located near Leh in Ladakh, India. The hill is alleged to have magnetic properties strong enough to pull cars uphill and force passing aircraft to increase their altitude in order to escape magnetic interference.",                "Viswanathan Anand is the first player in chess history to have won the World Championship in three different formats: knockout, tournament, and match.",                "Chess was invented in India.",                "Buttons were invented in India. Yes, your shirts buttons.",                "Indians invented the ruler.",                "Indians invented the shampoo.",                "Indians invented the number zero.",                "Indians invented the value of pi.",                "Indians invented the trigonometry, algebra, calculus.",                "Indians invented the cataract surgery.",                "Indians invented the plastic surgery.",                "Indians invented the diamond mining.",                "Indians invented the water on the moon.",                "Until 1986, the only place where diamonds had been officially found was in India.",                "India has banned all captive dolphins, stating that dolphins should be viewed of non-human persons.",               "Indias tech capital, Bangalore, has increased its office supply by six times since 2006, and now has more Grade-A offices than Singapore.",                "India is the largest producer of films in the world.",                "India is the largest milk producer in the world.",                "Chail in Himachal Pradesh is the highest cricket pitch in the world. It is situated at an elevation of 2444 meters (above the sea level).",                "The India-Pakistan World Cup semi-final match in Mohali drew 150 million viewers worldwide.",                "Sachin Tendulkar is an Indian.",                "Around the 17th century, India was one of the richest countries in the world.",                "Today, India is the worlds third largest economy.",                "India is one of the only three countries that makes supercomputers (the US and Japan are the other two).",                "The worlds largest road network is in Indiaover 1.9 million miles of roads cover the country.",                "India has the largest amount of vegetarians in the world.",              "So much so that Pizza Hut had to open their first pure vegetarian restaurant in the country.",                "And KFC had to introduce a vegetarian menu for India.",                "And so did McDonalds, the worlds largest fast-food manufacturer.",                "Chai is Indias national drink.",                "India grows 1.2 million tons of mangoes every year, weight equivalent to 80,000 blue whales.",         "The state of Meghalaya is the wettest inhabited place of earth.",                "May 26 is celebrated as the Science Day in Switzerland in honour of former President Dr. APJ Abdul Kalam, because on the day, Kalam visited the country :)",                "Martial Arts was first created in India.",                "The worlds biggest family lives in India. One man, 39 wives and 94 children.",                "India is the worlds largest importer of arms.",                "But India has never invaded or attacked a country.",                "Only 3% of Indians pay income tax.",                "Indias Has floating Post office"];/** * The AlexaSkill prototype and helper functions */var AlexaSkill = require('./AlexaSkill');var Fact = function () {    AlexaSkill.call(this, APP_ID);};// Extend AlexaSkillFact.prototype = Object.create(AlexaSkill.prototype);Fact.prototype.constructor = Fact;Fact.prototype.eventHandlers.onSessionStarted = function (sessionStartedRequest, session) {    //console.log("onSessionStarted requestId: " + sessionStartedRequest.requestId + ", sessionId: " + session.sessionId);    // any initialization logic goes here};Fact.prototype.eventHandlers.onLaunch = function (launchRequest, session, response) {    //console.log("onLaunch requestId: " + launchRequest.requestId + ", sessionId: " + session.sessionId);    handleNewFactRequest(response);};/** * Overridden to show that a subclass can override this function to teardown session state. */Fact.prototype.eventHandlers.onSessionEnded = function (sessionEndedRequest, session) {    //console.log("onSessionEnded requestId: " + sessionEndedRequest.requestId + ", sessionId: " + session.sessionId);    // any cleanup logic goes here};Fact.prototype.intentHandlers = {    "GetNewFactIntent": function (intent, session, response) {        handleNewFactRequest(response);    },    "AMAZON.HelpIntent": function (intent, session, response) {        response.ask("You can say IndiaBook tell me a India fact, or, you can say exit... What can I help you with?", "What can I help you with?");    },    "AMAZON.StopIntent": function (intent, session, response) {        var speechOutput = "Goodbye";        response.tell(speechOutput);    },    "AMAZON.CancelIntent": function (intent, session, response) {        var speechOutput = "Goodbye";        response.tell(speechOutput);    }};/** * Gets a random new fact from the list and returns to the user. */function handleNewFactRequest(response) {    // Get a random India fact from the India FACTS list    var factIndex = Math.floor(Math.random() * INDIA_FACTS.length);    var randomFact = INDIA_FACTS[factIndex];    // Create speech output    var speechOutput = "Here's your India fact: " + randomFact;    var cardTitle = "Your India Fact";    response.tellWithCard(speechOutput, IndiaBook, speechOutput);}// Create the handler that responds to the Alexa Request.exports.handler = function (event, context) {    // Create an instance of the IndiaBook skill.    var fact = new Fact();    fact.execute(event, context);};

AlexaSkill

JavaScript
/**Jesus is Lord*//**    Copyright SAMUEL BROWNE. All Rights Reserved.    Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES ORCONDITIONSOFANYKIND,eitherexpress or implied. See the License for the specific language governing permissions and limitationsunder the License.*/'use strict';function AlexaSkill(appId) {    this._appId = appId;}AlexaSkill.speechOutputType = {    PLAIN_TEXT: 'PlainText',    SSML: 'SSML'}AlexaSkill.prototype.requestHandlers = {    LaunchRequest: function (event, context, response) {        this.eventHandlers.onLaunch.call(this, event.request, event.session, response);    },    IntentRequest: function (event, context, response) {        this.eventHandlers.onIntent.call(this, event.request, event.session, response);    },    SessionEndedRequest: function (event, context) {        this.eventHandlers.onSessionEnded(event.request, event.session);        context.succeed();    }};/** * Override any of the eventHandlers as needed */AlexaSkill.prototype.eventHandlers = {    /**     * Called when the session starts.     * Subclasses could have overriden this function to open any necessary resources.     */    onSessionStarted: function (sessionStartedRequest, session) {    },    /**     * Called when the user invokes the skill without specifying what they want.     * The subclass must override this function and provide feedback to the user.     */    onLaunch: function (launchRequest, session, response) {        throw "onLaunch should be overriden by subclass";    },    /**     * Called when the user specifies an intent.     */    onIntent: function (intentRequest, session, response) {        var intent = intentRequest.intent,            intentName = intentRequest.intent.name,            intentHandler = this.intentHandlers[intentName];        if (intentHandler) {            console.log('dispatch intent = ' + intentName);            intentHandler.call(this, intent, session, response);        } else {            throw 'Unsupported intent = ' + intentName;        }    },    /**     * Called when the user ends the session.     * Subclasses could have overriden this function to close any open resources.     */    onSessionEnded: function (sessionEndedRequest, session) {    }};/** * Subclasses should override the intentHandlers with the functions to handle specific intents. */AlexaSkill.prototype.intentHandlers = {};AlexaSkill.prototype.execute = function (event, context) {    try {        console.log("session applicationId: " + event.session.application.applicationId);        // Validate that this request originated from authorized source.        if (this._appId && event.session.application.applicationId !== this._appId) {            console.log("The applicationIds don't match : " + event.session.application.applicationId + " and "                + this._appId);            throw "Invalid applicationId";        }        if (!event.session.attributes) {            event.session.attributes = {};        }        if (event.session.new) {            this.eventHandlers.onSessionStarted(event.request, event.session);        }        // Route the request to the proper handler which may have been overriden.        var requestHandler = this.requestHandlers[event.request.type];        requestHandler.call(this, event, context, new Response(context, event.session));    } catch (e) {        console.log("Unexpected exception " + e);        context.fail(e);    }};var Response = function (context, session) {    this._context = context;    this._session = session;};function createSpeechObject(optionsParam) {    if (optionsParam && optionsParam.type === 'SSML') {        return {            type: optionsParam.type,            ssml: optionsParam.speech        };    } else {        return {            type: optionsParam.type || 'PlainText',            text: optionsParam.speech || optionsParam        }    }}Response.prototype = (function () {    var buildSpeechletResponse = function (options) {        var alexaResponse = {            outputSpeech: createSpeechObject(options.output),            shouldEndSession: options.shouldEndSession        };        if (options.reprompt) {            alexaResponse.reprompt = {                outputSpeech: createSpeechObject(options.reprompt)            };        }        if (options.cardTitle && options.cardContent) {            alexaResponse.card = {                type: "Simple",                title: options.cardTitle,                content: options.cardContent            };        }        var returnResult = {                version: '1.0',                response: alexaResponse        };        if (options.session && options.session.attributes) {            returnResult.sessionAttributes = options.session.attributes;        }        return returnResult;    };    return {        tell: function (speechOutput) {            this._context.succeed(buildSpeechletResponse({                session: this._session,                output: speechOutput,                shouldEndSession: true            }));        },        tellWithCard: function (speechOutput, cardTitle, cardContent) {            this._context.succeed(buildSpeechletResponse({                session: this._session,                output: speechOutput,                cardTitle: cardTitle,                cardContent: cardContent,                shouldEndSession: true            }));        },        ask: function (speechOutput, repromptSpeech) {            this._context.succeed(buildSpeechletResponse({                session: this._session,                output: speechOutput,                reprompt: repromptSpeech,                shouldEndSession: false            }));        },        askWithCard: function (speechOutput, repromptSpeech, cardTitle, cardContent) {            this._context.succeed(buildSpeechletResponse({                session: this._session,                output: speechOutput,                reprompt: repromptSpeech,                cardTitle: cardTitle,                cardContent: cardContent,                shouldEndSession: false            }));        }    };})();module.exports = AlexaSkill;

IntentScema

JSON
{
  "intents": [
    {
      "intent": "GetNewFactIntent"
    },
    {
      "intent": "AMAZON.HelpIntent"
    },
    {
      "intent": "AMAZON.StopIntent"
    },
    {
      "intent": "AMAZON.CancelIntent"
    }
  ]
 }

Sample Utterances

Tex
GetNewFactIntent a fact
GetNewFactIntent a INDIA fact
GetNewFactIntent tell me a fact
GetNewFactIntent tell me a INDIA fact
GetNewFactIntent give me a fact
GetNewFactIntent give me a INDIA fact
GetNewFactIntent tell me trivia
GetNewFactIntent tell me a INDIA trivia
GetNewFactIntent give me trivia
GetNewFactIntent give me a INDIA trivia
GetNewFactIntent give me some information
GetNewFactIntent give me some INDIA information
GetNewFactIntent tell me something
GetNewFactIntent give me something

Credits

SAMUEL BROWNE

SAMUEL BROWNE

2 projects • 0 followers

Comments