Xbox live

From MythTV Official Wiki
Revision as of 00:50, 15 March 2012 by Wagnerrp (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Time.png Outdated: This utility uses the old mythtvosd protocol, and is not compatible with MythMessage used in 0.25 and later.

Xbox live user status updates via mythtvosd

While watching TV, I want to know if my friends sign into Xbox live. Microsoft makes their presence data available via an XML feed, but limits access to that feed through some developers program. I found a data source that will return presence data, and I parse that with PHP to send updates every few minutes. Here's what you'll need and how I did it;

1 - You'll need apache & PHP. No problem if you have mythweb installed. You can run this script on (I believe) any computer on your network that has apache, php and mythtvosd. It looks like mythtvosd sends out a notice to every computer on your network. mythtvosd should be part of your default mythtv-backend install

2 - prepare the page make a directory in your www root

mkdir /var/www/live

make a file /var/www/live/xbox_status.php and fill it with the following;

http://www.nicholasm.com/mythtvprojects/xbox_status.txt

make another file /var/www/live/gamertags and fill it with a list of the gamertags you'd like updates on
gamertag1,status,
gamertag2,status,
gamertag3,status,

make sure apache owns /var/www/live/gamertags so it can write back to the file

sudo chown www-data.www-data /var/www/live/gamertags (Or whoever is your apache user in your distro)

add a line to your crontab to wget this page every few minutes.

crontab -e
*/10 * * * * nohup wget -q -O /dev/null http://localhost/live/xbox_status.php &>/dev/null

That's it. I'm sure there is a better way to parse xml files and do system calls, but I'm better at PHP.