Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Webmediastats support
Webmediastats/Web Radio Stats is supported.
Actions to be carried out
Log into your control panel
Go to Broadcast -> Radio -> (radio in question) -> (configuration for the stream in question).
Locate the Webmediastats/Web Radio Stats link
Copy the line (e.g. http://statslive.infomaniak.ch/mediastats.php?radio=nyancat-real.mp3&password=xxxxxx)
Create a PHP file (e.g. client.php) and into it, copy the following script
<code><?php $sUrl = "my webmediastats link"; $plaintext=""; $pass=md5("Tell me, O Muse, of the man of many devices, who wandered full many ways after he had sacked the sacred citadel of Troy. Many were the men whose cities he saw and whose mind he learned, aye, and many the woes he suffered in his heart upon the sea, seeking to win his own life and the return of his comrades. Yet even so he saved not his comrades, though he desired it sore, for through their own blind folly they perished--fools, who devoured the kine of Helios Hyperion; but he took from them the day of their returning. Of these things, goddess, daughter of Zeus, beginning where thou wilt, tell thou even unto us."); $plaintext = file_get_contents($sUrl); function EnDeCrypt($text, $password){ $sbox=array(); $key=array(); $i=0; $j=0; $cipher = ""; $intLength = strlen($password); for ($a=0;$a<=255;$a++){ $ctmp = substr($password,($a % $intLength), 1); $key[$a] = ord($ctmp); $sbox[$a] = $a; } $x = 0; for ($b = 0; $b<=255;$b++) { $x = ($x + $sbox[$b] + $key[$b])%256; $tempSwap = $sbox[$b]; $sbox[$b] = $sbox[$x]; $sbox[$x] = $tempSwap; } for ($a = 1;$a<=strlen($text);$a++) { $itmp = 0; $i = ($i + 1) % 256; $j = ($j + $sbox[$i]) % 256; $itmp = $sbox[$i]; $sbox[$i] = $sbox[$j]; $sbox[$j] = $itmp; $k = $sbox[($sbox[$i] + $sbox[$j]) % 256]; $ctmp = substr($text,($a - 1),1); $itmp = ord($ctmp); $cipherby = $itmp ^ $k; $cipher .= chr($cipherby); } return $cipher; } header("content-type:text/plain"); header("server:infomaniak-icecast"); $OutputEncryption=0; $OutputEncryption===1?$a=EnDecrypt($plaintext,$pass):$a=$plaintext; echo $a;?></code>In the first line of the script ($sUrl = ....) replace "my webmediastats link" with the copied URL
Transfer the script file to your radio's web site (which must be PHP compatible), e.g. into a "stats" folder
If your site is hosted with Infomaniak, please edit the .htaccess file in the root of your siteCheck that the script is working by calling up the URL in your browser: (e.g. http://domain.xyz/stats/client.php)
Contact Webmediastats as explained in the instructions given at http://www.webmediastats.com/. You can provide them with the URL, indicating that you are an Infomaniak customer
More information
If you have several streams, you will need several scripts.
Link to this FAQ: