All times are UTC - 5 hours [ DST ]


Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: UOSA stats in Conky
PostPosted: Wed Sep 07, 2011 10:50 pm 
Offline
UOSA Donor!!
UOSA Donor!!
User Rep: Unsung
 Profile

Joined: Mon Aug 10, 2009 9:25 pm
Posts: 324
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:
Code:
Players: ${texeci 1800 curl -s http://my.uosecondage.com/Status | grep -m 1 -oE "Players Online: [0-9]+" | grep -oE "[0-9]+"} online


Next Event:
Code:
Next Event: ${texeci 1800 curl -s http://my.uosecondage.com/Events/Schedule | grep -m 1 -oE "[0-9]+:[0-9]+[apm]+"}


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.


Top
 
These Support SecondAge
Links open a new window.
UOSA Donors & Subscribers do not receive these ads.

 Post subject: Re: UOSA stats in Conky
PostPosted: Mon Apr 09, 2012 4:25 pm 
Offline
User avatar
User Rep: Trustworthy
Trustworthy
 WWW  ICQ  Profile

Joined: Thu Dec 13, 2007 7:49 pm
Posts: 9002
Location: Cove
I think the new website broke this :(

The stats are now coming from a soon to be new joinUO service.
This will grab the shard stats as a json: http://api.joinuo.com/api/status/bf8d24 ... 827f9f6a1b

Sample:
{"Chars":190142,"Clients":530,"isOnline":true,"Items":7994272,"PollTime":"2012-04-09T20:25:16.6706328Z","Uptime":"09:04:41","Ver":2}

The json format and location of this service are still pretty preliminary; I'll repost when it's final.

Correction: Misread the OP, this is using the myUOSA status page, but the web api may be a better place to snatch the stats from, and feel free to poll every few seconds.

_________________
Image
"The text in this article or section may be incoherent or very hard to understand, and should be reworded if the intended meaning can be determined."


Last edited by Derrick on Wed Apr 25, 2012 11:36 pm, edited 3 times in total.
oops


Top
 

 Post subject: Re: UOSA stats in Conky
PostPosted: Mon Apr 23, 2012 6:42 pm 
Offline
UOSA Donor!!
UOSA Donor!!
User Rep: Unsung
Post Rep: 1
 Profile

Joined: Mon Aug 10, 2009 9:25 pm
Posts: 324
Derrick wrote:
The stats are now coming from a soon to be new joinUO service.
This will grab the shard stats as a json: http://api.joinuo.com/api/status/bf8d24 ... 827f9f6a1b

Sample:
{"Chars":190142,"Clients":530,"isOnline":true,"Items":7994272,"PollTime":"2012-04-09T20:25:16.6706328Z","Uptime":"09:04:41","Ver":2}


This is really cool. This will be even better for conky stats. Unfortunately, there's no real omnipresent command-line tool for parsing json, but it's still possible to `sed` or `awk` it.


Top
 

 Post subject: Re: UOSA stats in Conky
PostPosted: Wed Apr 25, 2012 11:35 pm 
Offline
User avatar
User Rep: Trustworthy
Post Rep: 1
Trustworthy
 WWW  ICQ  Profile

Joined: Thu Dec 13, 2007 7:49 pm
Posts: 9002
Location: Cove
If you need a better format I'd be happy to provide. Let me know :)

_________________
Image
"The text in this article or section may be incoherent or very hard to understand, and should be reworded if the intended meaning can be determined."


Top
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Support Second Age: These links Open in a New Window

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group  
Extended by Karma MOD © 2007—2012 m157y