1.1.1 • Published 5 years ago

xon-radio-next-song v1.1.1

Weekly downloads
-
License
GPL-3.0
Repository
-
Last release
5 years ago

xon-radio-next-song

Creates HTTP server that returns random line from a file

Installation

yarn global add xon-radio-next-song
# or
npm install -g xon-radio-next-song

Usage

Options

--file     path to a file to read lines from                        [required]
--port     port to listen on                                   [default: 8080]
--host     host to listen on                            [default: "127.0.0.1"]
--help     Show help                                                 [boolean]
--version  Show version number                                       [boolean]

Example

  1. Start HTTP server:

    $ xon-radio-next-song --file=$HOME/songs.txt
    File read from /home/user/songs.txt (516 lines)
    Listening on http://127.0.0.1:8080/
  2. Get next song:

    $ curl 'http://127.0.0.1:8080/'
    http://jeffs.eu/radio/radio-royalty-free-c4734876-56c3-11e8-b837-94de80b1da5c.pk3   c4734876-56c3-11e8-b837-94de80b1da5c.ogg 287.19 ccMixter - Not So Happy Holidays   (Stefan Kartenberg Mix) - http://www.jamendo.com

Enable radio in Xonotic

  1. You need to be running an Jeff's mods or SMB Modpack.

  2. Add this to your server config:

    // Radio
    set sv_radio 1
    set sv_radio_queue_autofill 1
    set sv_radio_queue_autofill_server "http://localhost:8080"

Use as systemd service

  1. Create new file /etc/systemd/system/xonotic-radio.sertice:

    [Unit]
    Description=Xonotic Radio Service
    After=network.target
    
    [Service]
    Type=simple
    Restart=always
    User=user
    WorkingDirectory=/home/user
    ExecStart=/usr/bin/xon-radio-next-song --file=/home/user/songs.txt
    
    [Install]
    WantedBy=multi-user.target
  2. Reload services:

    $ systemctl daemon-reload
  3. Enable service:

    $ systemd enable xonotic-radio.sertice
  4. Start service:

    $ systemd start xonotic-radio.sertice
1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago