Mercurial > ~darius > hgwebdir.cgi > scrape-gm
comparison scrape-gm.py @ 5:294581b9c72f
Restrict searches to Australia.
author | darius |
---|---|
date | Fri, 19 Oct 2007 07:53:00 +0000 |
parents | ac32969d1bec |
children | 5058c2695109 |
comparison
equal
deleted
inserted
replaced
4:1378b9c50305 | 5:294581b9c72f |
---|---|
3 ############################################################################ | 3 ############################################################################ |
4 # Screen scraper for game-monitor.com | 4 # Screen scraper for game-monitor.com |
5 # | 5 # |
6 # Prints out matched player names agreated by server | 6 # Prints out matched player names agreated by server |
7 # | 7 # |
8 # $Id: scrape-gm.py,v 1.1.1.1 2007/08/25 05:15:14 darius Exp $ | 8 # $Id: scrape-gm.py,v 1.2 2007/10/19 07:53:00 darius Exp $ |
9 ############################################################################ | 9 ############################################################################ |
10 # | 10 # |
11 # Copyright (C) 2007 Daniel O'Connor. All rights reserved. | 11 # Copyright (C) 2007 Daniel O'Connor. All rights reserved. |
12 # | 12 # |
13 # Redistribution and use in source and binary forms, with or without | 13 # Redistribution and use in source and binary forms, with or without |
144 print sys.argv[0] + "search_string" | 144 print sys.argv[0] + "search_string" |
145 sys.exit(1) | 145 sys.exit(1) |
146 | 146 |
147 try: | 147 try: |
148 #f = open("gm.html") | 148 #f = open("gm.html") |
149 f = urllib.urlopen("http://www.game-monitor.com/search.php?search=" + urllib.quote(sys.argv[1]) + "&type=player") | 149 f = urllib.urlopen("http://www.game-monitor.com/search.php?search=" + urllib.quote(sys.argv[1]) + "&type=player&location=AU") |
150 except IOError, e: | 150 except IOError, e: |
151 print "Unable to fetch page - " + str(e) | 151 print "Unable to fetch page - " + str(e) |
152 sys.exit(0) | 152 sys.exit(0) |
153 | 153 |
154 servers = Server.Scrape(f) | 154 servers = Server.Scrape(f) |