shazam-webhook

command module
v0.0.0-...-0639dc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2020 License: MIT Imports: 10 Imported by: 0

README

shazam-webhook

shazam-webhook

This application allows to monitor Shazam charts available at shazam.com and sending webhooks holding artist and title when new tracks are added. E.g. if you want to add Shazam charts to a Spotify playlist you can do this using this application and a 3rd party service to receive webhooks like IFTTT or Zapier.

Usage

At first you have to customize the app-config.json: Add some Shazam charts you want to monitor. Also add tracklists to receive tracks from monitored Shazam charts and define some webhooks.

Below is an example configuration. By disabling initial hooks no webhooks are triggered when tracks are added to a tracklist during the first iteration. The polling interval is set to fetch Shazam charts every 10800 seconds (= 3 hours). Two Shazam charts are defined to be monitored: Berlin (81310) and Paris (80321). A single tracklist is defined. By watching two charts the tracks of both Shazam charts will be added to the tracklist. When a track is added the defined webhook will receive artist and title as a POST request.

{
    "SendInitialHooks": false,
    "PollingInterval": 10800,
    "MonitoredShazamCharts": [
        "81310",
        "80321"
    ],
    "Tracklists": [ 
        {
            "WatchedShazamCharts": [
                "81310",
                "80321"
            ],
            "WebhookTargets": [
                {
                    "URL": "http://localhost:8080/72A4E"
                }
            ]
        }
    ]
}

You can find a list of available Shazam city IDs to be monitored at bst27/shazam.

After customizing the configuration you can build and run the application:

go build; ./shazam-webhook

TODO

This section holds some ideas:

Config file path

Allow to set path to config file via command line argument.

Config Creator

Create a command line tool to generate an app-config.json file. This file will hold the app configuration.

Tests

As always there could be more tests.

Documentation

Overview

Deliver webhook notifications when shazam.com charts are updated.

Directories

Path Synopsis
A Chartlist represents a collection of tracks at Shazam.
A Chartlist represents a collection of tracks at Shazam.
Common holds shared code.
Common holds shared code.
Config allows to define application behaviour.
Config allows to define application behaviour.
service
shazam
Shazam offers a web client to fetch details from Shazam.
Shazam offers a web client to fetch details from Shazam.
webhook
Webhook offers a web service to deliver webhooks.
Webhook offers a web service to deliver webhooks.
A Tracklist receives tracks from watched chartlists and uses webhooks to notify about added tracks.
A Tracklist receives tracks from watched chartlists and uses webhooks to notify about added tracks.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL