metadata

command module
v0.0.0-...-a9bddc8 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: BSD-3-Clause Imports: 17 Imported by: 0

README

metadata

Overview

metadata is an experimental hack to mess with extracting data from the spinitron.com metadata push mechanism.

metadata listens on a TCP port (default: 52341) for connection requests for metadata push requests in XML format from spinitron.com (or, really anywhere).

metadata extracts the relevant data from the XML and writes it to a MariaDB database.

WARNING

This code employs ZERO encryption, authentication, authorization or security. Use at your own peril.

Example Spinitron Channel Configuration

See the template spec for complete details.

tcp://metadata.example.com:52341
<?xml version="1.0" encoding="utf-8" ?>
<nowplaying>
    <time>%now%</time>
    <artist>%an%</artist>
    <title>%sn%</title>
    <album>%dn%</album>
</nowplaying>

Database Schema

CREATE TABLE `m` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `time` datetime NOT NULL,
  `artist` varchar(128) DEFAULT NULL,
  `title` varchar(128) DEFAULT NULL,
  `album` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5190 DEFAULT CHARSET=utf8mb4

Documentation

Overview

handle-connections.go contains connection handlers.

metadata listens on a TCP port waiting for metadata and writes it to a MariaDB database by the same name.

process-data.go processes the metadata retrieved in handleConnection().

Jump to

Keyboard shortcuts

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