Use open-uri to simplify code and support proxies with http_proxy