Fandom

Music Player Daemon Community Wiki

Hack:mpdpl2html

525pages on
this wiki
Add New Page
Talk0 Share

mpdpl2html is a very simple shell script which creates a HTML file of your current playlist.

Feel free to improve it.


Source codeEdit

 #!/bin/sh
 #
 # mpdpl2html - MPD playlist to HTML
 # by pfish - 2010
 # Version 0.1
 # License: GPL 2
 #
 # Requirements:
 #       mpd
 #       mpc
 #       sed
 #
 
 #USER=`whoami`
 STATS=`mpc stats | sed 's/$/\<br \/\>/'`
 PLAYLIST=`mpc playlist | sed 's/$/\<br \/\>/'`
 VERSION=`mpc version`
 FILE="mpdplaylist.html"
 DATE=`date -R`
 
 echo "<!-- Generated with mpdpl2html by pfish - $DATE -->
 <html>
 <head>
 <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /> 
 <title>MPD playlist of $USER</title>
 <style type=\"text/css\">
 body {color: #ffffff; background-color: #001A57; font-size: 12px;}
 h1 {color: #f28500; margin: 0; padding: 0;}
 h2 {color: #f28500; margin: 0; padding: 0;}
 hr {color: #f28500; border: 1;}
 </style>
 </head>
 <body>
 <h1>MPD playlist of $USER</h1>
 <hr />
 <h2>Statistics:</h2>
 $VERSION
 <br /><br />
 $STATS
 <br />
 <h2>Playlist:</h2>
 $PLAYLIST
 <hr />
 <small>Generated with mpdpl2html by pfish - $DATE</small>
 </body>
 </html>" > $FILE

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.