deezer-playing-notifications

0.1.2 • Public • Published

deezer-playing-notifications

Reverse ingeneering of deezer real-time websocket messaging api to get played tracks.

This allows to make a small lastfm-like self-hosted service.

Usage:

You will need a USERID (Deezer userId) and TOKEN (From deezer api or from your browser cache):

const Deezer = require("deezer-playing-notifications");

const xmpp = new Deezer(USERID, TOKEN).initializeXMPP();
xmpp.on("track", (trackId) => console.log("Track ID:", trackId));
xmpp.start();

API

new Deezer() requires a valid userId and token to connect.

initializeXMPP method returns an xmpp client, you may listen to any events as you normally would.

It also introduces a new event: "track" which sends the songId on track change.

Deezer also exposes the following static method:

  • getSong (async) which takes a songId and returns a deezer track

Examples

Available here:

Contributing & LTS

Contributions are welcomed, just consider this more as a POC rather than a real library, compatibility may break at any moment and I cannot garantee support.

Ideas of what could be added / updated:

  • Basic configuration (eslint/prettier etc)
  • Tests to ensure compatibility (jest preffered)
  • Rewrite in typescript
  • Support for other types of messages.

MIT @ nSimonFR

Readme

Keywords

none

Package Sidebar

Install

npm i deezer-playing-notifications

Weekly Downloads

3

Version

0.1.2

License

MIT

Unpacked Size

6.59 kB

Total Files

6

Last publish

Collaborators

  • nsimon