radiorabe / nowplaying

Songticker 🦉
https://songticker.rabe.ch/
GNU Affero General Public License v3.0
2 stars 1 forks source link

Replace XML songticker output with a JSON based format #34

Closed hairmare closed 2 years ago

hairmare commented 5 years ago

This issue tracks replacing the XML output format with a modern JSON replacement.

Currently one of the main output formats used by the nowplaying code base to deliver content to the website is an XML based format. The format looks something like follows:

<?xml version='1.0' encoding='UTF-8'?>
<ticker xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://rabe.ch/schema/ticker.xsd">
  <ticker>
    <identifier>ticker-b5231a3b-ebf5-46bc-bb7a-22674c8546a2</identifier>
    <creator>now-playing daemon v2</creator>
    <date>2019-06-22T11:30:25+02:00</date>
    <show id="d184a34e-574b-4b40-b461-c905b437e02b">
      <name>Piazza Italia</name>
      <link xlink:type="simple" xlink:href="https://www.rabe.ch" xlink:show="replace">https://www.rabe.ch</link>
      <startTime>2019-06-22T11:00:00+02:00</startTime>
      <endTime>2019-06-22T13:00:00+02:00</endTime>
    </show>
    <track id="0f6018e2-8287-472f-b3fa-da9d1ea5f7d5">
      <show ref="d184a34e-574b-4b40-b461-c905b437e02b">Piazza Italia</show>
      <artist>Radio Bern</artist>
      <title>Livestream</title>
      <startTime>2019-06-22T11:00:00+02:00</startTime>
      <endTime>2019-06-22T13:00:00+02:00</endTime>
    </track>
  </ticker>
</ticker>

At the time this was implemented XML was pretty much the most widely used format for such data interchange requirements as the format was intended to be used with XML HTTP Requests (XHR). Looking at the the web in 2019 it has become abundantly clear that the modern way to implement this would be using JSON.

Currently I think that the basic structure of the XML above reflects a sane way to represent what is needed by a frontend that wants to pull information. Given this we can implement this in JSON adhering to the same basic structure.

In the long run we should start thinking hybrid. The text parts of the ticker that are web facing could absolutely be replaced with a web frontend that supports the Hybrid Digital Radio (DAB, DRM, RadioDNS); SlideShow; User Application Spec. It we go down that route this issue is most likely obsolete.

hairmare commented 2 years ago

Replaced by #128.