PHP: Icecast Now Playing Script is Not Working

前端 未结 2 834
有刺的猬
有刺的猬 2021-01-15 19:04

I am attempting to use the Icecast Now Playing PHP script from: https://code.google.com/p/icecast-now-playing-script/

I have uploaded all the files to my web server

2条回答
  •  余生分开走
    2021-01-15 19:56

    Please note that I would strongly advice not using the "Icecast Now Playing Script"!
    tl;dr: It parses the HTML, this is horrible.

    1. The script uses regex to parse the Icecast status.xsl page, never ever should Regex be used to parse HTML, if you want to know why, read "Parsing Html The Cthulhu Way". It is very likely that it can break easily.

    2. The script parses the Icecast status.xsl page. This should never ever be done, since this page is likely to change, like it did with the latest Icecast Version 2.4. So please, please, please do not parse the HTML page!

    What to do instead?

    If this is your Icecast Server, you can easily write a custom xsl, to generate custom XML or JSON that contains the information that you need. (more info here)

    An example for this is the xml2json.xslt.

提交回复
热议问题