-1

I'm pretty new to html, css, etc, and I need help with something.

I stream on twitch, and i typically have music playing in the background. Currently, I just have scrolling text that shows what song is currently playing, from a txt file that updates the second the song changes.

I was curious if there is a way to get css or html to read that file, and update text as the file updates the text.

Also, is it possible to trigger an animation when the txt file updates with html or css?

Thanks!

1 Answers1

0

You could use javascript to read the text file. Depending on where the html page is you will need to either use an http request or a file reader object to read the text in the text file.

If you can give more details about the setup, I can give you a more precise answer.

rkrishnasanka
  • 166
  • 1
  • 9
  • Thanks for the reply!! I don't have any code at the moment because I was going to build it off of this. I'm using a bot called AnkhBot, and in it's appdata folders, it has a file that gets re-written everytime a new song comes on through the bot itself. So I'm wondering if i can get html to read this file, and update accordingly, and possibly trigger an animation when the file updates Also, the html file will just be on my desktop in a folder, so it wont be hosted or anything anywhere – Stephen Aug 13 '16 at 05:27
  • @Stephen then you have a problem. The javascript will only run in the browser of the person who is using your website. It will not update the html everytime you rewrite it unless they keep loading the page. Here's what you can do: (Browser Javascript) will read the hosted textfile every second with the latest song info. Unfortunately there isnt any way that I know off to trigger the browser page when the text file updates. – rkrishnasanka Aug 23 '16 at 23:00