I got half way there, but, there's still some problems with it. Due to bandwidth, and crap, sometimes it fails. So, it attempts to open the second URL, if it succeeds or not, and terminates the script. The script I have is Python based, with the appropriate software installed.
This is the script:
Code:
import urllib, time, Tkinter, sys
while True:
try:
if not urllib.urlopen('http://google.com/'):
break
except:
break
print "Retrieved Google successfully, sleeping for 30 seconds. "
time.sleep(30)
print "Could not retrieve Google, opening alternate URL..."
open('simple.py.out', 'w').write(
urllib.urlopen('https://home.clearwire.com/connect/startUp.php').read()
)
print "Done. Exiting."
label = Tkinter.Label(text="Failed to ping Google, opened alternative URL")
label.pack()
button = Tkinter.Button(text="Quit", command=sys.exit)
button.pack()
Tkinter.mainloop()
After it can't reach Google, it pops up that dialog, as it's supposed to. But, the script is halted as it waits for me to click 'Quit'. Then, it produces this:
Code:
Could not retrieve Google, opening alternate URL...
Done. Exiting.
Traceback (most recent call last):
File "C:\Documents and Settings\User\My Documents\simple.py.txt", line 25, in <module>
Tkinter.mainloop()
File "C:\Python25\lib\lib-tk\Tkinter.py", line 328, in mainloop
_default_root.tk.mainloop(n)
File "C:\Python25\lib\lib-tk\Tkinter.py", line 1405, in __call__
raise SystemExit, msg
SystemExit
Any advice? Please note that if you have a easier means, such as JavaScript, or something else I can read the code to just in case you are gonna try to slip me a Trojan, then, please, post a reply.
Thanks for your time,
-Haz