npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@jliuhtonen/blu-hawaii

v1.3.1

Published

Scrobble music played on BluOS players to Last.fm

Downloads

10

Readme

blu-hawaii 🍹

blu-hawaii CI

blu-hawaii enables you to scrobble what music you are playing on your BluOS player like Bluesound Node to Last.fm. It is intended to run in the background on a server-like computer that can access the BluOS player. To use blu-hawaii you will currently need your own set of Last.fm API keys. If you don't have an API key and secret, you can create API credentials on Last.fm.

A docker image is available on Dockerhub.

Service discovery

If you do not provide ip address and port of your BluOS player, blu-hawaii will try to discover all players on the network using Lenbrook Service Discovery Protocol (LSDP) that is based on UDP broadcast. This requires that your BluOS players are reachable in the same network as the computer running blu-hawaii. For the service discovery to work, blu-hawaii needs to be able to listen for UDP broadcast traffic to port 11430, be sure to open it from your firewall if you want to use this feature.

If you cannot use service discovery, you can always find out the IP address of your BluOS player from the BluOS app. The port is usually 11000.

Configuration

blu-hawaii supports configuration with the following environment variables:

  • LOG_LEVEL output log level, see Pino documentation
  • LOG_DEST path to a logfile or stdout for, you know, standard out
  • BLUOS_IP IP address of your BluOS player (optional if not using service discovery)
  • BLUOS_PORT Port where BluOS Custom Integration API resides, this is usually 11000 (optional if not using service discovery)
  • LAST_FM_API_KEY Your Last.fm API key
  • LAST_FM_API_SECRET Your Last.fm API secret
  • SESSION_FILE_PATH Path to file where blu-hawaii should store the Last.fm session token in a file

You can also use a .env file. See configuration.ts for all the details.

Installing

You can install blu-hawaii from Dockerhub:

docker pull jliuhtonen/blu-hawaii:latest

Or with npm:

npm install -g @jliuhtonen/blu-hawaii

Running

On the first run, you need to approve the login in Last.fm UI, so blu-hawaii starts in "interactive mode" prompting you to make the approval.

Please approve the Last.fm API client at https://www.last.fm/api/auth/?api_key=xxx&token=yyy
Then type 'yes' followed by return to continue:

Copy the url provided and paste into your browser to approve. Then return to the shell session and enter 'yes', as instructed. On subsequent runs blu-hawaii can run unattended unless access is revoked from Last.fm or the session file gets removed.

So if you are running the process inside a container, for example, it is a good idea to run the container in an interactive mode on the first run.

Running in container

There is a Containerfile for building and running blu-hawaii containerized and the image is released to Dockerhub.

To run the container in a production like setting, you'd want to do something like this

podman run --replace -d --name=blu-hawaii --network=host --mount type=volume,src=blu-hawaii-home,dst=/home/blu-hawaii --mount type=volume,src=blu-hawaii-logs,dst=/var/log/blu-hawaii -e LAST_FM_API_KEY=xxx -e LAST_FM_API_SECRET=yyy docker.io/jliuhtonen/blu-hawaii:latest

or

sudo docker run -it  --network=host -v /volume1/docker/blu-hawaii:/home/blu-hawaii -v /volume1/docker/bh-logs:/var/log/blu-hawaii -e LAST_FM_API_KEY=xxx -e LAST_FM_API_SECRET=yyy docker.io/jliuhtonen/blu-hawaii:latest

Note that this uses the host network mode to be able to receive UDP broadcast traffic needed for LSDP discovery! You might want to disable service discovery and specify IP and port instead in some settings.

Releasing

To release a new version, do the following:

npm version [major|minor|patch]
git push && git push --tags
npm run release