/tesla_lyrics

Simple app to read the spotify status and show some lyrics on the tesla screen

Primary LanguageJavaScript

README

Simple app to read the spotify status and show some lyrics on the tesla screen

NOTE

This app is now obsolete. Tesla's built in browser now supports using Spotify Web Lyrics directly.

How to deploy

Locally testing

  1. npm install for dependencies
  2. Setup API credentials with the various services
  3. Update the service credential in .env file. Refer to .env.example for what's needed
  4. npm start, then access localhost:8000

Docker

Suggest to mount the .env as a bind mount

Google App Engine

If deploying to AE, need some special arrangement for the env file env file in GAE

  1. Store env vars in Google Cloud’s Build Trigger
  2. Read in env vars from the Build Trigger in one of its build steps
  3. Write env vars to a local .env file
  4. Import env vars from .env to your Node.js app using dotenv package

Service account permissions

Setting up google cloud build

How? I forgot

Other necessary preparation

How to get a node/express app production ready

notes

Inspired from 小明 Player

Structure of guaqb api

API has the following params. Refer to API documentation

  • input: name
  • filter: "name" for name search, only name/id/url works
  • type: source, 163 in this case, kugou is slow
  • key/secret: api auth from guaqb.cn
  • time: get timestamp on lrc

Sample API call

Convert to Traditional Chinese

zh_cn_zh_tw package provides straightforward, mapping based translation.

Node.js

Ugh ok... let's learn node.js real quick... ... Done ish! Here

Other notes

Finding the right lyrics JS filtering response

let res = users.filter((it) => it.name.includes("oli"));

Notes: Simple filter works just fine it appears

Looks like need to learn node.js somehow and have this hosted in home server... Why? coz how else can i secure my keys and secrets... Keeping secrets in node.js

Session and Auth

Tutorial(or see passportJS doc??) PassportJS SQLite nodejs return redirect

302 redirect resp.write

caching

caching in express