syntax errors from #2 and output buffering fix

output buffering is not required, use the return transfer flag instead
also merged changes from #2 while I was at it to avoid merge conflicts
Merge pull request #3 from soulseekah/return-output-curl

syntax errors from #2 and output buffering fix