can we not pipe to curl here and do this in ruby ?