Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

Update RT using http request #7

Open
recoilstv opened this issue Sep 9, 2020 · 5 comments
Open

Update RT using http request #7

recoilstv opened this issue Sep 9, 2020 · 5 comments

Comments

@recoilstv
Copy link

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

@Anthony96922
Copy link
Owner

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

@recoilstv
Copy link
Author

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 :)

@Anthony96922
Copy link
Owner

Do you want to get the data from a stream?

@recoilstv
Copy link
Author

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

@Anthony96922
Copy link
Owner

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants