paul- wrote: > Can't tell you how many times I wanted to use something like expect, but > never wanted the baggage of other languages. Thanks for that link.
+1. Before I read Roland's post on using sexpect (I was already disillusioned with the expect that I was using because it comes with 2mb of tcl) I was tinkering with setting the squeezelite log option in the pCP web interface to "stream=info" and then using inotifywait to monitor /var/log/pcp_squeezelite.log for modification. That actually seems to work pretty well and you can just blank the log after every event so it doesn't continually grow. So if all you want is a way to detect a change and you are getting your actual update information via the jsonrpc call or whatever, then monitoring the log probably works as well as the sexpect method, though it still has the inotifywait dependency. I might just "watch tail" the logfile instead of using inotifywait and see how that works. Sort of brute force but it's all local to the box, no extra persistent network connections and the tools are part of busybox already. I'm not really digging the jsonrpc.js stuff, mostly because I can't get it to work with just nc and curl wouldn't install when I tried it earlier, "Error on ipv6-4.14.56-pcpCore_v7.tcz", I guess I probably need to hit the pCP repo for that package?? I'm burned out for the night anyway. I wish there was an easy to parse http GET you could do with wget. Is there one? http://192.168.1.201:9000/status.html?player=b8%3A27%3Aeb%3A94%3Aae%3A63 Is fairly uncluttered but it's still 20k worth of unnecessary html. Changing the extension to .m3u gets you the playlist but you can't tell what the currently playing song is with that. Seems like using sexpect for both the monitoring and the status queries would be a good solution rather than tacking on curl too. If I can figure out how to get the cava bar font to look decent outside of tmux I think I'll ditch tmux too. Cava and the image manipulation tools are required but it would be nice to keep the other deps to a minimum. Just because. ------------------------------------------------------------------------ sodface's Profile: http://forums.slimdevices.com/member.php?userid=19057 View this thread: http://forums.slimdevices.com/showthread.php?t=109694 _______________________________________________ unix mailing list [email protected] http://lists.slimdevices.com/mailman/listinfo/unix
