mpxgen icon indicating copy to clipboard operation
mpxgen copied to clipboard

Update RT using http request

Open recoilstv opened this issue 4 years ago • 5 comments

Hi, Anthony! Can I update RT using data received via an http request?

recoilstv avatar Sep 09 '20 11:09 recoilstv

Use wget to get the RT then write it to the FIFO control pipe.

Anthony96922 avatar Sep 10 '20 01:09 Anthony96922

Use wget to get the RT then write it to the FIFO control pipe.

The problem is that I do not know how to write an update script for FIFO :)

recoilstv avatar Mar 02 '21 12:03 recoilstv

Do you want to get the data from a stream?

Anthony96922 avatar Mar 04 '21 23:03 Anthony96922

No, there is no data in my stream. I want to take track names from a file

recoilstv avatar Mar 05 '21 09:03 recoilstv

If the RT is written to a file, your script could look like this:

oldRt = ""
newRt = ""

while(true) {
  newRt = getFileContents(filename)
  if (newRt != oldRt) { // update only if RT has changed
    write(rds-control, "RT " newRt)
    oldRt = newRt
  }
  sleep(5)
}

I like to know what you're using so I could help you write a script.

Anthony96922 avatar Mar 06 '21 03:03 Anthony96922