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

somascrobbler

v2.0.2

Published

Scrobble SomaFM radio stations to Last.fm

Downloads

3

Readme

SomaScrobbler

SomaScrobbler is a server that scrobbles SomaFM radio stations to Last.fm. It relies on metadata provided by an instance of SomaScrobbler API. It can handle multiple Last.fm accounts at once.

Note: If you want to scrobble SomaFM radio from your desktop computer while listening, I recommend checking the SomaPlayer Chrome extension by moneypenny. It's powered by the SomaScrobbler API.
If you want to write your own software that consumes SomaFM track data, just like the SomaPlayer extension, please check out api.somascrobbler.com .

Installation

  • Download and install Node.js or io.js. You should use a recent version.
  • Then install the somascrobbler package globally (-g) from npm. You may have to prefix the sommand with sudo depending on your setup.
npm install somascrobbler -g

Configuration

Create a config file "$HOME/.somascrobblerrc" or "/etc/somascrobblerrc", or any other location supported by the rucola module.

Here's a sample config file:

loglevel    =   info
datadir     =   ./data
trackapi    =   https://api.somascrobbler.com:443

[lastfm]
apikey      =   your_lastfm_api_key_123456789012
apisecret   =   your_lastfm_api_secret_097654321

[admin]
username    =   admin
password    =   secret

[server]
address     =   0.0.0.0
port        =   3000
uri         =   http://localhost:3000
  • loglevel (string; optional; default: info): The log level. Can be either "debug", "info", "warn", or "error".

  • datadir (string; optional; default: ./data): Path to a directory where SomaScrobbler will store account data.

  • trackapi (string; optional; default: https://api.somascrobbler.com:443): URL to the SomaScrobbler API endpoint including port.

  • lastfm.apikey (string; required): Your Last.fm API key.

  • lastfm.apisecret (string; required): Your Last.fm API secret.

  • admin.username (string; optional; default: admin): Username for the web interface.

  • admin.password (string; recommended; default: rompotaya): Password for the web interface. The default password is Vulcan for "maintenance". You should change this.

  • server.address (string; optional; default: 0.0.0.0): The IP of the interface the web server will listen on.

  • server.port (integer; optional; default: 3000): The port on which the web server will listen on.

  • server.uri (string; recommended; default: http://localhost:3000): The full public URI including port unless you're using port 80 for HTTP or 443 for HTTPS. This is used as the callback URL for Last.fm authentication.

Configuration options can also be provided through environment variables. For example, the valirable key for lastfm.apikey would be SOMASCROBBLER_LASTFM_APIKEY.

Run

somascrobbler

Or provide an alternate config file:

somascrobbler --config=path/to/theconfig

Additionally, configuration options can be overridden through command-line arguments:

somascrobbler --lastfm-apikey=your_lastfm_api_key_123456789012 ...

Visit the web interface under http://localhost:3000 (unless configured differently) and log in using the credentials provided in the config file.

Click "Add account", select a SomaFM station and click "Authenticate". After you have allowed SomaScrobbler to access your Last.fm profile it should start scrobbling as soon as there's a new track.

Docker

SomaScrobbler is also available as a Docker image. It should work with Docker 1.5 or later.

Pull the image from the registry:

docker pull maxkueng/somascrobbler:latest

SomaScrobbler stores data about your Last.fm accounts in /usr/src/app/data and provides access to it via volume which you should mount in order to create backups and such. You should not override the dataDir configuration option in this case.

To run it, provide all non-default configuration options as environment variables:

docker run -d \
  -p 3000:3000 \
  -e SOMASCROBBLER_LASTFM_APIKEY=your_lastfm_api_key_123456789012 \
  -e SOMASCROBBLER_LASTFM_APISECRET=your_lastfm_api_secret_097654321 \
  -e SOMASCROBBLER_SERVER_URI=http://localhost:3000 \
  -e SOMASCROBBLER_ADMIN_PASSWORD=topsecret \
  -v /path/to/somascrobbler/data:/usr/src/app/data \
  --restart on-failure \
  maxkueng/somascrobbler:latest

You can also mount an external config file instead of using environment variables (or use a combination of both):

docker run -d \
  -p 3000:3000 \
  -v /path/to/somascrobbler/data:/usr/src/app/data \
  -v /path/to/the/config/file:/etc/somascrobblerrc \
  --restart on-failure \
  maxkueng/somascrobbler:latest

License

MIT License

Copyright (c) 2014 Max Kueng (http://maxkueng.com/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.