UOSA stats in Conky
Posted: Wed Sep 07, 2011 10:50 pm
I guess this is the most appropriate place to post this. Here is something I hacked up very quickly. It's a way of displaying UOSA stats on your conky setup. If you don't know what conky is, I highly recommend looking into it for nerd points.
It works by polling myUOSA every couple of minutes with curl, and then setting up a grep pipeline to extract the desired data. It's very hacky and not very efficient, but it will allow you to display the current number of players online as well as the time of the next event on your conky window.
Players Online:
Next Event:
These should be inserted into your ~/.conkyrc file, under the TEXT section. (See: http://conky.sourceforge.net/documentation.html for more info). You also obviously need curl installed.
Warning: Do not set the polling intervals to anything lower than what they are. It will be spawning a bunch of threads for no reason and it's already inefficient on top of that. Furthermore, I'm sure Derrick doesn't want people polling myUOSA every 2 seconds. As it stands right now, I have the polling intervals set at 30 minutes, which I think is reasonable. I will not be held responsible for whatever happens to anyone's machine if you do something less than intelligent.
It works by polling myUOSA every couple of minutes with curl, and then setting up a grep pipeline to extract the desired data. It's very hacky and not very efficient, but it will allow you to display the current number of players online as well as the time of the next event on your conky window.
Players Online:
Code: Select all
Players: ${texeci 1800 curl -s http://my.uosecondage.com/Status | grep -m 1 -oE "Players Online: [0-9]+" | grep -oE "[0-9]+"} online
Code: Select all
Next Event: ${texeci 1800 curl -s http://my.uosecondage.com/Events/Schedule | grep -m 1 -oE "[0-9]+:[0-9]+[apm]+"}
Warning: Do not set the polling intervals to anything lower than what they are. It will be spawning a bunch of threads for no reason and it's already inefficient on top of that. Furthermore, I'm sure Derrick doesn't want people polling myUOSA every 2 seconds. As it stands right now, I have the polling intervals set at 30 minutes, which I think is reasonable. I will not be held responsible for whatever happens to anyone's machine if you do something less than intelligent.