sodface wrote: 
> The operation of sexpect is pretty confusing.  Seems like there should
> be a way to clear the buffer after a match and a way to keep spawned
> processes from spewing all over stdout but it's probably operator error.
> Oh, and I had to background the "sexpect spawn" commands or the script
> would just hang - I thought the point of the app was to background
> itself automagically?
> 
My  sexpect spawn backgrounds itself - maybe because I spawn a shell.
You should do a "wait" after the "close", otherwise sexpect will hang (I
guess this is why you kill it?)
Haven't found a way to suppress the output, so I just redirect stdout to
/dev/null

> 
> > 
Code:
--------------------
  >   > 
  > title=$(sexpect -s 9000.sock expect_out -index 0 | awk -f 
/usr/local/bin/JSON.awk - | grep -m 1 '0,"title"' | cut -f2 | cut -d '"' -f2)
  > 
--------------------
> > 
> 
But doesn't this just always process the first track in the playlist
(which isn't necessarily the one playing) ?
My script reads playlist_cur_index and then uses the playlist_loop
record at that index.

btw, if you use wget to post, you don't need netcat, the second sexpect
spawn and the matching sexpect expect/_outs - simply put the result JSON
into a variable.



SW: 'Web UI for LMS'
(http://forums.slimdevices.com/showthread.php?98186-Announce-Alternative-Web-Interface-(beta))
| 'Playlist Editor / Generator'
(http://forums.slimdevices.com/showthread.php?108199-Announce-LMS-Playlist-Editor)
| 'Music Classification'
(http://forums.slimdevices.com/showthread.php?108278-Announce-Essentia-Integration-music-classification-(moods-genres-))
| 'Similar Music'
(http://forums.slimdevices.com/showthread.php?108495-Announce-LMSmusly-play-similar-music)
| 'LMSlib2go' (https://www.nexus0.net/pub/sw/lmslib2go/)
HowTos: 'build a self-contained LMS'
(http://forums.slimdevices.com/showthread.php?99648-Howto-build-a-self-contained-LMS)
| 'Ogg Opus'
(http://forums.slimdevices.com/showthread.php?107011-Howto-play-Ogg-Opus-files)
| 'Bluetooth/ALSA'
(http://forums.slimdevices.com/showthread.php?107230-Howto-Bluetooth-streaming-to-from-LMS-(ALSA-only-no-PulseAudio))
------------------------------------------------------------------------
Roland0's Profile: http://forums.slimdevices.com/member.php?userid=56808
View this thread: http://forums.slimdevices.com/showthread.php?t=109694

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to