A web app that automatically scrobbles your SiriusXM listening activity to Last.fm. Select a station, set a timeout, and XM Scrobbler handles the rest — tracking what you listen to and submitting it to your Last.fm profile in real time.
- Last.fm OAuth authentication — secure login via Last.fm's official API
- Live station list — pulls available SiriusXM channels directly from the xmplaylist.com API
- Automatic scrobbling — polls for new tracks on a configurable interval and submits them to Last.fm
- Session persistence — scrobbling state is preserved server-side, so closing or refreshing the browser doesn't interrupt your session
- Auto-stop timer — set a timeout of 1, 2, 4, 8, or 12 hours after which scrobbling stops automatically
- Efficient polling — a single API call fetches track data for all active stations simultaneously, keeping external API usage minimal
- Backend — Node.js, Express
- Session management — express-session
- External APIs — Last.fm API, xmplaylist.com API
- Frontend — Vanilla JS, HTML, CSS
- Node.js v18+
- A Last.fm API account (free)
-
Clone the repository:
git clone https://github.com/keithbar/XMScrobbler.git cd xm-scrobbler -
Install dependencies:
npm install
-
Create a
.envfile in the project root (see Environment Variables below):cp .env.example .env
-
Start the server:
node server.js
-
Open http://localhost:3000 in your browser.
Create a .env file in the project root with the following values:
| Variable | Description |
|---|---|
LASTFM_API_KEY |
Your Last.fm API key |
LASTFM_API_SECRET |
Your Last.fm API secret |
SESSION_SECRET |
A long, random string used to sign session cookies |
BASE_URL |
URL of the app. If running locally, can be left blank |
A .env.example file is included in the repository as a reference.
root/
├── server.js # Express app, route handlers, startup logic
├── public/
│ ├── index.html # Frontend UI
│ ├── app.js # Frontend JavaScript
│ └── style.css # Styles
├── services/
│ ├── state.js # Shared activeChannels map
│ ├── lastfmService.js # Last.fm API calls (auth, scrobbling)
│ ├── pollingService.js # Background polling loop
│ └── xmplaylistService.js# xmplaylist.com API calls
├── utils/
│ ├── logger.js # Debug logging utility
│ ├── signature.js # Last.fm API signature generation
│ └── sleep.js # Promise-based sleep utility
└── tests/
└── simulateUsers.js # Configurable stress test script
This app can be run locally or deployed online using a service like Render.
Track data provided by xmplaylist.com. Scrobbling powered by the Last.fm API.