/magic-status-api

My personal local API for Magic Status, a KDE Plasma Widget.

Primary LanguageRubyMIT LicenseMIT

Magic Status API

My personal local API for Magic Status.

A screenshot of a panel with two widgets, the current time and the current song playing.

Setup

git clone https://github.com/gbaptista/magic-status-api.git

cd magic-status-api

bundle

bundle exec rackup -p 5000

If you don't want logs, just add -q to the rackup command.

Endpoints

/time

{
  "messages": [
    "11:40:20",
    "11:40"
  ]
}

/music

It leverages the Media Player Remote Interfacing Specification.

{
  "messages": [
    "Rival Sons - Do Your Worst"
  ]
}

Learn more:

/music-progress

Same as /music, but with a progress bar.

{
  "messages": [
    {
      "label": {
        "text": "Carol Biazin - Inveja (Ao Vivo)"
      },
      "progress": {
        "value": 0.63
      }
    }
  ]
}

Development

git clone https://github.com/gbaptista/magic-status-api.git

cd magic-status-api

bundle

bundle exec rspec
bundle exec rubocop -a

bundle exec rackup -p 5000

If you don't want logs, just add -q to the rackup command.