Use curl instead of file_get_contents

To avoid problem when allow_url_fopen is set at 0.