If you are having trouble running scripts connecting to the internet in a command line environment due to firewall restrictions, try setting a proxy.
Windows:
set HTTP_proxy=http://my.proxy.server:port
Linux:
export http_proxy=http://my.proxy.server:port
To make proxy settings permanent:
Windows:
add environment variable (configuration panel > system > advanced > environment variables > add user environment variable)
Linux:
add export to user profile and re-source profile