Post content of local text file when the content changes

Similar to the AutoDJ function I’ve read about… I’m wondering if I can make Nightbot post the content of a local text file when its content changes. The content of the text file is an url and is changed by a VLC plugin when media changes. So basically when the media changes, I would like Nightbot to post that url.

Hey @ExoFury!

You can’t natively, but I’m sure an API could do it, but you need to write it yourself, we don’t help with that however.

1 Like

Could you please confirm if its 100% possible through an API? I don’t think I could personally do it but if its 100% doable I might commission someone to look into it but would kinda need to be certain it can be done :smiley:

I can’t confirm it at 100%, I don’t know how VLC or the plugin you use works, but I’m thinking writing a program to update an API on the web depending of the state of another program should be able to do it. I don’t even know for sure if VLC has an API, I suspect it does because of the nature of the software, but I haven’t looked into it.
If you choose to commission someone, they have to know how VLC works, as in the code, and how the plugin you use does too, or be able to understand it, it’s definitely not an easy task that anyone can do, and I suspect it’ll cost you way more than what you assume.
I wouldn’t even consider commissionning someone for this just knowing the skills it requires and what the prices are for such craft. Besides, after that there’ll be monthly costs to run the API. And how will you fix it when it’ll break? Because it will at some point, it’s guaranteed. There’s more to consider than just making the API and it’s good forever, maintenance costs are to be estimated as well.
In my opinion it’s only worth it if you get your hands dirty, otherwise I would look for another solution.

Well… I don’t think I actually need any interaction with VLC. The VLC plugin I use just writes a .txt file on my local drive. Is that file that I need Nightbot to read, just as I would edit the .txt file myself manually. I also have an option in my OBS to export that same value which VLC puts in the .txt file in a JSON on a localhost port. I actually have a html browser source widget getting data via javascript from that JSON. But this specific value I need it in the chat and not on that widget as its an URL :smiley:
So basically:

  1. I need Nightbot to read .txt file / JSON on http://localhost:portnumber and get data[‘url’]
  2. I need it to print that value to chat
  3. I need it to check file/JSON every few seconds
  4. If value has changed I need it to print the new value in chat

It was mostly about points 3 and 4 I was unsure if its possible, also that is has to be all automatically, with no command given manually and if it can read local .txt file or http://localhost :laughing:

I see, a small program should be able to do it then, even without the local server.
For Nightbot to send an update message to chat once the content of the file changed, there’s an API.

1 Like

For Nightbot to send an update message to chat once the content of the file changed, there’s an API.

Been through it but did not notice it :smiley: But then, my knowledge on the matter is limited so I will give it further study. Thank you very much for clarifying things! :pray:

1 Like

Of course, that’s what we’re here for! And good luck in your adventure!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.