adinan-cenci / internet-radio
用于获取internet-radio.com电台频道的库。
v2.1.0
2022-10-15 15:03 UTC
Requires
- php: >=7.0
- guzzlehttp/guzzle: ^7.4
README
一个非官方库,用于从internet-radio.com目录中检索电台。
按流派分类的电台
使用::getStationsByGenre($genre, $offset, $limit, $sortBy)
方法检索带有特定音乐流派标签的电台。
use AdinanCenci\InternetRadio\InternetRadio; $internetRadio = new InternetRadio(); $stations = $internetRadio->getStationsByGenre('metal');
它将返回如下数组
[
{
"id": "idobihowl",
"name": "idobi Howl",
"description": "metal, hardcore",
"homepage": "http://idobiradio.com/",
"playlist": "http://69.46.88.26:80/listen.pls",
"currentlyPlaying": "SYLOSIS - Fear the World",
"listeners": "2527",
"bitRate": "128"
},
{
"id": "knac.com",
"name": "KNAC.COM",
"description": "metal",
"homepage": "http://www.knac.com",
"playlist": "http://198.178.123.14:7346/listen.pls?sid=1",
"currentlyPlaying": "NAZARETH - HAIR OF THE DOG",
"listeners": "268",
"bitRate": "128"
},
{
"id": "metalexpressradio",
"name": "Metal Express Radio",
"description": "heavy metal",
"homepage": "http://www.metalexpressradio.com",
"playlist": "http://5.135.154.69:11590/listen.pls?sid=1",
"currentlyPlaying": "David T. Chastain - Burning Passion",
"listeners": "199",
"bitRate": "192"
}
...
...
...
搜索电台
使用::searchStations($query, $offset, $limit, $sortBy)
方法根据电台名称搜索电台。
流派
::getGenres()
返回用于标记电台的音乐流派数组。使用这些值通过::getStationsByGenre()
方法搜索电台。
$genres = $internetRadio->getGenres(); /* '50s', '60s', 'Acid House', 'Bass', 'Jazz', 'Metal', ... ... ... */
注意
在撰写本文时,internet-radio.com没有提供API,此库提供的信息是从官方网站抓取的,因此如果他们决定更新页面,此库可能会停止工作。
许可
MIT