Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 06-13-2008, 10:15 PM   #1 (permalink)
 
Newb Techie

Join Date: Jun 2008

Posts: 3

Hazarath is on a distinguished road

Question Need a simple script/EXE.

Alright, I need a script or EXE that'll usually like, attempt to reload google's page every... 30 seconds or so. Upon failure, I want it to simply visit another site, and terminate. It'll be awesome if it'll re-start the script after it loads said site, maybe even pop up a dialog, or play a sound when it loaded the second web page, but the first will be fine.

Thanks ahead of time for replies.

P.S.: The reason I need this is because out ISP likes to remind us that we are past due on our billing, even tough it was their fault to begin with. So, it'll randomly cut off the 'net, re-direct our web browsers to their site, and you click a link to make it reset. [Remind me later, kinda-sorta.]
Hazarath is offline  
Old 06-13-2008, 10:56 PM   #2 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,688

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Need a simple script/EXE.

Sounds to me like you're trying to make a DoS script...
__________________

Need website help? PM me!
CrazeD is offline  
Old 06-13-2008, 11:18 PM   #3 (permalink)
 
Newb Techie

Join Date: Jun 2008

Posts: 3

Hazarath is on a distinguished road

Default Re: Need a simple script/EXE.

Actually, no... I can't proove that I'm not trying to, but, last I checked, ClearWire would detect that kinda thing, and kill my connection if I tried. Got a bug some time last year, and ClearWire cut me off until I addressed the issue, and called them.
Hazarath is offline  
Old 06-13-2008, 11:59 PM   #4 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,688

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Need a simple script/EXE.

I'm not very great with batch/desktop programming.

You can make a loop in a batch file.

Code:
start iexplorer http://google.com
You'll have to do some Google'ing to see how to make a loop.
__________________

Need website help? PM me!
CrazeD is offline  
Old 06-14-2008, 10:05 PM   #5 (permalink)
 
Newb Techie

Join Date: Jun 2008

Posts: 3

Hazarath is on a distinguished road

Default Re: Need a simple script/EXE.

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
Hazarath is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Just need a simple free host.. Max Power Web Site Hosting / ISP Q & A 3 11-27-2007 05:16 AM
Laptop hardware upgrade Simple question Hamuth Everything Laptops 3 11-11-2007 12:47 PM
i want to create simple database linux1880 Programming Discussions 4 09-29-2007 01:01 PM
Simple Hackery Enables Free iTunes Ringtones Osiris Phones – PDA’s – Bluetooth – Other handhelds 0 09-07-2007 01:22 PM
Simple Secure Screen Sharing, to help others jay_bo Search Engines & Internet Traffic 1 08-12-2007 09:36 AM