+ made the script https capable

Integrated https fix as requested by bmdixon (http://stackapps.com/a/4565/21728)