Skip to content

Commit

Permalink
scripted out the discoverer and added in some documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
knorby committed Sep 24, 2012
1 parent 851612d commit 647de05
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions boxeeproxy/discoverer.py 100644 → 100755
@@ -1,6 +1,9 @@
#!/usr/bin/env python
import socket
import hashlib

#somewhat based on http://code.google.com/p/boxeeremote/source/browse/trunk/Boxee%20Remote/src/com/andrewchatham/Discoverer.java
#api at http://developer.boxee.tv/Remote_Control_Interface

BOXEE_APPLICATION_NAME = "boxee"
BOXEE_SHARED_KEY = ""
Expand All @@ -10,6 +13,8 @@


class Discoverer(object):
"""Tool to discover any boxee servers on the local network
following the boxee remote control api"""

def __init__(self, shared_key=BOXEE_SHARED_KEY, port=BOXEE_UDP_PORT,
timeout=TIMEOUT, buffer_size=BUFFER_SIZE,
Expand Down Expand Up @@ -63,3 +68,16 @@ def get_servers(self):

__call__ = get_servers

def main():
import sys
d = Discoverer()
servers = d()
if len(servers)==0:
print "no servers found"
sys.exit(1)
else:
for server in servers:
print server

if __name__=="__main__":
main()

0 comments on commit 647de05

Please sign in to comment.