Skip to content

🎧 Bot to set your Last.fm tracks as your Slack status

License

Notifications You must be signed in to change notification settings

joshghent/lastfm-slack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Last.fm to Slack 🎶

This simple script let's you update your Slack status with the song you're currently listening to via Last.fm - for example using Spotify.

Installation

  1. Clone this repository.
git clone https://github.com/joshghent/lastfm-slack.git
  1. Run composer install.

  2. Copy .env.example to .env and configure your LASTFM_KEY key, LASTFM_USER and your SLACK_TOKEN.

  3. Run the script php statusUpdate.php

  4. Listen to some music :)

Installation via Docker

After configuring a .env file with the required parameters, run the following command. Please note: Do not wrap your environment variables in quote " tags as this will mean the program does not work!

docker run -d --restart always --name lastfm2slack --env-file .env joshghent/lastfm2slack

Obtaining the Config tokens

Please note: Please place the config options in "" quote marks.

Getting the LastFM key

  1. Go to this website here and create a new API application a. Fill in the application. Call it "Last2Slack" or something similar - it doesn't really matter
  2. On the completion screen, it will show the API Key - this is the LASTFM_KEY
  3. There will also be a "registered to" field. This is the LASTFM_USER.
  4. Record these details as you cannot currently view them again!

Getting the Slack Token

  1. Go to this page here. Although Slack does not recommend using Legacy tokens, they are still heavily used and perfectly secure
  2. Scroll down to the "Legacy token generator" area
  3. Locate the Slack workspace you are looking to get a token for, click the "Request Token" button next to it (you may be prompted for a password)
  4. The token will appear in an input field to the left of the button. Copy this and paste it in "" as the SLACK_TOKEN

Options

Slack Status Emoji

To change this, change the SLACK_EMOJI config option to a markdown emoji with the colons either side. e.g., :tada: By default the emoji is 🎵

License

Last.fm to Slack is free software distributed under the terms of the MIT license.

About

🎧 Bot to set your Last.fm tracks as your Slack status

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 92.8%
  • Shell 5.0%
  • Dockerfile 2.2%