Skip to content

Instantly share code, notes, and snippets.

@pschild
pschild / Postman Requests.txt
Last active May 19, 2019 11:03
Alexa Proactive Events API
1) POST to https://api.amazon.com/auth/o2/token
body {
grant_type: client_credentials,
client_id: amzn1.application...,
client_secret: ...,
scope: alexa::proactive_events
}
Response:
{
@pschild
pschild / IntentHandler.ts
Created November 23, 2018 14:41
alexa-button-input-handler
import * as alexa from 'alexa-app';
export default (request: alexa.request, response: alexa.response): Promise<alexa.response> => {
const r = response
.directive({
type: 'GameEngine.StartInputHandler',
timeout: 10000,
proxies: ['left'],
recognizers: {
all_pressed: {
& "C:\Program Files\ImageMagick-7.0.8-Q16\magick.exe" convert imgage.jpg +repage out.mpc
copy out.cache => in.cache
copy out.mpc => in.mpc
make backgroundcolor transparent and the rest red
& "C:\Program Files\ImageMagick-7.0.8-Q16\magick.exe" convert in.mpc -fuzz 6% -fill none -bordercolor white -border 1x1 -draw "alpha 0,0 floodfill" -shave 1x1 out1.mpc
remove the background and replace the remaining image with red
& "C:\Program Files\ImageMagick-7.0.8-Q16\magick.exe" convert out1.mpc -fuzz 6% -fill red +opaque none -background black -alpha background TMP2.mpc