Xbox Live Friend Notifications
#1
I was wondering is there a plugin that would notify me in xbmc when my friends log into Xbox live
i tried searching the forum but came up with nothing

Reply
#2
Anybody HuhHuh
Reply
#3
There was some discussion about this in a 3 year-old thread: http://forum.xbmc.org/showthread.php?tid=55765

My guess is that, no, there isn't one.
Reply
#4
You got me thinking about this. It just wasn't right that "X"bmc didn't have an Xbox Live plugin. So here: https://github.com/bstrdsmkr/service.XBLFriends

All it does is check your friend's status every three minutes and if it changes to Online, shows a notification. Have fun.
Reply
#5
I loaded this and it worked, and then I noticed subsequent users didnt notify and then noticed the service failed.

18:38:35 T:2889874288 ERROR: Error Type: <class 'ssl.SSLError'>
18:38:35 T:2889874288 ERROR: Error Contents: The read operation timed out
18:38:35 T:2889874288 ERROR: Traceback (most recent call last):
File "/home/xbmc/.xbmc/addons/bstrdsmkr-service.XBLFriends-4a437be/service.py", line 55, in <module>
XBLMonitor().runProgram()
File "/home/xbmc/.xbmc/addons/bstrdsmkr-service.XBLFriends-4a437be/service.py", line 28, in runProgram
data = json.load(urllib2.urlopen(url))
File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 394, in open
response = self._open(req, data)
File "/usr/lib/python2.7/urllib2.py", line 412, in _open
'_open', req)
File "/usr/lib/python2.7/urllib2.py", line 372, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 1209, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib/python2.7/urllib2.py", line 1174, in do_open
r = h.getresponse(buffering=True)
File "/usr/lib/python2.7/httplib.py", line 1027, in getresponse
response.begin()
File "/usr/lib/python2.7/httplib.py", line 407, in begin
version, status, reason = self._read_status()
File "/usr/lib/python2.7/httplib.py", line 365, in _read_status
line = self.fp.readline()
File "/usr/lib/python2.7/socket.py", line 447, in readline
data = self._sock.recv(self._rbufsize)
File "/usr/lib/python2.7/ssl.py", line 232, in recv
return self.read(buflen)
File "/usr/lib/python2.7/ssl.py", line 151, in read
return self._sslobj.read(len)
SSLError: The read operation timed out
Search first, provide details and keep forums clean. Mark things solved, to close them out and acknowledge helpful volunteers who share. If I have helped, click the plus button.
Reply
#6
Yeah it was caused by the connection timing out. I fixed that and a couple of other small bugs. Also added the option to always notify at startup
Reply
#7
(2012-08-13, 19:51)Bstrdsmkr Wrote: Yeah it was caused by the connection timing out. I fixed that and a couple of other small bugs. Also added the option to always notify at startup

Bstrdsmkr, cheers, I tried testing new version today, but ironically no one on my list was getting online today, lol.
I tried to read the code and not familiar with python but think this could be a good learning tool. The API URL is slow.
Did notice the image icon was working sometimes. When I tested w/ my gamertag I just saw a friends online status only and NO icon, but when I tested w/ his I saw my gamer pic?
Would it be better to use https://avatar-ssl.xboxlive.com/avatar/(...rpic-s.png or the *-l.png?
Search first, provide details and keep forums clean. Mark things solved, to close them out and acknowledge helpful volunteers who share. If I have helped, click the plus button.
Reply
#8
I've been testing and added some logging and a delay. Seems to working great now and the delay I think his helping some of the icons to load fast enough.
I'd like to get the gamertag notification for the user to show up red w/ [color red] [/color] but think I'm missing the syntax somewhere. Excited about this addon, thanks!
Search first, provide details and keep forums clean. Mark things solved, to close them out and acknowledge helpful volunteers who share. If I have helped, click the plus button.
Reply
#9
Xbmc has to cache the icon before it'll show up. Unfortunately, the notification is usually give by the time it finished. It should show it the next time it's needed though.

To change the color, add the tags around the appropriate %s where the builtin string is being assembled. Hope that helps!
Reply
#10
haha I'm playing on XBOX now. Seems to work. I added some logging to know if I could see it working for sure in case i just happened to miss it. I added a sleep just to be sure it gave me some time to read it. Yep the icons seem to be working. Your code is amazingly pithy and efficient, the scripts pretty short. I tried to put the tags for the color but when i logged it, i think it looked good, I use it in a batch script I run, but I think maybe something with URL encoding or just not 'escaping' something quite right when I tried to get to work. I tried to manually URL encode the string with %5B and %5D and %20...etc but again not sure its escaping or perhaps the encode already in the script is messing with me. Ill try to play more later. Again can't believe never thought of this plugin and this request just came in so good job again this is super handy
Search first, provide details and keep forums clean. Mark things solved, to close them out and acknowledge helpful volunteers who share. If I have helped, click the plus button.
Reply
#11
Lol, it was mostly a nostalgia thing. If you added something useful, send me a pull request on Github and I'll fold it in. Eventually, I'll stop being lazy and get it into my repository =D

You should be able to change the color of the gamertag on line 56 (haven't tested it though):
builtin = "XBMC.Notification([COLOR red]%s[/COLOR],%s,5000,%s)" %(friend['GamerTag'],friend['Presence'],friend['LargeGamerTileUrl'])

Keep in mind that XBMC's builtins are all strings, including the XBMC.Notification() part. No need for quotes inside the parentheses. Also, in a batch script, Windows doesn't do well with non-ascii characters in the console, so you may see characters replaced with something like "\xU00AE"
Reply
#12
Wow this is brilliant thanks so much
Reply
#13
Ok so i have no clue how to use it do i like have to enter my xbox live details anywhere like how will it know if my friends are online ... i have it installed but dont see how it could possible know if my friends are online .... hope this is not a stupid question
Reply
#14
System->Addons->Enabled Addons->Services->XBLFriends->Configure and enter your Xbox Live ID. Restart XBMC and you should see a notification when a friend comes online
Reply
#15
So I just enter my gamer tag there is no option for a password
Reply

Logout Mark Read Team Forum Stats Members Help
Xbox Live Friend Notifications1