Hot answers tagged beginner
Here is the relevant section of code from stack.PHP. $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_ENCODING,'gzip'); // Needed by API curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); $data = curl_exec($ch);
that depends on what you mean by 'latest'. do you mean latest created or latest activity? in either case, if you truly want to fetch questions one at a time use pagesize=1 and increment page for each request. Please see notes following this direct answer to your question: http://api.stackoverflow.com/1.0/questions?page=1&pagesize=1&sort=creation ...
gzuncompress is for ZLIB not GZIP. The two algorithms are related, but not identical. gzuncompress isn't strictly guaranteed to decompress all ZLIB streams actually, its just guaranteed to decode the results of gzcompress. Which is honestly really weird. The appropriate function is gzdecode. If that's not available, http_inflate should also work.
Only top voted, non community-wiki answers of a minimum length are eligible