2017 © Pedro Peláez
 

library splrequest

A clean request script for use with Station Playlist

image

lanarea/splrequest

A clean request script for use with Station Playlist

  • Sunday, April 15, 2018
  • by xewl
  • Repository
  • 3 Watchers
  • 3 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

SPLRequest

[DEPRECATED] Moved to OrigamiVision/StationPlaylist, (*1)

Join the chat at https://gitter.im/LANarea/SPLRequest, (*2)

SPLRequest is a very small PHP library which makes it able to connect with StationPlaylist Studio, loading all available songs in the library and even do live song requests to the server., (*3)

You can obtain the latest version from our GitHub repository or install it via Composer:, (*4)

composer require lanarea/splrequest

or manually add it to composer.json:, (*5)

{
    "require": {
        "lanarea/splrequest": "dev-master"
    }
}

Preparation

Some (local) settings need to be applied before you can use this script:, (*6)

  • Open StationPlaylist Studio
  • Open the Options window (Ctrl+O or View > Options), (*7)

  • Enable the connection with SPL from the outside:, (*8)

    • On the left, select the tab named "Communications"
    • Set the port for TCP connections to StationPlaylist Studio
    • You don't need to set the "Send Response" value, as far as I know
    • Optionally, but preferably, set an IP Restriction (to the same IP as where the script is running)
    • Possibly: Forward the previously mentioned port so it's reachable from your public IP. This option can be found in your Router's settings or via your ISP
  • Set which directories to make public:, (*9)

    • On the left, select the tab named "Folder Locations"
    • The input box next to the "Search Folders" label contains the folders where this script can cruise through
    • Don't forget to enable the checkbox for "Include subfolders"

Usage

Autoload or include the class, and enable the namespace to make use of the class:, (*10)

use LANarea\SPLRequest;

Make a new SPLRequest object and include the IP-address/Hostname, and the TCP port:, (*11)

$spl = new SPLRequest('0.0.0.0', 0);

Get all available songs via the getAllSongs() method:, (*12)

$results = $spl->getAllSongs(); // returns an array of all songs

The above is equal to the following:, (*13)

$results = $spl->search('*');

Might be subject to the "Max Search Results"-setting under the "Communications" tab., (*14)


Searching for a song: - Use * as a wildcard operator (eg. "Avril" for all songs starting with 'Avril') - Use | as an end to the query (eg. "A|" for a list of all songs starting with an A), (*15)

$results = $spl->search('Avril Lavigne*'); // returns an array, or false

Tip: Surround all your queries with the wildcard operator, eg. "*Elvis*", (*16)


Do a song request:, (*17)

$spl->doRequest('C:/path/to/music - file.mp3'); // returns true or false

Alternatively you can add even more useful information:, (*18)

$spl->doRequest('C:/path/to/music - file.mp3', 'John Doe', 'Brussels, Belgium');

Check out the example.php file for free por.. uh, examples of course., (*19)

Note

You'll have to implement your own request limititations, cacheing, etc., (*20)

With this package, you can only handle the data we can get to and from SPL., (*21)

Known issues

  • ~~Special signs like é,ä,û; are rendered as questionmarks. Probably something with the encoding.~~ [UTF-8 output since 5.20]

License

It is licensed under the New BSD License., (*22)

The Versions

15/04 2018

dev-master

9999999-dev https://github.com/LANarea/SPLRequest

A clean request script for use with Station Playlist

  Sources   Download

BSD-3-Clause

request playlist station

15/04 2018

dev-analysis-8w295W

dev-analysis-8w295W https://github.com/LANarea/SPLRequest

A clean request script for use with Station Playlist

  Sources   Download

BSD-3-Clause

request playlist station

02/01 2015

dev-dev

dev-dev https://github.com/LANarea/SPLRequest

A clean request script for use with Station Playlist

  Sources   Download

BSD-3-Clause

request playlist station