Detect and convert Spotify or Deezer links into each others
npm install
cp config.example.js config.js
# Edit the configuration
vim config.js
npm start
Create a new outgoing webhook:
- Content Type :
application/json
- Channel :
//pick your channel
- Trigger Words :
https://open.spotify.com
https://www.deezer.com
http://open.spotify.com
http://www.deezer.com
- Triggers when :
First word starts with a trigger word
- Callback URLs :
http://[your_host]:[port_set]/convert
- Ensure your Mattermost allow local insecure connections (
AllowedUntrustedInternalConnections
property)
- Copy
config.example.js
toconfig.js
- Update the config file
config.js
- Run with
npm start
- MATTERMOST_TOKEN
- MATTERMOST_USERNAME
- MATTERMOST_ICON_URL
- MATTERMOST_INTEGRATION_SPOTIFY_CLIENT_ID
- MATTERMOST_INTEGRATION_SPOTIFY_CLIENT_SECRET
- MATTERMOST_INTEGRATION_PORT
- MATTERMOST_INTEGRATION_DEBUG
You should use this variable too:
- NODE_TLS_REJECT_UNAUTHORIZED=0
- Send POST request on /convert with body
{
"token" : "TOKEN_IN_CONFIG",
"text" : "http://www.deezer.com/track/405503712"
}
{
"token" : "TOKEN_IN_CONFIG",
"text" : "https://open.spotify.com/track/3aLSrx8qhssXrh5yjB6oy9"
}
- Server will answer by json with
{
"text" : "//link converted",
"username" : "Music-bot",
"icon_url" : "https://maxcdn.icons8.com/Share/icon/Music//metal_music1600.png"
}
Mattermost will type it into the channel.