lanarea/splrequest 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lanarea/splrequest

Composer 安装命令:

composer require lanarea/splrequest

包简介

A clean request script for use with Station Playlist

README 文档

README

[DEPRECATED] Moved to OrigamiVision/StationPlaylist

Join the chat at https://gitter.im/LANarea/SPLRequest

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.

You can obtain the latest version from our GitHub repository or install it via Composer:

composer require lanarea/splrequest

or manually add it to composer.json:

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

Preparation

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

  • Open StationPlaylist Studio

  • Open the Options window (Ctrl+O or View > Options)

  • Enable the connection with SPL from the outside:

    • 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:

    • 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:

use LANarea\SPLRequest;

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

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

Get all available songs via the getAllSongs() method:

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

The above is equal to the following:

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

Might be subject to the "Max Search Results"-setting under the "Communications" tab.

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)
$results = $spl->search('Avril Lavigne*'); // returns an array, or false

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

Do a song request:

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

Alternatively you can add even more useful information:

$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.

Note

You'll have to implement your own request limititations, cacheing, etc.

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

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.

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 4
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2014-12-30