Added error handling for curl

Only adds IP addresses if curl returned a HTTP response code other than 200 or 302.