Reloading a webpage

Discussion in 'Mac Programming' started by Mikel30, Mar 28, 2011.

  1. Mikel30 macrumors member

    Joined:
    Jan 11, 2004
    #1
    I'm trying to write an Applescript, but I'm not quire sure how to do it. Basically, there's a web page that I want to keep checking on. It's not live yet, and I want to find out when it's up.

    The tricky part is that the webpage redirects if it isn't up yet, so I can't simply reload the page. I want the Applescript to go to the webpage, check to see if it got redirected somewhere else, and if so, load it again. So I need to check to see what page it's currently at, and that's what I can't figure out.
     
  2. balamw, Mar 28, 2011
    Last edited: Mar 28, 2011

    balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #2
    IIRC curl (http://curl.haxx.se/docs/manpage.html) won't follow redirects unless you tell it to. It also seems like you can ask it to output how many redirects it was asked to follow in case it does.

    EDIT: I just checked this on a site I have registered, but not yet set up hosting for. curl http://parkedsite.com gives no output, while curl -L http://parkedsite.com gives me the Network Solutions "Coming Soon" page.

    B
     

Share This Page