My Spotify account is used by my kids on a regular basis now and not all of them are old enough to read. A few lines of script later, and Spotify is accessible to all of them (which seems to already cause healthy fights, but let's stay focused...).
I used Mir:ror in a previous Instructable: it is a RFID reader that used to need a web service from a now dead company (Violet).
Said RFID reader can be accessed locally by simple scripts (including osascript).
What you will need for this project:
- a Mir:ror from violet (about 10 / 15 euros on ebay / in a garage sale these days)
- compatible RFID cards (any ISO14443A card, ebay is your friend)
- a Mac running OSX (mine is running 10.6.8). [minimum Intel-mac, running 10.5]
Step 1: OSX
Hidtest is a program that opens the device and reads from it. It is a modified example of the hidapi package. Details in step 4.
Copy the attached hidtest and spotify_osx.sh files into your home directory.
Then, in a terminal:
bash-3.2$ chmod 777 spotify_osx.sh
bash-3.2$ chmod 777 hidtest
start the script in a terminal
Step 2: Configuration / Usage
Basic commands (learn, lock, playpause, volUp, volDown) are stored in the script itself. You need to update tag ids with your own.
## RFID tags
cat > $tmp2 << EOF
- lock/unlock the device using the lock card.
- playpause, volUp and volDown just do what they say.
- learn: with this card on the reader, the script will pair the next card with the current song. If the current song is paused, then the current location is also stored.