How to display the Now Playing information online (part 2)

Home > Search > How-to

nohup ./ >/dev/null 2>&1
& echo $! > nohup_pid.txt
#!/bin/bash nohup ./ > nohup.log 2>&1
& echo $! > nohup_pid.txt

The second nohup script will create a nohup.log file in the directory. This file serves as a log. If our shell script is set to sleep 5, then once every 5 seconds, the nohup.log file will get a new entry. This is good for debugging. After we are done debugging, we can stop the logging by getting the process id from the nohup_pid.txt file, and using the below command.

We need to ensure the permissions of the, and shell scripts are set properly. Use these commands to set the permissions.

chmod 0755
chmod 0755
chmod 0755
chmod 0755
chmod 0755


Now Playing Script (XML & PHP or XML & XSL)
If you used the SED XML for PHP script, use the below PHP markup. If you used the SED XML for XSL script, use the below XSL markup.

PHP markup (XML for PHP)

Just copy the below PHP, and save the file as example.php.

include 'xml.php'; 
$music = new SimpleXMLElement($xmlstr); 

foreach ($music->info as $info)
  switch((string) $info['type'])
  { case 'artwork_url': echo 'Album Art: ', $info; echo '
'; break; case 'filename': echo 'Songname: ', $info; break; }

Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter in the box below so that we can be sure you are a human.