Turn wget code into generic fn, including http chk