Switched to https.
Fixed fetching documents. The URLs had &format=csv appended, which broke that substr call.