Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Alexaでお金を稼ごうとしてみた / alexa-salon-2018-10

Alexaでお金を稼ごうとしてみた / alexa-salon-2018-10

Alexa Salon SP @東京〜秋のNLT(Not LT)大会〜

75486cbfd37125f121cf4a6c5614601c?s=128

Hidetaka Okamoto

November 15, 2018
Tweet

Transcript

  1. A l e x a Ͱ ͓ ۚ Λ Ք

    ͝ ͏ ͱ ͯ͠ Έ ͨ A l e x a S a l o n S P @ ౦ ژ ʙ ळ ͷ N LT ʢ N o t LT ʣ େ ձ ʙ
  2. H i d e t a k a O k

    a m o t o • Digitalcube Co. Ltd. • Alexa Campions • AWS Samurai 2017 in Japan
  3. None
  4. None
  5. None
  6. None
  7. h t t p s : / / b i

    t . l y / 2 B 4 B p n D
  8. · ͱ Ί A g e n d a •

    AlexaεΩϧ࣮ͬͯ͸Ք͛ΔʢՔ͛Δͱ͸͍͍ͬͯͳ͍ʣ • εΩϧͰ͓ۚΛಘΔํ๏ • Getting Started In Skill Purchase Skill
  9. A g e n d a • AlexaεΩϧ࣮ͬͯ͸Ք͛ΔʢՔ͛Δͱ͸͍͍ͬͯͳ͍ʣ • εΩϧͰ͓ۚΛಘΔํ๏

    • Getting Started In Skill Purchase Skill
  10. εΩϧ ։ ൃ ͬͯ ҙ ֎ ͱ ग़ අ ͕

    ͔ ͞ Ή • DynamoDB్͔ͭͬͯத཭୤ͯ͠΋࠶։Ͱ͖ΔΑ͏ʹ͠Α͏ʂ • ݕࡧͷਫ਼౓্͍͔͛ͨΒAmazon Elasticsearch Service͍ΕͯΈͨ • ʢ։ൃͯ͠Δ࣌ؒʹଞͷ͜ͱͨ͠ΒΞϑΟϦΤΠτ͍͚ͨͷͰ͸ʣ
  11. A W S ͷ ແ ྉ ར ༻ ࿮ Λ

    ೺ Ѳ ͯ͠ ͓ ͜͏ h t t p s : / / a w s . a m a z o n . c o m / j p / f re e /
  12. A W S ͷ ແ ྉ ར ༻ ࿮ Λ

    ೺ Ѳ ͯ͠ ͓ ͜͏ h t t p s : / / a w s . a m a z o n . c o m / j p / f re e /
  13. Vo i c e A p p s ͸ ແ

    ྉ ͔ Β ࢖ ͑Δ h t t p s : / / v o i c e a p p s . c o m
  14. S t o r y l i n e -

    > I n v o c a b l e h t t p s : / / w w w. i n v o c a b l e . c o m /
  15. – Va s i l i S h y n

    k a re n k a “We admire all the time, efforts and creativity that you’ve put into your Alexa skills. Your live skills will be functional forever. If you want to continue editing them, you’ll have to move them off the platform because our product for professionals will be different.”
  16. ແ ྉ α ʔ Ϗ ε Λ ݡ ͘ ࢖

    ͬͯ A l e x a εΩϧ Λ ࡞ Ζ ͏ ʂ
  17. None
  18. A g e n d a • AlexaεΩϧ࣮ͬͯ͸Ք͛ΔʢՔ͛Δͱ͸͍͍ͬͯͳ͍ʣ • εΩϧͰ͓ۚΛಘΔํ๏

    • Getting Started In Skill Purchase Skill
  19. εΩϧ Ͱ ͓ ۚ Λ ಘ Δ ํ ๏ •

    AWSͷΫʔϙϯΛ֫ಘ͢Δ • AlexaͷϓϩάϥϜͰ৆ۚΛ֫ಘ͢Δ • ࣗࣾαʔϏεͱ࿈ܞͤ͞Δ • ͦ͏ͩɺΞϓϦ՝ۚ΍Ζ͏
  20. εΩϧ Ͱ ͓ ۚ Λ ಘ Δ ํ ๏ •

    AWSͷΫʔϙϯΛ֫ಘ͢Δ • AlexaͷϓϩάϥϜͰ৆ۚΛ֫ಘ͢Δ • ࣗࣾαʔϏεͱ࿈ܞͤ͞Δ • ͦ͏ͩɺΞϓϦ՝ۚ΍Ζ͏
  21. A l e x a A W S ϓ ϩ

    Ϟ ʔ γ ϣ ϯ Ϋ Ϩ δ ο τ h t t p s : / / d e v e l o p e r. a m a z o n . c o m / j a / a l e x a - s k i l l s - k i t / a l e x a - a w s - c re d i t s
  22. E C 2 ΍ S 3 ΋ Ϋ ʔϙ ϯ

    ର ৅ h t t p s : / / d e v e l o p e r. a m a z o n . c o m / j a / a l e x a - s k i l l s - k i t / a l e x a - a w s - c re d i t s
  23. $ 1 0 0 Φʔόʔ͢ Δ ͱͦ ͷ ݄ ݶ

    ఆ ͷ ͓ ୅ Γ ΋
  24. εΩϧ Ͱ ͓ ۚ Λ ಘ Δ ํ ๏ •

    AWSͷΫʔϙϯΛ֫ಘ͢Δ • AlexaͷϓϩάϥϜͰ৆ۚΛ֫ಘ͢Δ • ࣗࣾαʔϏεͱ࿈ܞͤ͞Δ • ͦ͏ͩɺΞϓϦ՝ۚ΍Ζ͏
  25. Ϣʔ βʔΤ ϯ ήʔ δϝ ϯ τ ͷ ߴ ͍

    εΩϧ ʹ Ϧ ϫ ʔ υ h t t p s : / / d e v e l o p e r. a m a z o n . c o m / j a / a l e x a - s k i l l s - k i t / re w a rd s
  26. ର ৅ ͸ ̔ Χ ς ΰ Ϧ • ڭҭɾϨϑΝϨϯε

    • ϑʔυɾυϦϯΫ • ήʔϜɾτϦϏΞɾΞΫηαϦ • ϔϧεɾϑΟοτωε • ࢠͲ΋޲͚ • ϥΠϑελΠϧ • ԻָɾΦʔσΟΦ • ࢓ࣄޮ཰Խ
  27. εΩϧ Ͱ ͓ ۚ Λ ಘ Δ ํ ๏ •

    AWSͷΫʔϙϯΛ֫ಘ͢Δ • AlexaͷϓϩάϥϜͰ৆ۚΛ֫ಘ͢Δ • ࣗࣾαʔϏεͱ࿈ܞͤ͞Δ • ͦ͏ͩɺΞϓϦ՝ۚ΍Ζ͏
  28. ͨ ͱ ͑ ͹ A m a z o n

    P a y h t t p s : / / d e v e l o p e r. a m a z o n . c o m / j a / a l e x a - s k i l l s - k i t / m a k e - m o n e y / a m a z o n - p a y
  29. Ξ Χ ΢ ϯ τ Ϧ ϯ Ϋ Ͱ ࣗ

    ࣾ α ʔ Ϗ ε ͱ ͭ ͳ ͍Ͱ ՝ ۚ • ࣗࣾαʔϏεͷΞΧ΢ϯτͱAlexaΛϦϯΫ • ࣗࣾαʔϏεଆͷܾࡁγεςϜΛAlexa -> Lambdaܦ༝Ͱίʔϧ͢Δ • ࣗࣾαʔϏεͷར༻ऀ޲͚ݶఆʹ͸ͳΔ͕ɺλονΛ૿΍ͤΔ
  30. εΩϧ Ͱ ͓ ۚ Λ ಘ Δ ํ ๏ •

    AWSͷΫʔϙϯΛ֫ಘ͢Δ • AlexaͷϓϩάϥϜͰ৆ۚΛ֫ಘ͢Δ • ࣗࣾαʔϏεͱ࿈ܞͤ͞Δ • ͦ͏ͩɺΞϓϦ՝ۚ΍Ζ͏
  31. U S / E U ޲ ͚ ͳ Β ՝

    ۚ εΩϧ ͕ ग़ ͤΔ h t t p s : / / w w w. a m a z o n . c o m / H i d e t a k a - O k a m o t o - To d a y - K a n j i / d p / B 0 7 J 5 P B Q N G
  32. Ξ ϓ Ϧ ʢ εΩϧ ʣ ಺ ՝ ۚ ͷ

    छ ྨ • Entitlementɿങ੾Γɻ1౓ߪೖͨ͠Βͣͬͱ༗ޮ • Subscriptionɿఆֹ՝ۚɻΩϟϯηϧ͢Δ·Ͱͣͬͱ՝ۚ • Consumableɿ౎౓ߪೖɻ
  33. I n - S k i l l P u

    rc h a s i n g O v e r v i e w h t t p s : / / d e v e l o p e r. a m a z o n . c o m / j a / d o c s / i n - s k i l l - p u rc h a s e / i s p - o v e r v i e w. h t m l
  34. A g e n d a • AlexaεΩϧ࣮ͬͯ͸Ք͛ΔʢՔ͛Δͱ͸͍͍ͬͯͳ͍ʣ • εΩϧͰ͓ۚΛಘΔํ๏

    • Getting Started In Skill Purchase Skill
  35. η ο τΞ ο ϓ ͸ A S K C

    L I ͔ Β ͷ Έ # Πϯετʔϧ
 $ ask new -n isp-test # ఆٛϑΝΠϧͷ࡞੒ $ ask add isp --help Usage: ask-add-isp $ ask add isp [-i|--isp-id <isp-id>] [-f|--file <file-path>] [--isp-name <name>]
  36. ର ࿩ ܗ ࣜ Ͱ ঎ ඼ ఆ ٛ ϑ

    Ν Πϧ ͷ ॳ ظ ઃ ఆ $ ask add isp --isp-name my-example-product # Ͳͷ঎඼λΠϓʹ͢Δ͔ʁ ? List of in-skill product types you can choose (Use arrow keys) › Entitlement Subscription # ςϯϓϨʔτΛͳʹʹ͢Δ͔ʁ ? List of in-skill product templates you can choose (Use arrow keys) › Entitlement_Template In-skill product my-example-product is saved to ./isps/entitlement/my-example-product.json
  37. ঎ ඼ ໊ ΍ આ ໌ จ ɾ Ձ ֨

    Λ J S O N Ͱ ఆ ٛ h t t p s : / / w w w. a m a z o n . c o m / H i d e t a k a - O k a m o t o - To d a y - K a n j i / d p / B 0 7 J 5 P B Q N G
  38. ৄ ࡉ ͸ A l e x a ϒϩ ά

    ʢ ӳ ޠ ʣ Λ h t t p s : / / a m z n . t o / 2 P m W v 9 i
  39. ৽ ͠ ͘ ௥ Ճ ͕ ඞ ཁ ͳ Π

    ϯ ςϯ τ • ߪೖ • ঎඼ৄࡉͷ֬ೝ • Ωϟϯηϧ • -> ϏϧτΠϯΠϯςϯτ͸ͳ͍ͷͰ஫ҙ
  40. Π ϯ ς ϯ τ ͷ Πϝʔ δ

  41. g e t M o n e t i z

    a t i o n S e r v i c e C l i e n t ( ) & a d d D i re c t i v e ( )
  42. n a m e ʹ ΞΫ γ ϣ ϯ ʢ

    B u y / C a n c e l ʣ return handlerInput.responseBuilder .addDirective({ 'type': 'Connections.SendRequest', 'name': 'Buy', 'payload': { 'InSkillProduct': { 'productId': productId } }, 'token': 'correlationToken' }) .getResponse()
  43. I S P ܥ ॲ ཧ ࣮ ૷ ͷ ϙΠ

    ϯ τ • addDirectiveʹΞΫγϣϯ໊ɾ঎඼IDΛೖΕΔ • ঎඼৘ใͷऔಘ͸getMonetizationServiceClient()Λར༻ • productIdΛऔಘͯ͠addDirectiveʹ٧ΊࠐΉ • type͸`Connections.SendRequest’`
  44. I S P ܥ ॲ ཧ ࣮ ૷ ͷ ϙΠ

    ϯ τ - ̎ • type͸`Connections.SendRequest’` • ࣮ߦ݁Ռ͸ .request.typeʹ’Connections.Response’Ͱϋϯυϧ • ’Connections.Response’ + request.name Λर͏ϋϯυϥʔΛ࣮૷͢Δ • request.status.codeʹHTTPίʔυ • request.payload.purchaseResult͕’ACCEPTED’ͳΒ੒ޭ
  45. I S P ܥ ॲ ཧ ࣮ ૷ ͷ ϙΠ

    ϯ τ - ̏ • ’Connections.Response’ + request.name Λर͏ϋϯυϥʔΛ࣮૷ • ͜ͷϋϯυϥʔͷॲཧͰ͸ɺηογϣϯ͕৽͘͠ͳΔ • ߪೖલͷΞΫγϣϯΛه࿥͢Δ৔߹͸DynamoDB / S3Ͱอଘ͢Δ • AWS-SDK׬શʹཧղͯ͠ΔͳΒɺTTLͰҰ࣌อଘͰ΋ྑͦ͞͏
  46. n p m i - S a s k -

    u t i l s h t t p s : / / a s k - u t i l s . g i t h u b . i o / a s k - u t i l s /
  47. https://github.com/alexa

  48. · ͱ Ί • AWSΫʔϙϯɾϦϫʔυͳͲͷࢧԉPJ͸͍Ζ͍Ζ͋Δ • εΩϧ՝ۚʢISPʣ͸US / EUͷΈ2018/11࣌఺ •

    ϋϯυϥʔͱΠϯςϯτΛ̐ʙ̒ͭ௥Ճ͢Δඞཁ͕͋Γཁ஫ҙ • Connections.SendRequestͰηογϣϯ͕੾ΕΔͷʹཁ஫ҙ • αϯϓϧεΩϧ΋͋ΔͷͰɺΈΜͳͰUSD / GBPՔ͝͏ͥʂ • ʢརӹ͕ͰΔͱ͸ݴ͍ͬͯͳ͍ʣ
  49. None
  50. h t t p s : / / b i

    t . l y / 2 B 4 B p n D