{"id":23082488,"url":"https://github.com/mattweingarten/amazonecho","last_synced_at":"2025-07-18T22:02:23.233Z","repository":{"id":62553241,"uuid":"82859253","full_name":"mattweingarten/amazonecho","owner":"mattweingarten","description":"Alexaskills made simple for ruby!","archived":false,"fork":false,"pushed_at":"2017-02-26T22:38:50.000Z","size":29,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-21T10:56:55.643Z","etag":null,"topics":["alexa","alexa-skill","alexa-skills-kit","amazon","amazon-echo","ruby","ruby-gem","ruby-on-rails","rubygem","rubygems"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/amazonecho/versions/1.0.7","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mattweingarten.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-22T22:33:46.000Z","updated_at":"2017-08-17T18:45:37.000Z","dependencies_parsed_at":"2022-11-03T04:30:32.771Z","dependency_job_id":null,"html_url":"https://github.com/mattweingarten/amazonecho","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mattweingarten/amazonecho","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattweingarten%2Famazonecho","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattweingarten%2Famazonecho/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattweingarten%2Famazonecho/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattweingarten%2Famazonecho/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattweingarten","download_url":"https://codeload.github.com/mattweingarten/amazonecho/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattweingarten%2Famazonecho/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265844031,"owners_count":23837505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alexa","alexa-skill","alexa-skills-kit","amazon","amazon-echo","ruby","ruby-gem","ruby-on-rails","rubygem","rubygems"],"created_at":"2024-12-16T14:53:24.055Z","updated_at":"2025-07-18T22:02:23.145Z","avatar_url":"https://github.com/mattweingarten.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Amazon Echo Skills gem \n\n##Summary\n\nThis gem was created to make it easy for anyone to make an alexa skill using Ruby on Rails, for faster deployment.\nFocus on simplicity and fast deployment. Check out [amazons documentation](https://developer.amazon.com/documentation/menu.html) for full  understanding.\nFollow the tutorial below to use it. Enjoy!\n____\n\n\n##Tutorial\n\n###Overview \n\nThis gem handles the alexa amazon request for their server and allows the user to manipulate alexa to create new skills.\nBasically it has an AmazonEcho class on which you can all the methods below. After using the methods the server will respond\nto Amazons servers in JSON\n\n###Methods\nThe following methods are all instance methods for the class AmazonEcho\n\n\n - `alexa.question(string)`\u003cbr /\u003e\u003cbr /\u003e\n Determines alexas speech response, unlike the statement method it keeps the alexa session open.\n One can input \n [SSML](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/speech-synthesis-markup-language-ssml-reference) \n or just a normal string in this case \n\n- `alexa.statement(string)`\u003cbr /\u003e\u003cbr /\u003e\nSame as question determines alexas speech response, however ends the alexa session afterwards.\nCan input \n [SSML](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/speech-synthesis-markup-language-ssml-reference) \nand a string\n\n- `alexa.reprompt(string)`\u003cbr /\u003e\u003cbr /\u003e\nSets a reprompt speech for alexa, works only after a question speech and gets called 5 seconds after the question \nis stated and alexa has not received a voice response from the alexa user.    \nAgain can take a standard string or [SSML](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/speech-synthesis-markup-language-ssml-reference)\n\n- `alexa.card(type, args)`\u003cbr /\u003e\u003cbr /\u003e\nThe card method sets value for the card to show on the mobile app alexa. The type input is a string, either **\"Simple\"**\n**\"Standard\"** or **\"LinkedAccount\"**. The args is a hash with the following key options: **title**, **content**, **text**, **small_img** and **large_img**. \nFor more details look at the [alexa docs](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-interface-reference)\n\n\n- `alexa.session_attributes[key] = value`\nSet alexa session value like this to use the variables over multiple intents and can be used throughout a whole alexa session.\\\nMake sure to do this before you call the question method.\n______\n\n##Setup \nFirst add `gem 'amazonecho'` to your gemfile\nThen run the following rake command `$rake amazonecho`\nthis will generate an intent_controller, and the required routes(Be careful this version overwrites all the routes).\nAlso it requires an [Intent schema](https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-interaction-model-reference) and [ngrok proxy](https://ngrok.com/) to your localhost.\n\n\nAfter that you can just write methods for each Intent, so lets say we have the \"ExampleIntent\" in our Intentschema, \nwe can write a a method called example in our controller\u003cbr\u003e\n```ruby\ndef example(alexa)\n  #write your code here\nend \n```\nMake sure to pass in the instance as the first argument(the name does not matter but it will be the instance you can call all \nthe methods from above on). Make sure to add the name of your method to helper nethods as so:\n\n```ruby\nclass IntentController \u003c ApplicationController\n  skip_before_action  :verify_authenticity_token\n\n  helper_method  :example\n\n```\n\n####An example:\n\n```ruby\n def example(alexa)\n  alexa.session_attributes[:name] = \"bob\"\n  alexa.session_attributes[:number] = 1\n  alexa.question(\"hello\").card(\"Standard\", {title: \"Yooo!\", text: \"Why me?\", content: \"How you doin?\", larg_img: \"http://example_url.com\"})\nend\n```\n\n\nTo access **slot variables** passed in through voice commands to alexa, add them as arguments. Again names do not matter.\n\n```ruby\ndef example(alexa, slot1, slot2, slot3)\n  if slot1 == slot2\n    alexa.statement(\"True\")\n  else \n    alexa.statement(\"False\")\nend\n```\n**Important:** Sometimes the slots are not in the same order as your Intent schema slots because of the way amazon sends the request, doublecheck if the \nslots contain the information you want or switch the ordering.(Working on a solution)\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattweingarten%2Famazonecho","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattweingarten%2Famazonecho","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattweingarten%2Famazonecho/lists"}