Coder Social home page Coder Social logo

sanwebinfo / alexa-score Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 144 KB

Get live Cricket Score Update by reloading the web page using Websocket and Alexa.

License: MIT License

JavaScript 54.83% EJS 11.47% CSS 13.03% Shell 10.74% TypeScript 9.93%
alexa bulma cricket cricket-api cricket-score css express expressserver html javascript nodejs trigger websocket websocket-server alexa-trigger tasker autovoice

alexa-score's Introduction

Alexa Cricket Score

connect-test

A Simple Static Site With WebSocket for Getting Real-time Live Cricket Score Updates.

Get live Cricket Score Update by reloading the web page using Websocket and Alexa.

Usage and Concept

  • Cricket API: https://github.com/sanwebinfo/cricket-api
  • Express JS for API and WebSocket Connection
  • EJS Template Engine
  • Use WebSocket to trigger the static page Refresh in real time
  • Using Tasker and Alexa to trigger a WebSocket server to send a message to the client
  • Token-based API - JWT token and Custom Header Key-based Authorization
  • Create JWT Token for Authorize to Pass messages to the Clients (it will be expired in 5mins - Due to security reasons using short-lived JWT tokens)
curl --request GET   --url http://localhost:6007/api/token   --header 'x-api-key: YOUR_TOKEN_HERE
## Use this at API Clients (it only accept the Request if the message contain 'reload')

curl --request POST   --url http://localhost:6007/api/message   --header 'authorization: YOUR_JWT_TOKEN_HERE'   --header 'content-type: application/json'   --data '{"message": "reload"}'
  • Alexa Voice command API
## It supports and accepts any voice commmand message with 500 Text limit
## If you passing the voice command 'reload' then it will reload the score data
## Rest voice commanding words will display as alert on the client page

curl -X POST -H "Content-Type: application/json" -H 'authorization: YOUR_JWT_TOKEN_HERE' -d '{"alexamessage": "HI from Alexa"}' http://localhost:6007/api/alexa
  • Cricket API URL
http://localhost:6007/api/score?id=123456
  • Example env
API=https://cricket.example.com/score?id=
XAPIKEY=YOUR_TOKEN_HERE
JWTKEY=your_secret_key
USERID=123456
USERNAME=exampleuser
  • Home page: /view/home.hbs for displaying the Live Cricket Score
  • Bash script to send message to the clients
#.env example
API_URL=https://example.com/api
API_KEY=YOUR_AUTH_KEY


chmod a+x send.sh
./send.sh
site.mp4

Much Needed Apps

  • Alexa Echo device or Alexa on Mobile App
  • Tasker for send HTTP request and access alexa voice command
  • Autovoice to listen the voice command from alexa alexa ask autovoice to write reload

LICENSE

MIT

alexa-score's People

Contributors

mskian avatar renovate[bot] avatar

Stargazers

 avatar

Watchers

 avatar

alexa-score's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/test.yml
  • actions/checkout v4.1.7
  • actions/setup-node v4.0.3
npm
package.json
  • axios ^1.7.4
  • dotenv ^16.4.5
  • ejs ^3.1.10
  • express ^4.19.2
  • express-validator ^7.2.0
  • jsonwebtoken ^9.0.2
  • ws ^8.18.0
  • mocha ^10.7.3
  • nodemon ^3.1.4
  • supertest ^7.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.