Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $command="/sbin/ifconfig wlan0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'";
- $localIP = exec ($command);
- ?>
- function updateTitle(data){
- $('.music').updateWithText( 'Track: ' + data.title);
- }
- // We set that when the event:trackPlaybackStarted is fired, updateText() will be executed
- var mopidy = new Mopidy({webSocketUrl: "ws://<?php echo $localIP; ?>:6680/mopidy/ws/"});
- // var mopidy = new Mopidy({webSocketUrl: "ws://localhost:6680/mopidy/ws/"});
- // var mopidy = new Mopidy();
- mopidy.on("event:trackPlaybackStarted", updateText);
- mopidy.on("event:streamTitleChanged", updateTitle);
Advertisement
Add Comment
Please, Sign In to add comment